Jump to content

[SOLVED] Show attribute group in product list


Shwamateur

Recommended Posts

Hi everyone!
I'm having a weird issue:

I'm trying to display the attribute group of each product on the product list. (in our store we use only one attribute combinations) so we can show something like " Choose size" or "Choose color" (a link that goes to the product page).

I modified Category.php (function getProducts) in order to properly retrieve via sql the attribute group name.
In CategoryController.php (at the end of the assignProductList method)  I use print_r to display all the products in order to confirm that I am retrieving well the atribute group name, and it is there ant it is correct.

The issue is that I can't manage to display this via product-list.tpl: it is showing just "Choose" and blank. I can display any other attribute retrieved via Category.php getProducts (visibility, name, meta_keywords) but I can't manage to display this one...

Can someboy help me?
Thank you very much.

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

I discovered something, if I go to Category.php, method getProducts and I assign a new name to any of the fields in the SELECT statement ( I tried pl.`meta_title` metatitle), I can't display them either on the product list... Any idea?

Link to comment
Share on other sites

It looks like I'm not calling properly the

"$this->category->getProducts($this->context->language->id, (int)$this->p, (int)$this->n, $this->orderBy, $this->orderWay);"

method on CategoryController (If I print_r $this->cat_products the attribute group name doesn't appear).

I'm sure it has something to do with the actionProductListOverride hook, but I don't know how this works.

 

Any help would be very appreciated.

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...