Jump to content
Sign in to follow this  
mitsi2011

récupérer les attributs des articles de la commande

Recommended Posts

Bonjour,

Je veux récupérer les valeurs des attributs produits dans chaque colonne.

J'ai fais cette requête mais c'est presque .

       Taille     Couleur     product_attribute_id     id_order     product_name          
        NULL    Rouge             10                                   1            Blouse - Color : White, Size : M     
        NULL    Orange             13                                 1            Printed Dress - Color : Orange, Size : S    

Votre aide svp.

Merci

SELECT SQL_CALC_FOUND_ROWS
		
al.`name` AS Taille,al3.`name` AS Couleur,
product_attribute_id, a.id_order, a.product_name

FROM `ps_order_detail` a 
				
LEFT JOIN `ps_product_lang` pl ON (pl.id_product = a.`product_id` AND pl.id_lang = 1)
               
LEFT JOIN `ps_attribute` att ON (att.`id_attribute` = a.`product_attribute_id` AND att.`id_attribute_group`=1)
LEFT JOIN `ps_attribute_group` ag ON (ag.`id_attribute_group` = att.`id_attribute_group` AND ag.`id_attribute_group`=1)
LEFT JOIN `ps_attribute_lang` al ON (att.`id_attribute` = al.`id_attribute` AND al.`id_lang` = 1)
LEFT JOIN `ps_attribute_group_lang` agl ON (ag.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = 1 AND agl.`id_attribute_group`=1) 
        
LEFT JOIN `ps_attribute` att3 ON (att3.`id_attribute` = a.`product_attribute_id` AND att3.`id_attribute_group`=3)
LEFT JOIN `ps_attribute_group` ag3 ON (ag3.`id_attribute_group` = att3.`id_attribute_group` AND ag3.`id_attribute_group`=3)
LEFT JOIN `ps_attribute_lang` al3 ON (att3.`id_attribute` = al3.`id_attribute` AND al3.`id_lang` = 1)
LEFT JOIN `ps_attribute_group_lang` agl3 ON (ag3.`id_attribute_group` = agl3.`id_attribute_group` AND agl3.`id_lang` = 1 AND agl3.`id_attribute_group`=3) 
        
LEFT JOIN ps_orders o ON (a.id_order = o.id_order)

 

Share this post


Link to post
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
Sign in to follow this  

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More