daily pastebin goal
64%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. INSERT INTO `catalog_product_index_price_bundle_sel_idx`
  2. SELECT `i`.`entity_id`, `i`.`customer_group_id`, `i`.`website_id`, `bo`.`option_id`, `bs`.`selection_id`, IF(bo.type = 'select' OR bo.type = 'radio', 0, 1) AS `group_type`, `bo`.`required` AS `is_required`, IF(IF(i.base_group_price IS NOT NULL AND i.base_group_price > 0 AND i.base_group_price < 100, ROUND(idx.min_price - idx.min_price * (i.base_group_price / 100), 2), idx.min_price) * bs.selection_qty < IF(i.special_price > 0 AND i.special_price < 100, ROUND(idx.min_price * (i.special_price / 100), 2), IFNULL(idx.min_price, 0)) * bs.selection_qty, IF(i.base_group_price IS NOT NULL AND i.base_group_price > 0 AND i.base_group_price < 100, ROUND(idx.min_price - idx.min_price * (i.base_group_price / 100), 2), idx.min_price) * bs.selection_qty, IF(i.special_price > 0 AND i.special_price < 100, ROUND(idx.min_price * (i.special_price / 100), 2), IFNULL(idx.min_price, 0)) * bs.selection_qty) AS `price`, IF(i.base_tier IS NOT NULL, ROUND(idx.min_price * (i.base_tier / 100), 2)* bs.selection_qty, NULL) AS `tier_price`, IF(i.base_group_price IS NOT NULL, ROUND(idx.min_price * (i.base_group_price / 100), 2)* bs.selection_qty, NULL) AS `group_price`
  3. FROM `catalog_product_index_price_bundle_idx` AS `i`
  4. INNER JOIN `catalog_product_bundle_option` AS `bo` ON bo.parent_id = i.entity_id
  5. INNER JOIN `catalog_product_bundle_selection` AS `bs` ON bs.option_id = bo.option_id
  6. LEFT JOIN `catalog_product_bundle_selection_price` AS `bsp` ON bs.selection_id = bsp.selection_id AND bsp.website_id = i.website_id
  7. INNER JOIN `catalog_product_index_price_idx` AS `idx` ON bs.product_id = idx.entity_id AND i.customer_group_id = idx.customer_group_id AND i.website_id = idx.website_id
  8. INNER JOIN `catalog_product_entity` AS `e` ON bs.product_id = e.entity_id AND e.required_options=0 WHERE (i.price_type=0)
  9. ON DUPLICATE KEY UPDATE `group_type` = VALUES(`group_type`), `is_required` = VALUES(`is_required`), `price` = VALUES(`price`), `tier_price` = VALUES(`tier_price`), `group_price` = VALUES(`group_price`);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top