Jump to content

Create Query with daily orders + product name


PietroElle

Recommended Posts

0001.thumb.jpg.52301030adf108d6a85fc32c9424a701.jpg

Hello everyone

Prestashop version 1.6.1.9

Is it possible to create a table from prestashop SQL Manager with all the details of the ORDER backoffice page, also inserting the name of the product that was sold?

If yes, what are the parameters to be included in the table?

Can anyone help me?

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

In the SQL manager this is possible provided that there is only one product in the order.


Otherwise, you need to create a php script and export your orders to xml or json.

Link to comment
Share on other sites

2 ore fa, Guest dice:

In the SQL manager this is possible provided that there is only one product in the order.


Otherwise, you need to create a php script and export your orders to xml or json.

Hello

Thanks for the reply.

Can you help me design the order table of the last 7 days by entering the name of the product that was sold?

It must contain everything in the back office-> orders + product name + reference


Thank you.

Link to comment
Share on other sites

2 ore fa, Guest dice:

In the SQL manager this is possible provided that there is only one product in the order.


Otherwise, you need to create a php script and export your orders to xml or json.

 

32 minuti fa, pietroelle dice:

Hello

Thanks for the reply.

Can you help me design the order table of the last 7 days by entering the name of the product that was sold?

It must contain everything in the back office-> orders + product name + reference


Thank you.

 

Link to comment
Share on other sites

You mean free export orders to xml?

Scripts will certainly not give you free.


There is no such thing.
There are paid modules.

https://addons.prestashop.com/en/data-import-export/30817-export-orders-to-csv-or-xml.html


If your warehouse has a specific import file structure, you must make a request.

 

https://www.prestashop.com/forums/forum/235-job-offers/

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

50 minuti fa, Guest dice:

Intendi ordini di esportazione gratuiti in XML?

Gli script certamente non ti daranno gratuitamente.


Non vi è nulla di simile.
Ci sono moduli a pagamento.

https://addons.prestashop.com/en/data-import-export/30817-export-orders-to-csv-or-xml.html


Se il magazzino ha una struttura di file di importazione specifica, è necessario effettuare una richiesta.

 

https://www.prestashop.com/forums/forum/235-job-offers/

I don't want a form.

I want to insert the name of the product sold in this table

 

 

SELECT SQL_CALC_FOUND_ROWS a.`id_order`, `reference`, `total_paid_tax_incl`, `payment`, a.`date_add` AS `date_add` , a.id_currency, a.id_order AS id_pdf, CONCAT(LEFT(c.`firstname`, 1), '. ', c.`lastname`) AS `customer`, osl.`name` AS `osname`, os.`color`, IF((SELECT so.id_order FROM `ps_orders` so WHERE so.id_customer = a.id_customer AND so.id_order < a.id_order LIMIT 1) > 0, 0, 1) as new, country_lang.name as cname, IF(a.valid, 1, 0) badge_success FROM `ps_orders` a LEFT JOIN `ps_customer` c ON (c.`id_customer` = a.`id_customer`) LEFT JOIN `ps_address` address ON address.id_address = a.id_address_delivery LEFT JOIN `ps_country` country ON address.id_country = country.id_country LEFT JOIN `ps_country_lang` country_lang ON (country.`id_country` = country_lang.`id_country` AND country_lang.`id_lang` = 2) LEFT JOIN `ps_order_state` os ON (os.`id_order_state` = a.`current_state`) LEFT JOIN `ps_order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = 2) WHERE 1 AND a.`date_add` >= '2020-04-20 0:0:0' AND a.`date_add` <= '2020-04-20 23:59:59' ORDER BY a.`id_order` DESC LIMIT 0, 50

Link to comment
Share on other sites

And last time I write that multiple products with one sql query CANNOT be written to one line of CSV file.
The SQL manager creates only CSV.
If you look at the database and the ps_order_detail table, you might understand.

Link to comment
Share on other sites

1 minuto fa, Guest dice:

E l'ultima volta che scrivo che più prodotti con una query sql NON POSSONO essere scritti su una riga di file CSV.
Il gestore SQL crea solo CSV.
Se guardi il database e la tabella ps_order_detail, potresti capire.

Ok Thank's

Link to comment
Share on other sites

5 ore fa, Guest dice:

Intendi ordini di esportazione gratuiti in XML?

Gli script certamente non ti daranno gratuitamente.


Non vi è nulla di simile.
Ci sono moduli a pagamento.

https://addons.prestashop.com/en/data-import-export/30817-export-orders-to-csv-or-xml.html


Se il magazzino ha una struttura di file di importazione specifica, è necessario effettuare una richiesta.

 

https://www.prestashop.com/forums/forum/235-job-offers/

Hello.

Anyway I wanted to warn you that I did it despite not being a developer.

Thanks for your attention.

Link to comment
Share on other sites

In SQL Manager, did you manage to get all products from the order into one line of the CSV file?
For example, if an order has 6 products, are they in one line?
Then you're a magician.

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