Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- cpe.entity_id "Product id",
- ccet1.store_id "Store id",
- cpe.sku "Sku",
- cpev.value "Product name",
- cpe.type_id "Product type",
- eas.attribute_set_name "Attribute set name",
- cpip.price "Base price",
- cpip.final_price "Final price",
- currency.value "Currency",
- ccet1.value "Description",
- CASE WHEN cpev2.value IS NULL OR cpev2.value = 'no_selection'
- THEN ''
- ELSE concat(url.value, 'media/catalog/product', cpev2.value) END "Image url",
- CASE WHEN urlSuffix.value IS NULL
- THEN concat(url.value, cpeuk.value)
- ELSE concat(url.value, cpeuk2.value, '.', urlSuffix.value) END "Link"
- FROM (catalog_product_entity cpe,
- #currency
- (SELECT ccd.value
- FROM core_config_data ccd
- WHERE ccd.path = 'currency/options/default') AS currency,
- #base url
- (SELECT ccd.value
- FROM core_config_data ccd
- WHERE scope_id = 1 AND ccd.path = 'web/unsecure/base_url') AS url,
- #product url suffix
- (SELECT ccd2.value
- FROM core_config_data ccd2
- WHERE ccd2.path = 'catalog/seo/product_url_suffix') AS urlSuffix
- )
- #attribute set name
- LEFT JOIN eav_attribute_set eas
- ON cpe.attribute_set_id = eas.attribute_set_id
- #description
- LEFT JOIN catalog_product_entity_text ccet1
- ON cpe.entity_id = ccet1.entity_id
- #base and final price
- LEFT JOIN catalog_product_index_price cpip
- ON cpe.entity_id = cpip.entity_id
- #name
- LEFT JOIN catalog_product_entity_varchar cpev
- ON cpe.entity_id = cpev.entity_id
- #image
- LEFT JOIN catalog_product_entity_varchar cpev2
- ON cpe.entity_id = cpev2.entity_id
- #url key for a store
- LEFT JOIN catalog_product_entity_url_key cpeuk
- ON cpe.entity_id = cpeuk.entity_id
- #url key for the default store
- LEFT JOIN catalog_product_entity_url_key cpeuk2
- ON cpe.entity_id = cpeuk2.entity_id
- WHERE
- #description
- ccet1.store_id IN (1) AND ccet1.attribute_id = 72
- #price
- AND cpip.website_id = ccet1.store_id AND cpip.customer_group_id = 1
- #name
- AND cpev.store_id = ccet1.store_id AND cpev.attribute_id = 71
- #image
- AND cpev2.store_id = 0 AND cpev2.attribute_id = 85
- #url key by store id
- AND cpeuk.store_id = ccet1.store_id
- #url key for default store
- AND cpeuk2.store_id = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement