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 | |
| /** | |
| * Copyright Magento 2012 | |
| * Example of products list retrieve using Customer account via Magento | |
| REST API. OAuth authorization is used | |
| */ | |
| $callbackUrl = "http://yourhost/oauth_customer.php"; | |
| $temporaryCredentialsRequestUrl = | |
| "http://magentohost/oauth/initiate?oauth_callback=" . | |
| urlencode($callbackUrl); |
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
| // ## Note: If not in a module sql setup use the following 2 lines | |
| require_once('app/Mage.php'); | |
| Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID)); | |
| // ## Note: Setup the new category attribute | |
| $installer = new Mage_Sales_Model_Mysql4_Setup; | |
| $installer->startSetup(); | |
| $installer->addAttribute('catalog_category', 'additional_css', array( | |
| 'type' => 'text', | |
| 'backend' => '', | |
| '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 | |
| /*************************************************** | |
| * Magento Log File Contents Monitor. GNU/GPL | |
| * landau@fiascolabs.com | |
| * provided without warranty or support | |
| ***************************************************/ | |
| /*********************** | |
| * Scan Magento local.xml file for connection information |
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
| <reference name="head"> | |
| <action method="addCss"> | |
| <stylesheet>relativetobase/default/your.css</stylesheet> | |
| <params>media="screen"</params> | |
| </action> | |
| </reference> |
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
| $installer = $this; | |
| $installer->startSetup(); | |
| $installer->updateAttribute('catalog_product', 'old_attribute_code', array('attribute_code' => 'new_attribute_code')); | |
| $installer->endSetup(); |
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
| //$_product = Mage::getModel('catalog/product')->load($productID); | |
| ----------------------------------- | |
| $catCollection = $_product->getCategoryCollection(); | |
| foreach($catCollection as $cat){ | |
| print_r($cat->getData()); | |
| //echo $cat->getName(); | |
| //echo $cat->getUrl(); | |
| } |
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
| Create category dynamically: | |
| $category = Mage::getModel('catalog/category'); | |
| $category->setStoreId(Mage::app()->getStore()->getId()); | |
| $cat['name'] = "Custom Category Name here"; | |
| $cat['path'] = "1/2/30"; //parent relationship.. | |
| $cat['description'] = "categorie's description"; | |
| $cat['is_active'] = 1; | |
| $cat['is_anchor'] = 0; //for layered navigation |
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
| UPDATE `eav_attribute` SET `default_value` = 'container1' WHERE `eav_attribute`.`attribute_code`='options_container'; | |
| UPDATE `eav_attribute` SET `default_value` = '1' WHERE `eav_attribute`.`attribute_code`='is_active'; | |
| UPDATE `eav_attribute` SET `default_value` = '1' WHERE `eav_attribute`.`attribute_code`='is_anchor'; | |
| UPDATE `eav_attribute` SET `default_value` = '1' WHERE `eav_attribute`.`attribute_code`='status'; | |
| UPDATE `eav_attribute` SET `default_value` = '0' WHERE `eav_attribute`.`attribute_code`='weight'; | |
| UPDATE `eav_attribute` SET `default_value` = '2' WHERE `eav_attribute`.`attribute_code`='tax_class_id'; | |
| insert into core_config_data values ( null, 'default', 0, 'cataloginventory/item_options/is_in_stock', 1 ); | |
| insert into core_config_data values ( null, 'default', 0, 'cataloginventory/item_options/qty', 10 ); |
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 | |
| // Create a new cms page for a . | |
| $cmsPageData = array( | |
| 'title' => 'Test CMS Page Title', | |
| 'root_template' => 'one_column', | |
| 'meta_keywords' => 'meta,keywords', | |
| 'meta_description' => 'meta description', |
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 | |
| // USAGE http://www.site.com/updategroupprice.php?price=14.95&sku=SKU123X | |
| require_once '../app/Mage.php'; | |
| umask(0); | |
| //Mage::app('admin'); | |
| Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); | |
| $sku = $_GET['sku']; |
OlderNewer