Skip to content

Instantly share code, notes, and snippets.

@trabulium
trabulium / change-dropdown-attribute-to-multiselect.sql
Last active August 15, 2017 00:14 — forked from dinhkhanh/change-dropdown-attribute-to-multiselect.sql
Magento change dropdown attribute to multiselect
-- 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',
@trabulium
trabulium / gist:e50de5884d740de83ae9e1dda48cfaed
Created January 16, 2017 03:26 — forked from antoinekociuba/gist:f136d817c22cd750dc252a4434cc72f4
Flush Magento EE url rewrites (>= 1.13) + Rebuild
# 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`;
@trabulium
trabulium / CustomerWishlist.sql
Last active December 17, 2015 08:58 — forked from drewgillson/CustomerWishlist.sql
Customer Wishlist including lastname, price, sku
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