yazane Posted October 5, 2013 Share Posted October 5, 2013 (edited) Hi I want to show all products of the store in the home sorting by category like name of category1: list of category 2 's product name of category2: list of category 2 's product thanks Edited October 5, 2013 by yazane (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted October 6, 2013 Share Posted October 6, 2013 hello you want to display it as a separate tabs or what? can you shed some light on it please? Link to comment Share on other sites More sharing options...
yazane Posted October 6, 2013 Author Share Posted October 6, 2013 hello you want to display it as a separate tabs or what? can you shed some light on it please? yeah exactly Link to comment Share on other sites More sharing options...
vekia Posted October 7, 2013 Share Posted October 7, 2013 well, by default it isn't possible, only with modifications and it will not be as easy as it seems. you will need to modify module .tpl file and also core (.php file) for example. $products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8)); this is definition of home cateogry, all products are stored in $products variable. define $products2 variable and $products3 variable with different categories, for example categories with id: 3 and 4 $products2 = $category->getProducts(3, 1, ($nb ? $nb : 8)); $products3 = $category->getProducts(4, 1, ($nb ? $nb : 8)); then attach these variables to smarty array, just modify code to: $this->smarty->assign(array( 'products' => $products, 'products3' => $products3, 'products4' => $products4, 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'homeSize' => Image::getSize(ImageType::getFormatedName('home')), )); now you can modify .tpl file to display these products, just duplicate code and change foreach function item from $products to products3 and then to $products4 1 Link to comment Share on other sites More sharing options...
aftermarket Posted October 31, 2013 Share Posted October 31, 2013 How can I list all the links to products in the home category on the category block, instead of categories. I want to do away with this: <ul class="tree {if $isDhtml}dhtml{/if}"> {foreach from=$blockCategTree.children item=child name=blockCategTree} {if $smarty.foreach.blockCategTree.last} {include file="$branche_tpl_path" node=$child last='true'} {else} {include file="$branche_tpl_path" node=$child} {/if} {/foreach} </ul> And just loop through all the products in the home category instead of the categories. Thanks for your help. I am sorry, but I am not very familiar with prestashop file names. Link to comment Share on other sites More sharing options...
vekia Posted October 31, 2013 Share Posted October 31, 2013 unfortunately it will not be as easy as it seems, you will need to create array with query results (getProducts()) and then - make foreach loop on passed to smarty variable Link to comment Share on other sites More sharing options...
suneel Posted November 2, 2013 Share Posted November 2, 2013 (edited) Dear vekia file file need to add this this code please guide me the proper location of file i can't under stand Edited November 2, 2013 by suneel (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted November 2, 2013 Share Posted November 2, 2013 hello i talked about homefeatured.php file located in module directory (modules/homefeatured) you can find code that i mentioned easily. then just follow my instructions from post #4 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