skur2000 Posted August 17, 2017 Share Posted August 17, 2017 Hi help me, please module Homefutured, presta1.6, i want do it this : from last add item -> to old item now,as defoult, this sort: from old add item - to last add item may be this do it code : /modules/homefeatured/views/templates/hook <li class="ajax_block_product col-xs-12 col-sm-3 item1 {if $smarty.foreach.homeFeaturedProducts.first}first_item{elseif $smarty.foreach.homeFeaturedProducts.last}last_item{else}item1{/if} {if $smarty.foreach.homeFeaturedProducts.iteration%$nbItemsPerLine == 0}last_item_of_line{elseif $smarty.foreach.homeFeaturedProducts.iteration%$nbItemsPerLine == 1} {/if} {if $smarty.foreach.homeFeaturedProducts.iteration > ($smarty.foreach.homeFeaturedProducts.total - $totModulo)}last_line{/if}"> Link to comment Share on other sites More sharing options...
BonPresta Posted August 17, 2017 Share Posted August 17, 2017 Hi help me, please module Homefutured, presta1.6, i want do it this : from last add item -> to old item now,as defoult, this sort: from old add item - to last add item may be this do it code : /modules/homefeatured/views/templates/hook <li class="ajax_block_product col-xs-12 col-sm-3 item1 {if $smarty.foreach.homeFeaturedProducts.first}first_item{elseif $smarty.foreach.homeFeaturedProducts.last}last_item{else}item1{/if} {if $smarty.foreach.homeFeaturedProducts.iteration%$nbItemsPerLine == 0}last_item_of_line{elseif $smarty.foreach.homeFeaturedProducts.iteration%$nbItemsPerLine == 1} {/if} {if $smarty.foreach.homeFeaturedProducts.iteration > ($smarty.foreach.homeFeaturedProducts.total - $totModulo)}last_line{/if}"> Hello, The file modules / homefeatured / homefeatured.php There, not by date, but by default in the directory, sorting by default. It is necessary to change instead of 'position' in this line HomeFeatured::$cache_products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8), 'position'); 'date_add' , 'DESC' HomeFeatured::$cache_products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8), 'date_add' , 'DESC'); Link to comment Share on other sites More sharing options...
skur2000 Posted August 17, 2017 Author Share Posted August 17, 2017 yes. we do it, big thanks -) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now