Jump to content

.csv file for shipping


Recommended Posts

Hello, do you know how to get a.csv file that contains the first and last name, customer address and order weight to print shipping labels from a .csv file please?

On the .csv files on the order page there is no customer address column.

 

1193350790_testcommandeaffranchir.thumb.jpg.8d266babc4821fcbc3a256e076daa0a7.jpg

 

531744217_testcommandeaffranchir2.thumb.jpg.8c076031c5fc61b72a481855cf40761d.jpg

 

Thanks a lot for your answer.

Link to comment
Share on other sites

Hey,

You can use the SQL SQUERY below, you could add id to your "SQL Manager" in your back-office so you can run it whenever you want. (Keep in mind that with prestashop 1.7.5 the SQL manager does not work, it will work again in prestashop 1.7.6)

SELECT
a.`id_order`,
`reference`,
`total_paid_tax_incl`,
`payment`,
a.`date_add` AS `date_add`, 
a.id_currency,
a.id_order AS id_pdf,
c.`firstname` AS firstname,
c.`lastname` AS lastname,
osl.`name` AS `osname`,
os.`color`,
IF((SELECT so.id_order FROM `ps_orders` AS 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, shop.name AS shop_name 
FROM `ps_orders` AS a 
LEFT JOIN `ps_customer` AS c ON (c.`id_customer` = a.`id_customer`)
INNER JOIN `ps_address` AS address ON address.id_address = a.id_address_delivery
INNER JOIN `ps_country` AS country ON address.id_country = country.id_country
INNER JOIN `ps_country_lang` AS country_lang ON (country.`id_country` = country_lang.`id_country` AND country_lang.`id_lang` = 1)
LEFT JOIN `ps_order_state` AS os ON (os.`id_order_state` = a.`current_state`)
LEFT JOIN `ps_order_state_lang` AS osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = 1) 
LEFT JOIN `ps_shop` AS shop
ON a.`id_shop` = shop.`id_shop` WHERE 1 AND a.id_shop IN (1) 
ORDER BY a.id_order DESC

 

Link to comment
Share on other sites

  • 10 months later...

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