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 | |
| use Magento\Framework\App\Bootstrap; | |
| use Magento\Customer\Api\AccountManagementInterface; | |
| use Magento\Customer\Model\AccountManagement; | |
| require __DIR__ . '/../app/bootstrap.php'; | |
| $bootstrap = Bootstrap::create(BP, $_SERVER); | |
| $objectManager = $bootstrap->getObjectManager(); | |
| $state = $objectManager->get('Magento\Framework\App\State'); | |
| $state->setAreaCode('frontend'); |
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 | |
| include $_SERVER['DOCUMENT_ROOT'].'/app/Mage.php'; | |
| Mage::app('default'); | |
| /** | |
| clear magento cache programatically | |
| */ | |
| function clean_magento_cache(){ | |
| Mage::app()->getCache()->clean(); |
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
| protected function getProductbyCategory() { | |
| $categoryId=3; | |
| $category = Mage::getModel('catalog/category')->load($categoryId); | |
| $prodCollection = Mage::getResourceModel('catalog/product_collection') | |
| ->addCategoryFilter($category) | |
| ->addAttributeToSelect('*'); | |
| foreach ($prodCollection as $val) { |