cancel
Showing results for 
Search instead for 
Did you mean: 

Link eav_attribute_option_value to catalog_product_entity

Link eav_attribute_option_value to catalog_product_entity

I want to link an attribute to its product which means link catalog_product_entity to eav_attribute_option_value This is my essay :

 

SELECT DISTINCT catalog_product_entity_text.value   AS nom_du_produit,
            sales_flat_order.created_at         AS date_de_commande,
            sales_flat_order.grand_total        AS prix_avant_remise,
            sales_flat_order.subtotal           AS prix_apres_remise,
            sales_flat_order_address.firstname  AS prenom,
            sales_flat_order_address.lastname   As nom,
            sales_flat_order_address.telephone  AS telephone,
            sales_flat_order_address.country_id AS pays
FROM catalog_product_entity cpe,
 sales_flat_order,
 sales_flat_order_address,
 eav_attribute,
 eav_attribute_option_value,
 catalog_product_entity_text
     LEFT JOIN sales_flat_order AS sales
               ON (sales.entity_id = 
catalog_product_entity_text.entity_id)
     LEFT JOIN sales_flat_order_address AS address
               ON (address.entity_id = 
catalog_product_entity_text.entity_id)
     LEFT JOIN catalog_product_entity as sku
               on (sku.entity_id = sales.entity_id)
where sales_flat_order.coupon_code like 'xxxxx'
and cpe.sku = '00-000-00' and eav_attribute_option_value.value='Sony';

Thanks in advance

2 REPLIES 2

Re: Link eav_attribute_option_value to catalog_product_entity

Hello @ahmed_chouihi 

 

To solve your issue, you need to link the below three tables:

 

  • eav_attribute_option - This table links to the attribute's option.
  • eav_attribute_option_value - This table links to the option's value/label.
  • catalog_product_entity_int - This table links the option's value to the product.

Hope it helps.

---
If you've found my answer useful, please give"Kudos" and "Accept as Solution"

Re: Link eav_attribute_option_value to catalog_product_entity

Please please how your answer gonna help me?!