Juanaco Posted September 15, 2022 Share Posted September 15, 2022 Hello We are trying to export all products in our page into a .csv, but we also want to include in the export the price with any discounts added (son any specifics prices and also the correct price displayed in our shop) When we make the basic export we only obtain the normal price Any help would be appreciated Thanks in advance! Link to comment Share on other sites More sharing options...
ComGrafPL Posted September 15, 2022 Share Posted September 15, 2022 3 godziny temu, Juanaco napisał: Hello We are trying to export all products in our page into a .csv, but we also want to include in the export the price with any discounts added (son any specifics prices and also the correct price displayed in our shop) When we make the basic export we only obtain the normal price Any help would be appreciated Thanks in advance! Probably a module like this one would help https://addons.prestashop.com/en/data-import-export/17366-csv-specific-prices.html 2 Link to comment Share on other sites More sharing options...
musicmaster Posted September 15, 2022 Share Posted September 15, 2022 Prestools offers quite some flexibility in this. However, your demand for "export the price with any discounts added" is a bit problematic. Technically you may have a hundred different prices. One discount for each country. A different discount before and after 1 October. An extra discount when you offer three pieces, etc. So your requirement is almost bound to become a customized script. Link to comment Share on other sites More sharing options...
Juanaco Posted September 16, 2022 Author Share Posted September 16, 2022 11 hours ago, musicmaster said: Prestools offers quite some flexibility in this. However, your demand for "export the price with any discounts added" is a bit problematic. Technically you may have a hundred different prices. One discount for each country. A different discount before and after 1 October. An extra discount when you offer three pieces, etc. So your requirement is almost bound to become a customized script. Hi! we only want the specific price discount with also the normal price, also we don't have any specifics discounts for countries or for quantities, etc... I only need a sql consult to extract the following data: ID product, name of the product, category, price with and without the tax (there is only one %tax for all our products) and the specific price (for example a discount of 20€ in a product, 30€ in another one... etc) Link to comment Share on other sites More sharing options...
Juanaco Posted September 16, 2022 Author Share Posted September 16, 2022 I have used this sql query SELECT DISTINCT p.id_product AS 'Product ID', pl.name AS 'Product name', cl.name AS 'Default category', p.price AS 'Base price', sp.reduction_type AS 'Reduction type', sp.reduction AS 'Reduction', sp.from_quantity AS 'For quantity', sp.from AS 'Start date', sp.to AS 'End date' FROM ps_product p LEFT JOIN (ps_product_lang pl CROSS JOIN ps_category_lang cl CROSS JOIN ps_specific_price sp) ON (p.id_product = pl.id_product AND p.id_category_default = cl.id_category AND p.id_product = sp.id_product) WHERE sp.reduction_type IS NOT NULL ORDER BY p.id_product; But I have two problems with this, I have a duplicate of every product (because I recover every product in two languages, which I dont need) , and also I don't obtain all the products, don't know why there is some products which doesn't display correctly in the .csv Link to comment Share on other sites More sharing options...
musicmaster Posted September 16, 2022 Share Posted September 16, 2022 23 minutes ago, Juanaco said: I have a duplicate of every product Not hard to solve that. Just add in the WHERE clause "AND id_lang=1" or something similar. 24 minutes ago, Juanaco said: some products which doesn't display correctly That is a bit vague. Please be more exact. Link to comment Share on other sites More sharing options...
Juanaco Posted September 16, 2022 Author Share Posted September 16, 2022 3 minutes ago, musicmaster said: Not hard to solve that. Just add in the WHERE clause "AND id_lang=1" or something similar. That is a bit vague. Please be more exact. I mean there is some products in my shop which doesn't show at all in the .csv using the sql query Link to comment Share on other sites More sharing options...
musicmaster Posted September 16, 2022 Share Posted September 16, 2022 1 hour ago, Juanaco said: I mean there is some products in my shop which doesn't show at all in the .csv using the sql query My first look would be into the ps_specific_price table to see whether those missing id_products can be found there. If not those products might get a discount for some other reason. Link to comment Share on other sites More sharing options...
DavidFortune Posted September 17 Share Posted September 17 On 9/15/2022 at 3:59 PM, ComGrafPL said: Probably a module like this one would help https://addons.prestashop.com/en/data-import-export/17366-csv-specific-prices.html Awesome how no one "of the best" product export module have specific prices feature... CSV specific prices -> Working like a charm 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