PAVON Posted January 5, 2023 Share Posted January 5, 2023 Hello, good afternoon I would like, if possible, to group the brands by categories. Example: Modeling marks. Brand A - Brand B hardware brands Brand C - Brand D Craft Brands Mark E - Mark F We use Prestashop 1.7.8.8 Our website www.pavononline.com Thanks and good year santi Link to comment Share on other sites More sharing options...
Knowband Plugins Posted January 5, 2023 Share Posted January 5, 2023 You can get the manufacture data like manufacture name and image from the below code function getManufacturers($id_category) { global $cookie; $manufacturers = array(); $category = new Category($id_category); $products = $category->getProducts(intval($cookie->id_lang), 1, 1000000); if ($products) foreach ($products as $product) { $manufacturers['object'][$product['id_manufacturer']] = new Manufacturer(intval($product['id_manufacturer']), intval($cookie->id_lang)); $manufacturers['image'][$product['id_manufacturer']] = (!file_exists(_PS_MANU_IMG_DIR_.'/'.$product['id_manufacturer'].'-medium.jpg')) ? Language::getIsoById(intval($cookie->id_lang)).'-default' : $product['id_manufacturer']; } $subcategories = $category->getSubcategories(intval($cookie->id_lang)); if ($subcategories) foreach ($subcategories as $subcategory) $manufacturers = array_merge($manufacturers, getManufacturers($subcategory['id_category'])); return $manufacturers; } $manufacturer_fields = getManufacturers($category->id_category); $manufacturers = $manufacturer_fields['object']; $manufacturer_images = $manufacturer_fields['image']; Assign the same variable to the TPL and use as per your needs. 1 Link to comment Share on other sites More sharing options...
El Patron Posted January 5, 2023 Share Posted January 5, 2023 Just make brands features then you can include in your filter system note your shop product list uses nav followed by filters, I highly recommend using filters only....it's important they are able to drill down to product(s) on current page and not nav way as you do now. Avoid trying to make 'brands' act like categories, brands are better defined as prod feature or cat/subcat. 1 Link to comment Share on other sites More sharing options...
El Patron Posted January 5, 2023 Share Posted January 5, 2023 to original posted I noticed Link to comment Share on other sites More sharing options...
PAVON Posted January 5, 2023 Author Share Posted January 5, 2023 Thanks a lot I try it and tell you Link to comment Share on other sites More sharing options...
El Patron Posted January 5, 2023 Share Posted January 5, 2023 1 minute ago, PAVON said: Thanks a lot I try it and tell you let us know how it goes, I recommend amazzing filters from addons, it's expensive but probably the best module you will ever invest in. if you are talking about applying the hack then sorry you ignored my expert advice. Link to comment Share on other sites More sharing options...
PAVON Posted January 5, 2023 Author Share Posted January 5, 2023 I want to arrange the marks on this screen Link to comment Share on other sites More sharing options...
El Patron Posted January 5, 2023 Share Posted January 5, 2023 29 minutes ago, PAVON said: I want to arrange the marks on this screen you do better using filters...then brands are on product list...not some brands page... I've given best advice, good luck 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