HMoreira Posted January 5, 2015 Share Posted January 5, 2015 Hi, I already searched on web and didn't found what i need. I'm developing an PrestaShop "shop", and i need on the product detail, have tabs with the related products group by category. Example: Product 1 Detail TAB Informations, TAB category 1 (with related products), TAB category 4 (with related products) etc... Something like this: http://www.logiscenter.com/impresoras-codigo-barras/mod-gk420 Best Regards,H Moreira Link to comment Share on other sites More sharing options...
fred-vinapresta Posted January 5, 2015 Share Posted January 5, 2015 Hi, first you have to create a system that enables you to choose related categories for one product. The cleanest way to do it is to create a module adding a tab in the product administration with related categories to select. Then in you productController file, you have to request the module table (where related categories are registered) and for each category of the result you have to use the getProducts method of Category class to retrieve their products. Then you put all in an array and assign it to smarty to use in in product.tpl. In this template, you need to make a loop to create category tabs containing product. Link to comment Share on other sites More sharing options...
HMoreira Posted January 5, 2015 Author Share Posted January 5, 2015 (edited) Hi Fred Vine Presta, Thank you for your reply. However, isn't possible get de categories from related products? I already made this on "pure php", but in prestashop i don't know how! If I "know" all related products, all products have an category, correct? Why i can't use this information? In "Pure PHP" I create an sql query that returns all related products group by category and create the tab header. I save this categories in an array, and inside an foreach loop I made an query that returns related products for each category. Thank you.B.R.H Moreira Edited January 5, 2015 by hmaltronix (see edit history) 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