Jump to content

PS 1.7, attributes on a products-list.tpl


mipapage

Recommended Posts

Hello everyone,

We are upgrading to 1.7 from 1.6. In PS 1.6, we were able to extend CategoryControllerCore and use the following code to get product attribute data to show in the list views (based somewhat on this code from @NemoPS)

$attributes_combinations = Product::getAttributesInformationsByProduct($product['id_product']);

After a bit of looping and wrangling, that code went to Smarty to be used on products-list.tpl:

$this->context->smarty->assign('products', $this->cat_products);


The same bit of code does absolutely nothing in PS 1.7. We need to get the attribute data, because some of our products are available in different lot sizes. 

In 1.7 I notice that class CategoryControllerCore extends ProductListingFrontController, whereas in 1.6 class CategoryControllerCore extends FrontController.

So yeah. I don't have it clear where this should be done, and I'm guessing the best answer would be to use a hook (actionGetProductPropertiesBefore or after?) rather than an override.

I would be very grateful if someone could point me in the right direction. Thanks!

Edited by mipapage (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...