Run through the following steps to setup this project on your local environment. These instructions assume you're using the standard Classy Llama devenv.
Use the following to connect to stage.
| # Set admin login to 6 days | |
| bin/magento -q config:set admin/security/session_lifetime 518400 | |
| # Allow admin logins to be bookmarked | |
| bin/magento -q config:set admin/security/use_form_key 0 | |
| # Set customer login to 4 hours | |
| bin/magento -q config:set web/cookie/cookie_lifetime 14400 | |
| # Misc dev settings | |
| bin/magento -q config:set dev/css/merge_css_files 0 | |
| bin/magento -q config:set dev/js/merge_files 0 | |
| bin/magento -q config:set dev/js/enable_js_bundling 0 |
| SET @utc_offset = 6; | |
| -- Orders Per Year -- | |
| SELECT period_date, CONCAT("UTC-", @utc_offset) AS utc_offset, order_count, gross_revenue, ROUND(gross_revenue / order_count, 2) AS gross_aov | |
| FROM ( | |
| SELECT | |
| COUNT(*) AS order_count, | |
| ROUND(SUM(base_grand_total), 2) AS gross_revenue, | |
| date_format(date_sub(o.created_at, INTERVAL @utc_offset HOUR), "%Y") AS period_date | |
| FROM sales_order o |
Run through the following steps to setup this project on your local environment. These instructions assume you're using the standard Classy Llama devenv.
Use the following to connect to stage.
| # List the composer home directory | |
| # Typically /Users/<user>/.composer or /home/<user>/.composer or C:\Users\<user>\AppData\Roaming\Composer | |
| echo $COMPOSER_HOME | |
| # List files in the composer home | |
| ls -la $COMPOSER_HOME | |
| # View auth.json in composer home used when no local ./auth.json exists in the directory executed from | |
| cat $COMPOSER_HOME/auth.json |
| /* find the largest tables on the server */ | |
| SELECT CONCAT(table_schema, '.', table_name) 'db.table', | |
| CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows, | |
| CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA, | |
| CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx, | |
| CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size, | |
| ROUND(index_length / data_length, 2) idxfrac | |
| FROM information_schema.TABLES | |
| ORDER BY data_length + index_length DESC | |
| LIMIT 10; |
| find . -printf '%TY-%Tm-%Td %TH\n' | sort | uniq -c |
| SET SESSION group_concat_max_len = 1000000; | |
| SELECT job_code, count(job_code) AS how_many_times_did_job_run_more_than_once, SUM(count) AS total_number_of_times_job_ran, GROUP_CONCAT(executed_at_group) AS executed_at FROM ( | |
| SELECT cron_schedule.*, GROUP_CONCAT(cron_schedule.executed_at) AS executed_at_group, count(job_code) AS count FROM cron_schedule WHERE executed_at IS NOT NULL GROUP BY job_code, executed_at HAVING count(job_code) > 1 ORDER BY executed_at DESC | |
| ) AS duplicate_crons | |
| GROUP BY job_code | |
| ORDER BY count(job_code) DESC; |
| Index: Model/SalesRule/Calculator.php | |
| IDEA additional info: | |
| Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
| <+>UTF-8 | |
| =================================================================== | |
| --- Model/SalesRule/Calculator.php (date 1513354238000) | |
| +++ Model/SalesRule/Calculator.php (date 1513354238000) | |
| @@ -45,6 +45,17 @@ | |
| break; | |
| From 3523dd79d949f93e31fc675b190f17baf66f36c3 Mon Sep 17 00:00:00 2001 | |
| From: Erik Hansen <erikpallhansen@gmail.com> | |
| Date: Wed, 1 Feb 2017 13:20:02 -0600 | |
| Subject: [PATCH] Edit the 'URL key for specified store already exists' message | |
| --- | |
| Model/Storage/AbstractStorage.php | 5 ++++- | |
| Model/Storage/DbStorage.php | 5 ++++- | |
| 2 files changed, 8 insertions(+), 2 deletions(-) |
| /* | |
| Run the following query to get a set of queries that will purge all tables of email addresses. The queries that are output from | |
| this should be manually reviewed to remove queries for any unnecessary tables and can then be run manually or via a Magerun "db:query" | |
| to include it as a part of a scripted cloning process. | |
| IMPORTANT: Make sure to update the @db_name variable | |
| What the resulting query will do: | |
| -- Replace the emails in Magento with dummy emails (unless email is one of the whitelisted domains) in order to prevent emails erroneously being sent to customers. | |
| -- Make all emails with @example.com and use and MD5 of the original domain of the email as the tag for the email. This is important in case we have two emails with the | |
| -- same "local part" but different "domain part". For example, bob.smith@yahoo.com would become bob.smith+c9d12f@example.com |