This file contains 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 | |
/** | |
* Has shipping been applied to quote? | |
* | |
* @var bool | |
*/ | |
protected $_hasShipping = false; | |
/** |
This file contains 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 | |
/** | |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) | |
* @author Hervé Guétin <herve.guetin@gmail.com> <@herveguetin> | |
*/ | |
class Reindex | |
{ | |
/** | |
* @var \Magento\Indexer\Console\Command\IndexerReindexCommand |
This file contains 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 | |
/** | |
* Retrieve the next business day with an optional leadtime. | |
* If leadtime = 1 => find the next business day | |
* If leadtime = 2 => find the "next next" business day | |
* etc... | |
* | |
* @param int $leadtime | |
* @return string|bool | |
*/ |
This file contains 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 Namespace_Module_Model_Price_Import extends Mage_Core_Model_Abstract | |
{ | |
/** | |
* DB Connection | |
* | |
* @var Varien_Db_Adapter_Interface | |
*/ | |
protected $_conn; |
This file contains 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 | |
$tree = array( | |
'Category A' => array( | |
'Category A-B' => array( | |
'Category A-B-A', | |
'Category A-B-B' | |
), | |
'Category A-C' => array( | |
'Category A-C-A', | |
'Category A-C-B' |
This file contains 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 | |
// Create new order status | |
$data = array( | |
'status' => 'status_code', | |
'label' => 'Default Label' | |
); | |
$status = Mage::getModel('sales/order_status'); | |
$status->setData($data)->save(); | |
// Assign to some order state |
This file contains 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 | |
/** | |
* A helper file for Laravel 5, to provide autocomplete information to your IDE | |
* Generated for Laravel Lumen (5.1.1) (Laravel Components 5.1.*) on 2015-08-18. | |
* | |
* @author Barry vd. Heuvel <barryvdh@gmail.com> | |
* @see https://github.com/barryvdh/laravel-ide-helper | |
*/ | |
namespace { |
This file contains 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
new again |
This file contains 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 a quick an easy hack to programmatically create a cart price rule. | |
1. Temporarely edit Mage_Adminhtml_Promo_QuoteController::saveAction() | |
2. Around line 123, you will find $data = $this->getRequest()->getPost(); | |
3. Below this line create a new line containing : | |
var_export($data); | |
die(); |
This file contains 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 | |
$customerGroupId = SOME_CUSTOMER_GROUP_ID; | |
$table = Mage::getModel('customer/customer')->getResource() | |
->getWriteConnection() | |
->getTable('customer/entity'); | |
$query = "UPDATE {$table} SET group_id = {$customerGroupId} WHERE group_id != {$customerGroupId}"; | |
$conn->query($query); | |
?> |