Jump to content

[FREE TUTORIAL] Add bought products to the Order list in the back office


NemoPS

Recommended Posts

  • 2 years later...
  • 3 years later...
Just now, NemoPS said:

Doesn't the same still work? The orders page should still be made with controller + view

I just tried it an hour ago and it works. the only thing I can´t get to work is another separator between products than ",".

How can I have each product of an order in one separate line?

Link to comment
Share on other sites

2 hours ago, NemoPS said:

Doesn't the same still work? The orders page should still be made with controller + view

Just tested it a bit more and realized that after implementing your code, the order reference isn´t shown anymore. There´s only "-" shown for each reference....

I changed this line:

(SELECT GROUP_CONCAT(odd.product_name SEPARATOR ", ") FROM `' . _DB_PREFIX_ . 'order_detail` odd WHERE odd.id_order = a.id_order) as products,

to this:

(SELECT GROUP_CONCAT(odd.product_reference SEPARATOR ", ") FROM `' . _DB_PREFIX_ . 'order_detail` odd WHERE odd.id_order = a.id_order) as products,

 

Do you know why this happens when I want to show the product_reference instead of the product_name?

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

4 hours ago, NemoPS said:

Very odd, it's hard to tell without seeing it in action, are you adding both? If so you'll have to change the second alias that now reads "products" as well

Thanks for your answer. Well, no I just changed odd.product_name to odd.product_reference.
Should I send you my controller file?

Link to comment
Share on other sites

  • 4 years later...

Hello NemoPS,
I was using this code on my Prestashop 1.6 version. 
Thanks again, it was VERY useful! (I personally replaced the References column).
I migrated to 1.7.8 and would like to know how to adapt this code to my new version, I have no idea how to do it.
So far I've just managed to change the column name in shop/src/Core/Grid/Definition/Factory/OrderGridDefinitionFactory.php ....
Thanks in advance for your help!


capt-nouveau-site.thumb.jpg.e7864fe52518a8183339d6f4285752fc.jpg

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