This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- First, update the attribute input type to multiselect | |
UPDATE eav_attribute SET | |
entity_type_id = 4, | |
attribute_model = NULL, | |
backend_model = 'eav/entity_attribute_backend_array', | |
source_model = NULL, | |
backend_type = 'varchar', | |
backend_table = NULL, | |
frontend_model = NULL, | |
frontend_input = 'multiselect', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SQL Query | |
SET FOREIGN_KEY_CHECKS = 0; | |
TRUNCATE TABLE `enterprise_url_rewrite_redirect_rewrite`; | |
TRUNCATE TABLE `enterprise_url_rewrite_redirect_cl`; | |
TRUNCATE TABLE `enterprise_url_rewrite_redirect`; | |
TRUNCATE TABLE `enterprise_url_rewrite_product_cl`; | |
TRUNCATE TABLE `enterprise_url_rewrite_category_cl`; | |
TRUNCATE TABLE `enterprise_url_rewrite`; | |
TRUNCATE TABLE `enterprise_catalog_product_rewrite`; | |
TRUNCATE TABLE `enterprise_catalog_category_rewrite`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT b.email, c.value AS name,d.value as lastname, a.updated_at, e.added_at, e.product_id, f.sku, f.name, f.price, SUM(h.qty_ordered) AS purchased | |
FROM `mage_wishlist` AS a | |
INNER JOIN mage_customer_entity AS b ON a.customer_id = b.entity_id | |
INNER JOIN mage_customer_entity_varchar AS c ON a.customer_id = c.entity_id AND c.attribute_id = (SELECT attribute_id FROM mage_eav_attribute WHERE attribute_code = 'firstname' AND entity_type_id = b.entity_type_id) | |
INNER JOIN mage_customer_entity_varchar AS d ON a.customer_id = d.entity_id AND d.attribute_id = (SELECT attribute_id FROM mage_eav_attribute WHERE attribute_code = 'lastname' AND entity_type_id = b.entity_type_id) | |
INNER JOIN mage_wishlist_item AS e ON a.wishlist_id = e.wishlist_id | |
INNER JOIN mage_catalog_product_flat_1 AS f ON e.product_id = f.entity_id | |
LEFT JOIN mage_sales_flat_order AS g ON g.customer_email = b.email | |
LEFT JOIN mage_sales_flat_order_item AS h ON (g.entity_id = h.order_id AND h.sku LIKE CONCAT(f.sku,'%') AND h.product_type = 'simple') | |
GROUP |