Jump to content

Back office add description and all categories to product list


jgriff89

Recommended Posts

Hi,

 

I've been following this topic: https://www.prestashop.com/forums/topic/275522-solved-add-backoffice-columns-products-list/page-5

 

I'm trying to add the product description and all the categories products are listed under to the product list in the back office, but I'm struggling to do it. I've added the following to controllers/admin/AdminProductController.php:

 

on line 185:

LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.id_product = pl.id_product.')

Then I've added this at line 238:

	$this->fields_list['description'] = array(
            'title' => $this->l('description'),
            'type' => 'description',
            'align' => 'text-right',
            'filter_key' => 'a!description'
			
			);

But I can't get it to work. Does anybody have any pointers?

 

I'm also trying to add to the categories column all the categories a product is listed under, if anybody has any information on that at all?

 

Best wishes,

 

Jamie 

 

Link to comment
Share on other sites

Product lang should be there already as b.
Try using b!description for the filter. The rest should be okay, I believe it grabs everything out of that table. If not, add this

$this->_select .= 'b.description, ';

Before the fields list

  • Like 1
Link to comment
Share on other sites

All of the categories? There? you can try to adapt this: http://nemops.com/filter-products-by-manufacturer-prestashop-back-office/#.VvUluOIgvmg
Instead of the manufacturer, join the category_product table. It's a bit complex as you have to use a subquery. I am not a sql [spam-filter] so I'd probably go wrong on the first attempt if I were to tell you the query now. In any case, use GROUP_CONCAT like in this tut: http://nemops.com/bought-products-prestashop-order-list/#.VvUmFOIgvmg

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