How can I choose specific products by id on owl-carousel?
-
05-10-2020 - |
题
I'm trying to add some specific products (choose by product_id, for example) on my homepage using the owl-carousel and a cms block. I did it for categories using the category_id
filter, but it doesn't work for product_id
.
How can I make this carousel for a list of chosen product_ids
(some filter like: products with id 1234, 2142 and 1235) ?
The default version for the owl-carousel and the block:
<div id="carousel_featured" class="owl-top-narrow">
{{block type="filterproducts/latest_home_list" category_id="5" template="filterproducts/list.phtml"}}
</div>
<script type="text/javascript">
jQuery(function($){
$("#carousel_featured .filter-products .owl-carousel").owlCarousel({
lazyLoad: true,
itemsCustom: [ [0, 1], [320, 1], [480, 2],[640, 3], [768, 4], [992, 6] ],
responsiveRefreshRate: 50,
slideSpeed: 200,
paginationSpeed: 500,
scrollPerPage: false,
stopOnHover: true,
rewindNav: true,
rewindSpeed: 600,
pagination: false,
navigation: true,
autoPlay: true,
navigationText:["<i class='icon-left-open'></i>","<i class='icon-right-open'></i>"]
});
});
</script>
Thanks :)
解决方案
Create new category from backend.
Add all your required products in that category.
Give that category id to
{{block type="filterproducts/latest_home_list" category_id="<New_Category_Id>" template="filterproducts/list.phtml"}}