Search code examples
magento

Magento 2: export products contains catalog price rules


There's a way to export list of products contain also the catalog price rule?

enter image description here

By default export, csv contain the only standard price instead of price by rules defined in "Marketing" > "Catalog price rules"

Thanks in advance


Solution

  • In case it can be useful to someone else, I have solved by this query:

    SELECT 
          DISTINCT cp.product_id, cpev.value, cpip.price, cpip.min_price, cpe.sku
    FROM `m2_catalogrule_product` as cp 
    INNER JOIN m2_catalog_product_entity_varchar as cpev 
          ON cp.product_id = cpev.entity_id
    INNER JOIN m2_catalog_product_index_price as cpip 
          ON cpip.entity_id = cp.product_id
    INNER JOIN m2_catalog_product_entity as cpe 
          ON cpe.entity_id = cp.product_id
    GROUP BY cp.product_id