Skip to content

Instantly share code, notes, and snippets.

View overrode's full-sized avatar
🏠
Working from home

DaniSimon overrode

🏠
Working from home
  • Barcelona
View GitHub Profile
@rafaelstz
rafaelstz / SQL_Orders_Sales_Customers_Report.sql
Created November 6, 2017 19:17
Magento 1 - SQL to get the each customer sales and orders total
# Get the each customer sales and orders total
SELECT
-- Round to two decimal places and prepend with $
CONCAT('$', FORMAT(SUM(sales_flat_order.`grand_total`), 2)) AS 'Lifetime Sales',
COUNT(sales_flat_order.entity_id) AS 'Orders',
customer_entity.email AS 'Email',
MAX(sales_flat_order.created_at) AS 'Most Recent Order Date'
FROM `customer_entity`
LEFT JOIN sales_flat_order ON customer_entity.entity_id = sales_flat_order.customer_id
@schmengler
schmengler / add-checkout-form-key.sh
Last active September 2, 2022 16:23
Magento SUPEE-9767 Checkout Form Key Theme Patch
find -L app/design/frontend -regex '.*\(shipping\|billing\|shipping_method\|payment\).phtml' -exec grep -L formkey {} \; \
| xargs sed -i 's/<\/form>/<?php echo $this->getBlockHtml("formkey") ?><\/form>/g'
find -L skin/frontend -name 'opcheckout.js' -exec grep -L form_key {} \; \
| xargs sed -i 's/if (elements\[i\].name=='\''payment\[method\]'\'') {/if (elements[i].name=='\''payment[method]'\'' || elements[i].name == '\''form_key'\'') {/g'
@dfelton
dfelton / Magento 2 - tar exclusion parameters.MD
Last active March 27, 2024 10:45
Magento 2 - Directories to exclude when tarballing a site

Exclusion List

List of exclusion paramters for tar command. Focus put on image cache directories, tmp files, log files, and generated source files.

  • --exclude="./pub/media/*/*/cache"
  • --exclude="./pub/media/js"
  • --exclude="./pub/media/tmp"
  • --exclude="./pub/media/wysiwyg/.thumbs"
@nikolazic
nikolazic / tar_magento_media_exclude.sh
Last active September 9, 2021 14:38
Tar Magento Media directory excluding cache files
tar -cvf ~/media-`date +%Y%m%d`.tar --exclude-vcs --exclude='*.htaccess' --exclude='*/cache/*' --exclude='*/cache' --exclude='*/.thumbs/*' --exclude='*/.thumbs' --exclude='*/tmp/*' --exclude='*/tmp' --exclude='*/js/*' --exclude='*/js' --exclude='*/css/*' --exclude='*/css' --exclude='*/captcha/*' --exclude='*/captcha' --exclude='*/css_secure/*' --exclude='*/css_secure' --exclude='*/customer/*' --exclude='*/customer' --exclude='*/dhl/*' --exclude='*/dhl' --exclude='*/downloadable/*' --exclude='*/downloadable' --exclude='*/xmlconnect/*' --exclude='*/xmlconnect' media