Jump to content

Recommended Posts

Hi,

 

I would like to display a column with the product tags in admin (in product listing) :

(On the screenshot, i’ve translated the column name "tag" by "artists" but it is the tag datas)

 

420356tagsoverride.png

 
I’ve created an override of AdminProductsController.php
 
Then, I’ve extended the query in order to display tags in a column.
 
$this->_join .= ' LEFT JOIN `' . _DB_PREFIX_ . 'product_tag` AS p_tag ON (p_tag.`id_product` = a.`id_product`) ';
 
Now, i can display the tag id in a column.
 
How can i have now the tag name (column name of tag table)
 
I don’t know how to make this double join in pretsashop ? 
Edited by Cloud Nine (see edit history)

Share this post


Link to post
Share on other sites

ok, finally, it was a simple sql syntax :

$this->_join .= ' LEFT JOIN `' . _DB_PREFIX_ . 'product_tag` AS p_tag ON (p_tag.`id_product` = a.`id_product`) LEFT JOIN `' . _DB_PREFIX_ . 'tag` AS t ON (p_tag.`id_tag` = t.`id_tag`) ';

Share this post


Link to post
Share on other sites
  • 2 months later...
  • 3 years later...

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

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More