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 AVG(order_cnt) AS ppy | |
| FROM | |
| (SELECT customer_id, | |
| COUNT(customer_id) AS order_cnt | |
| FROM | |
| (SELECT so.customer_id, | |
| YEAR(so.created_at) AS year_ordered, | |
| group_concat(si.sku SEPARATOR ',') AS skus | |
| FROM `sales_flat_order` AS so | |
| INNER JOIN `sales_flat_order_item` AS si ON si.order_id=so.entity_id |
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 AVG(average_base_subtotal) AS acp | |
| FROM | |
| (SELECT AVG(sub_query.base_subtotal) AS average_base_subtotal | |
| FROM | |
| (SELECT so.base_subtotal | |
| FROM `sales_flat_order` AS so | |
| INNER JOIN `sales_flat_order_item` AS si ON si.order_id=so.entity_id | |
| GROUP BY entity_id) AS sub_query) AS 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 * | |
| FROM catalogsearch_query | |
| WHERE num_results = 0 | |
| AND updated_at >= date_sub(CURDATE(), interval 6 DAY) | |
| AND updated_at <= CURDATE() |
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 cv.value as `is_dealer`, e.* FROM customer_entity AS e | |
| LEFT JOIN customer_entity_int AS cv | |
| ON ( cv.attribute_id = ( | |
| SELECT attribute_id FROM eav_attribute | |
| WHERE entity_type_id = e.entity_type_id | |
| AND attribute_code = 'is_dealer' | |
| ) | |
| AND cv.entity_id = e.entity_id) | |
| WHERE cv.value = 1 |
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
| find . -type f \-exec chmod 644 {} \; | |
| find . -type d \-exec chmod 755 {} \; | |
| find ./var -type d \-exec chmod 777 {} \; | |
| find ./var -type f \-exec chmod 666 {} \; | |
| find ./media -type d \-exec chmod 777 {} \; | |
| find ./media -type f \-exec chmod 666 {} \; | |
| chmod 777 ./app/etc | |
| chmod 644 ./app/etc/*.xml |
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 cv.value as `telephone`, e.* FROM customer_entity AS e | |
| LEFT JOIN customer_address_entity_varchar AS cv | |
| ON ( cv.attribute_id = ( | |
| SELECT attribute_id FROM eav_attribute | |
| WHERE attribute_code = 'telephone' | |
| ) | |
| AND cv.entity_id = e.entity_id) | |
| WHERE LENGTH(cv.value) > 1 |
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(); | |
| $db_conn = Mage::getSingleton('core/resource'); | |
| $r_conn = $db_conn->getConnection('core_read'); | |
| $w_conn = $db_conn->getConnection('core_write'); | |
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 | |
| $csv = array(); | |
| if (($handle = fopen('your_csv_file_name_here.csv', "r")) !== FALSE) { | |
| $rowCounter = 0; | |
| while (($rowData = fgetcsv($handle, 0, ",")) !== FALSE) { | |
| if (0 === $rowCounter) { | |
| $headerRecord = $rowData; | |
| } else { | |
| foreach ($rowData as $key => $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 | |
| require_once('app/Mage.php'); | |
| umask(0); | |
| Mage::app(); | |
| $product = Mage::getModel('catalog/product')->load(1); | |
| echo Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getImage()); |
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
| echo "Community Namespace" | |
| echo "------------------------------------------" | |
| cd app/code/community | |
| for i in $(ls -d */) | |
| do | |
| echo ${i%%/} && fgrep -Rho --include='*.php' '__(' ${i%%/} | wc -l | |
| done | |
| echo | |
| echo "Local Namespace" | |
| echo "------------------------------------------" |
OlderNewer