SHARE
TWEET

Prestashop export ordini con dettagli

a guest Jan 17th, 2018 229 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT d.id_order AS 'ID ordine', o.reference AS 'Rif. ordine', os.name AS 'Stato', o.date_upd AS 'Data ordine', d.product_name AS 'Prodotto', d.product_reference AS 'Cod. Rif.', d.product_quantity AS 'Qt.', s.quantity AS 'In stock', d.product_price AS 'Prezzo', o.payment AS 'Pagamento',  CONCAT_WS(  ' ', g.firstname, g.lastname ) AS 'Cliente',  CONCAT_WS(' ', ad.address1, ad.address2, ad.postcode, ad.city, ad.other, ad.phone, ad.phone_mobile) AS 'Spedizione', CONCAT_WS(' ', ai.address1, ai.address2,  ai.postcode, ai.city, ai.other, ai.phone, ai.phone_mobile) AS 'Fatturazione', g.email AS 'Email', gl.name AS 'Gruppo'
  2. FROM ps_order_detail d
  3. LEFT JOIN ps_orders o ON ( d.id_order = o.id_order )
  4. LEFT JOIN ps_customer g ON ( o.id_customer = g.id_customer )
  5. LEFT JOIN ps_stock_available s ON (d.product_id = s.id_product)
  6. LEFT JOIN ps_address ad ON (o.id_address_delivery = ad.id_address)
  7. LEFT JOIN ps_address ai ON (o.id_address_invoice = ai.id_address)
  8. LEFT JOIN ps_group_lang gl ON ( g.id_default_group = gl.id_group )
  9. LEFT JOIN ps_order_state_lang os ON ( o.current_state = os.id_order_state )
  10. WHERE os.id_lang =1
  11. GROUP BY d.id_order, d.product_name
  12. ORDER BY d.id_order DESC
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top