andre.markus Posted September 2, 2014 Share Posted September 2, 2014 Hi fans. I have a simple problem:I want to display the product accessoires in the product-list. In the detail view (product.tpl) I find the right part: {if isset($accessories) && $accessories} ... {/if} I copy & paste the part into the product-list.tpl but it seems the variable $accessoires is empty in the list view. Is there a solution to the problem? Cheers André Link to comment Share on other sites More sharing options...
PSfever.com Posted September 2, 2014 Share Posted September 2, 2014 Hi Andre, nothing will show up, because the accessories array is empty (not defined) in category controller. You will have to define it there first. There is a solution, but it would require custom editing of CategoryController.php. Link to comment Share on other sites More sharing options...
andre.markus Posted September 3, 2014 Author Share Posted September 3, 2014 Thanks for your tipp! I added some lines to Product.php, which is called from CategoryController to have all data in an sub-array within the variable $product for the product-list.tpl {if isset($product.accessories) && $product.accessories} .. {foreach from=$product.accessories item=accessory name=accessories_list} // same code from product.tpl {/foreach} .. {/if} Quick and dirty but it works! Link to comment Share on other sites More sharing options...
chirru4 Posted February 3, 2015 Share Posted February 3, 2015 Hello Andre, could you tell me how did you add the propperty "accessories" to the $product object in product.php to do that property accessible in product-list.tpl I'm a little new with some concepts of prestashop and i need to show in the homefeatured block of the home in my page the price of the most cheap accessorie instead of real price if the product has accessories, and at the momment these kind of products show a 0.00 € It would be very nice if you of someone can reply me as quick as possible because my shop is closed now in maintennance for it. Link to comment Share on other sites More sharing options...
victordzul Posted May 20, 2015 Share Posted May 20, 2015 Can you tell me I 've added code in CategoryController.php or product.php please .I need to add that information to my site. Thanks and regards 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