Scaling Magento presentation with 60 slides and notes, which was then reviewed by Alan Storm.
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
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
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
| ### Events during order submit process | |
| `core_copy_fieldset_customer_account_to_quote` | |
| `core_copy_fieldset_sales_convert_quote_to_order` | |
| `sales_convert_quote_to_order` | |
| `core_copy_fieldset_sales_convert_quote_address_to_order` | |
| `sales_convert_quote_address_to_order` | |
| `core_copy_fieldset_sales_convert_quote_address_to_order_address` | |
| `sales_convert_quote_address_to_order_address` |
The purpose of this SQL script is to clean up a Magento 1.x database by deleting orphaned
records from database tables which cause foreign key contraint failures. This happens when
at some point in time records where deleted from the database while FOREIGN_KEY_CHECKS = 0
and the person performing the delete operations failed to delete all related records
pertaining to related tables of the primary table.
This script can be helpful when encountering foreign key constraint failures using the Data Migration Tool to migrate your
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 | |
| class EcomDev_Optimization_Model_Rule_Observer extends Mage_CatalogRule_Model_Observer | |
| { | |
| protected $_preloadedPrices = array(); | |
| public function beforeCollectTotals(Varien_Event_Observer $observer) | |
| { | |
| $quote = $observer->getQuote(); | |
| $date = Mage::app()->getLocale()->storeTimeStamp($quote->getStoreId()); |
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
| n98-magerun.phar config:dump | xmlstarlet sel -t -m '/config/global/events/*/observers/*' -v ./class -o ' ' -v ./method -o ' ' -v ./type -n |
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
| http://fishpig.co.uk/magento/tutorials/direct-sql-queries/ | |
| Yes you can run direct sql queries within Magento, the best way to do this is to use the read write resource. You can insatiate it with: | |
| $resource = Mage::getSingleton('core/resource'); | |
| $readConnection = $resource->getConnection('core_read'); | |
| $writeConnection = $resource->getConnection('core_write'); | |
| To run a select you can do something like this: |
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
| // This is how you would use it. Pass in your collection | |
| // along with an individual callback as well as a batch callback | |
| Mage::getSingleton('stcore/resource_iterator_batched')->walk( | |
| $collection, | |
| array($this, 'batchIndividual'), | |
| array($this, 'batchAfter'), | |
| self::BATCH_SIZE | |
| ); | |
| public function batchIndividual($model) |
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 | |
| namespace Vendor\Module\Test\Unit; | |
| use Magento\Framework\App\ObjectManagerFactory as AppObjectManagerFactory; | |
| use Magento\Framework\Config\File\ConfigFilePool; | |
| use Magento\Framework\ObjectManagerInterface; | |
| use Magento\Framework\Filesystem\DriverPool; | |
| use Magento\Framework\Filesystem\Driver\File; | |
| use Magento\Framework\App\Filesystem\DirectoryList; |