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 Namespace_Adminhtml_Model_Source_Category_Tree extends Mage_Core_Model_Abstract | |
| { | |
| /** | |
| * @return array | |
| * @throws Mage_Core_Exception | |
| */ | |
| public function toOptionArray() | |
| { |
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 | |
| /** Location Namespace/Module/sql/namespace_module_setup **/ | |
| try { | |
| /* @var $conn Varien_Db_Adapter_Interface */ | |
| /* @var $installer Mage_Sales_Model_Resource_Setup */ | |
| $installer = $this; | |
| $installer->startSetup(); | |
| $installer->addAttribute('order_item', 'custom_attribute', array( |
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 | |
| //Replace this line Method@checkUserLogin && Method@checkUserLoginBackend | |
| $login = array_key_exists('username', $loginParams) ? $loginParams['username'] : null; | |
| //By this one | |
| $login = array_key_exists('username', array($loginParams)) ? $loginParams['username'] : null; |
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
| #Configuration | |
| SetEnvIf Host ^mydomain\.com MAGE_RUN_CODE=base | |
| SetEnvIf Host ^mydomain\.com MAGE_RUN_TYPE=website | |
| SetEnvIf Host ^foo\.mydomain\.com MAGE_RUN_CODE=mycustomwebsitecode1 | |
| SetEnvIf Host ^foo\.mydomain\.com MAGE_RUN_TYPE=website | |
| SetEnvIf Host ^mydomain2\.com MAGE_RUN_CODE=mycustomwebsitecode2 | |
| SetEnvIf Host ^mydomain2\.com MAGE_RUN_TYPE=website |
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 | |
| try { | |
| /** @var Mage_Catalog_Model_Resource_Setup $installer */ | |
| $installer = $this; | |
| $installer->startSetup(); | |
| $installer->addAttribute( | |
| Mage_Catalog_Model_Category::ENTITY, |
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 Namespace_MyModule_myClass extends Mage_Core_Template | |
| /** | |
| * Get Page Type | |
| * @return string | |
| */ | |
| public function getPageType() | |
| { | |
| $fullActionName = Mage::app()->getFrontController()->getAction()->getFullActionName(); |
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 MyNameSpace_MyModule_Model_Observer extends Mage_Checkout_Model_Observer_Abstract { | |
| /** | |
| * Add product to cart or update product price | |
| * | |
| * @event sales_quote_collect_totals_before | |
| * @param Varien_Event_Observer $observer | |
| **/ |
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
| Validation.addAllThese([ | |
| ['validate-zip-fr', 'Please enter a valid zip code. For example 75001.', function (v) { | |
| return Validation.get('IsEmpty').test(v) || /(^\d{5}$)/.test(v); | |
| }], | |
| ['validate-mobile-fr', 'Please enter a valid cellphone number. For example 0601020304.', function (v) { | |
| return Validation.get('IsEmpty').test(v) || /(^[0][6-7]\d{8}$)/.test(v); | |
| }], | |
| ['validate-fix-fr', 'Please enter a valid cellphone number. For example 0101020304.', function (v) { | |
| return Validation.get('IsEmpty').test(v) || /(^[0]([1-5]|9)\d{8}$)/.test(v); | |
| }], |
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 Namespace\Category\Setup; | |
| use Magento\Catalog\Api\CategoryRepositoryInterface; | |
| use Magento\Catalog\Api\Data\CategoryInterface; | |
| use Magento\Catalog\Api\Data\CategoryInterfaceFactory; | |
| use Magento\Framework\Setup\InstallDataInterface; | |
| use Magento\Framework\Setup\ModuleContextInterface; | |
| use Magento\Framework\Setup\ModuleDataSetupInterface; |
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 MyNameSpace\Catalog\Block\Product | |
| use Magento\Catalog\Model\ProductRepository; | |
| use Magento\Framework\Api\FilterBuilder; | |
| use Magento\Framework\Api\Search\FilterGroupBuilder; | |
| use Magento\Framework\Api\SearchCriteriaBuilder; | |
| use Magento\Framework\View\Element\Template; |