Jump to content

Combinations Export


nabo

Recommended Posts

Hi all

 

I tried and tried but I couldn't achieve my goal.

Is there a way to export product quantity split by combinations? I handle a shop that sells t-shirt in various sizes, but I was able only to get the total quantity. Do I need some additional modules? Should I write my own query?

 

thanks

Link to comment
Share on other sites

Prestashop 1.6.0.8

 

Hi

 

 

This will do what you need. I use multi-shop which is why there are references to id_shop. You should run this in PHPMyAdmin or whatever database tool you use.

SELECT e.name as prodname, 
                  a.reference as sku,
                  c.name as colour,
                  f.quantity as quantity
FROM ps_product_lang e, ps_product_attribute a, ps_product_attribute_combination b, ps_attribute_lang c, ps_attribute d, ps_stock_available f
WHERE e.id_lang = 2
AND e.id_shop = 2
AND e.id_product = a.id_product
AND a.id_product_attribute = b.id_product_attribute
AND b.id_attribute = c.id_attribute
AND c.id_attribute = d.id_attribute
AND c.id_lang = 2
AND a.id_product = f.id_product
AND a.id_product_attribute = f.id_product_attribute
AND e.id_shop = f.id_shop
order by e.name asc, d.id_attribute asc

Cheers.

  • Like 1
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...