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
| # Empty relevant tables | |
| DELETE FROM sales_flat_creditmemo; | |
| DELETE FROM sales_flat_invoice; | |
| DELETE FROM sales_flat_order; | |
| DELETE FROM sales_flat_quote; | |
| DELETE FROM sales_flat_shipment; | |
| DELETE FROM customer_entity; | |
| # Reset increment_ids | |
| # Beware of store_ids when using multiple stores |
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 Chapagain\HelloWorld\Block; | |
| class HelloWorld extends \Magento\Framework\View\Element\Template | |
| { | |
| protected $_stockItemRepository; | |
| public function __construct( | |
| \Magento\Backend\Block\Template\Context $context, | |
| \Magento\CatalogInventory\Model\Stock\StockItemRepository $stockItemRepository, | |
| array $data = [] |
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 UpgradeSchema implements UpgradeSchemaInterface | |
| { | |
| /** | |
| * {@inheritdoc} | |
| */ | |
| public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context){ | |
| $setup->startSetup(); |
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 | |
| switch($_GET['clean']) { | |
| case 'log': | |
| clean_log_tables(); | |
| break; | |
| case 'var': | |
| clean_var_directory(); | |
| break; | |
| } |
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 | |
| #Instructions to use this script | |
| # | |
| #chmod +x SCRIPTNAME.sh | |
| # | |
| #sudo ./SCRIPTNAME.sh | |
| echo "###################################################################################" | |
| echo "Please be Patient: Installation will start now.......and it will take some time :)" |
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 | |
| /****************************************************************************************************************** | |
| * Source: http://www.emvee-solutions.com/blog/magento-custom-reindex-script/ | |
| * | |
| * Custom Magento re-indexing script | |
| ******************************************************************************************************************/ | |
| //Place this file in your Magento root folder, or modify the require once to match your directory. | |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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 | |
| // Initialize | |
| $app = new SimpleHttpClient('http://www.demo.local/xmlconnect/'); | |
| $app->addCookie('app_code', 'INSERT APP CODE HERE'); | |
| $app->addCookie('screen_size', '600x400'); | |
| // get products in category 3 |
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
| /* fix grid items height */ | |
| function fixGridHeight() { | |
| jQuery('.products-grid').each(function () { | |
| var items_in_row = Math.floor(jQuery(this).width() / jQuery('li.item', this).outerWidth(true)); | |
| var height = [], row = 0, rowClass = 0; | |
| jQuery('li.item', this).each(function (i, v) { | |
| if(jQuery(this).attr("data-class") != ''){ | |
| jQuery(this).removeClass(jQuery(this).attr("data-class")); | |
| } | |
| jQuery(this).addClass("row_"+rowClass).attr("data-class","row_"+rowClass); |