Jump to content

Export orders for label printing


spsurfer

Recommended Posts

Hello,

our webshop is working together with a shipping company (GLS) that allows us to print the labels from the exported orders.

 

But the "Export" function won't eport the fields we need.

 

This is what I get when I export an order:

 

"ID";"Referencia";"Nuevo cliente";"Entrega";"Cliente";"Total";"Pago";"Estado";"Fecha";
 
"4633";"KURFOWLMG";"Sí";"España";"Name Cient";"20,95€";"PayPal";"Payment accepted";"2017-05-16 16:52:34";
 
Attached the information we need to be exported.
 
I read that I can change the to be eported fields in the "SQL Manager" but don't have a clue how!
 
Actually in the "SQL Manager" I have one field with "Orders" with the following code
 
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 `uyy_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 `uyy_orders` a 
 
 
LEFT JOIN `uyy_customer` c ON (c.`id_customer` = a.`id_customer`)
LEFT JOIN `uyy_address` address ON address.id_address = a.id_address_delivery
LEFT JOIN `uyy_country` country ON address.id_country = country.id_country
LEFT JOIN `uyy_country_lang` country_lang ON (country.`id_country` = country_lang.`id_country` AND country_lang.`id_lang` = 2)
LEFT JOIN `uyy_order_state` os ON (os.`id_order_state` = a.`current_state`)
LEFT JOIN `uyy_order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = 2) 
WHERE 1  
 
ORDER BY a.`id_order` DESC
 
Can anyone tell me how to configurate to export the desired information?
 
Thanks in advance
Nicolas

 

post-1239195-0-42282000-1494952252_thumb.png

Link to comment
Share on other sites

Hello,

I installed DataKick but have some questions... (please see pm)

Is there an option to just export the latest orders?

Let's say, I made a list with name, adress, product description, etc. but I only want to export the orders placed today, can I filter these by date?

 

Thanks in advance

Nicolas

Link to comment
Share on other sites

Hello,

I installed DataKick but have some questions... (please see pm)

Is there an option to just export the latest orders?

Let's say, I made a list with name, adress, product description, etc. but I only want to export the orders placed today, can I filter these by date?

 

Thanks in advance

Nicolas

 

Hi Nicolas,

 

sure, it's possible.

 

We will need to create a condition that will filter our dataset. I always recommend to first create column with the same (or similar) expression we will later use in condition, just to see which records will be filtered out.

 

1) Let's create Age column - number of days since order creation. Click on any column, and change it's expression to 

 

dateDiff(now(), order.dateCreated)

 

This will return number of days between two dates:

 

orders-age-field.png

 

 

2) create condition - switch to DataSet tab, click on Add Condition, and add something like

 

dateDiff(now(), order.dateCreated) <= 1

 

This expression will return true for every order newer than 1 day. And that's it.

 

orders-age-field-filter.png

Edited by DataKick (see edit history)
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...