monicaamb Posted February 10, 2023 Share Posted February 10, 2023 (edited) Hello. I see that PrestaShop exports some data to you but I'm missing those two. How can I get them? I see I can obtain by the table product_lang but I don't know how to do it. I will share what I have now: SELECT CONCAT(LEFT(cu.firstname, 1), '. ', cu.lastname) AS customer, o.id_order, o.reference, o.total_paid_tax_incl, os.paid, osl.name AS osname, o.id_currency, cur.iso_code, o.current_state, o.id_customer, cu.deleted AS deleted_customer, os.color, o.payment, s.name AS shop_name, o.date_add, cu.company, cl.name AS country_name, o.invoice_number, o.delivery_number, (SELECT IF(count(so.id_order) > 0, 0, 1) FROM w5kn_orders so WHERE (so.id_customer = o.id_customer) AND (so.id_order < o.id_order) LIMIT 1) AS new, p.reference as sku, pl.name AS product_name FROM w5kn_orders o LEFT JOIN w5kn_customer cu ON (o.id_customer = cu.id_customer) LEFT JOIN w5kn_currency cur ON (o.id_currency = cur.id_currency) INNER JOIN w5kn_address a ON (o.id_address_delivery = a.id_address) LEFT JOIN w5kn_order_state os ON (o.current_state = os.id_order_state) LEFT JOIN w5kn_shop s ON (o.id_shop = s.id_shop) INNER JOIN w5kn_country c ON (a.id_country = c.id_country) INNER JOIN w5kn_country_lang cl ON (c.id_country = cl.id_country AND cl.id_lang = o.id_lang) LEFT JOIN w5kn_order_state_lang osl ON (os.id_order_state = osl.id_order_state AND osl.id_lang = o.id_lang) INNER JOIN w5kn_order_detail od ON (o.id_order = od.id_order) INNER JOIN w5kn_product p ON (od.product_id = p.id_product) LEFT JOIN w5kn_product_lang pl ON (pl.id_product = p.id_product AND pl.id_lang = o.id_lang) WHERE o.id_shop IN ('1') ORDER BY o.id_order DESC LIMIT 50; Thank you very much in advance Edited February 12, 2023 by monicaamb (see edit history) Link to comment Share on other sites More sharing options...
s4lvozesta Posted February 14, 2023 Share Posted February 14, 2023 you could always append this to the SELECT statement pl.`description`, pl.`description_short`, pl.`meta_description`, pl.`link_rewrite` although on the link part, you would need your URL 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now