Jump to content

SQL MANAGER - Show Custom Field in request on order list


Borgas

Recommended Posts

Hi Forum

Prestashop 1.6.1.18

 

I have a SQL request to export all orders with products to csv:

 

SELECT d.id_order AS ID_Registo, o.reference AS ref, os.name AS Estado_Pagamento, o.date_upd AS Data, d.product_name AS Produto, d.product_reference AS Referencia, d.product_quantity AS Quantidade,  d.product_price AS Preco_Produto, ai.company AS Matricula,  CONCAT_WS(  ' ', g.firstname, g.lastname ) AS Nome_Cliente,  CONCAT_WS(' ', ad.address1, ad.address2, ad.other, ad.phone, ad.phone_mobile) AS Morada, ad.postcode AS Cod_Postal, ad.city AS Localidade, CONCAT_WS(' ', ai.address1, ai.address2, ai.other) AS Morada, g.email AS Email, ai.phone AS Telefone, ai.phone_mobile AS Telemóvel
FROM psha_order_detail d
LEFT JOIN psha_orders o ON ( d.id_order = o.id_order )
LEFT JOIN psha_customer g ON ( o.id_customer = g.id_customer )
LEFT JOIN psha_stock_available s ON (d.product_id = s.id_product)
LEFT JOIN psha_address ad ON (o.id_address_delivery = ad.id_address)
LEFT JOIN psha_address ai ON (o.id_address_invoice = ai.id_address)
LEFT JOIN psha_group_lang gl ON ( g.id_default_group = gl.id_group )
LEFT JOIN psha_order_state_lang os ON ( o.current_state = os.id_order_state )
WHERE os.id_lang =1
GROUP BY d.id_order, d.product_name
ORDER BY d.id_order DESC

 

But 1 (only) product as a custom field. How can i show it on list/request??

 

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