This file contains hidden or 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 COUNT(entity_id) as num_custs FROM ( | |
| SELECT entity_id | |
| FROM `sales_flat_order` | |
| GROUP BY customer_email | |
| HAVING SUM(base_subtotal) < 100 | |
| ) sub_query |
This file contains hidden or 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 sub_query.month_ordered, | |
| AVG(sub_query.base_subtotal) AS average_base_subtotal, | |
| AVG(sub_query.discount_amount) AS average_discount_amt, | |
| AVG(sub_query.order_qty) AS average_total_item_count, | |
| COUNT(sub_query.entity_id) AS total_orders | |
| FROM | |
| (SELECT so.entity_id, | |
| MONTH(so.created_at) AS month_ordered, | |
| YEAR(so.created_at) AS year_ordered, | |
| so.base_subtotal, |
This file contains hidden or 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
| # define your Mage install directory | |
| MAGENTO_ROOT=/var/www/beep/us | |
| THEME_BASE=enterprise | |
| CURRENT_THEME=global_base | |
| # create directory to hold existing extension configs | |
| mkdir $MAGENTO_ROOT/app/etc/modules_backup | |
| mkdir $MAGENTO_ROOT/app/etc/modules_backup/stock_magento | |
| # copy all stock Magento configs to stock_magento folder |
This file contains hidden or 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
| #! /bin/bash | |
| if [ "$#" == "0" ]; then | |
| echo | |
| echo "Sorry cant run!" | |
| echo "No arguments provided. Please pass this script agruments in the following format:" | |
| echo "./magestocker.sh magento_root theme_base current_theme_name" | |
| echo "example: " | |
| echo "./magestocker.sh /var/www/magento default mytheme" | |
| echo "another example:" |
This file contains hidden or 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
| <?php | |
| require_once('app/Mage.php'); | |
| umask(0); | |
| Mage::app('default'); | |
| $db_conn = Mage::getSingleton('core/resource'); | |
| $r_conn = $db_conn->getConnection('core_read'); |
This file contains hidden or 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 * | |
| FROM `catalog_product_entity` AS a | |
| LEFT JOIN `catalog_product_entity_media_gallery` AS b ON a.entity_id = b.entity_id | |
| WHERE b.value IS NULL |
This file contains hidden or 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 a.sku, b.value, c.position | |
| FROM `catalog_product_entity` AS a | |
| LEFT JOIN `catalog_product_entity_media_gallery` AS b ON a.entity_id = b.entity_id | |
| INNER JOIN `catalog_product_entity_media_gallery_value` AS c ON c.value_id = b.value_id | |
| WHERE a.sku = 98044057168 |
This file contains hidden or 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 * FROM ( SELECT | |
| ce.sku, | |
| ea.attribute_id, | |
| ea.attribute_code, | |
| CASE ea.backend_type | |
| WHEN 'varchar' THEN ce_varchar.value | |
| WHEN 'int' THEN ce_int.value | |
| WHEN 'text' THEN ce_text.value | |
| WHEN 'decimal' THEN ce_decimal.value | |
| WHEN 'datetime' THEN ce_datetime.value |
This file contains hidden or 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
| <?php | |
| /** | |
| * export-all-product-attributes.php | |
| * @author Tegan Snyder <tsnyder@tegdesign.com> | |
| */ | |
| // init Magento | |
| require_once('app/Mage.php'); | |
| umask(0); | |
| Mage::app('default'); |
This file contains hidden or 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
| <?php | |
| define('MAGENTO', realpath(dirname(__FILE__))); | |
| require_once MAGENTO . '/app/Mage.php'; | |
| umask(0); | |
| Mage::app(); | |
| try { | |
| $user = Mage::getModel('admin/user') | |
| ->setData(array( |