Import and URL Keys
Don't bother setting the url key, as this can be a tedious task in Excel, just simply import without one and reindex.
Related cards:
Import Resetting visibility and stock attributes
If you are updating an existing product you need to include the stock and visibility attributes, otherwise the stock for the product will get set to 0 and out of stock, and the visibility will be reset to Catalog, Search.
![](http://mikewhitby.co...
Importing Images
Ok so to import images you first need these columns:
-
_media_attribute_id
- the attribute_id ofmedia_gallery
(see below) -
_media_image
- the path of the image, i.e./some_image.jpg
-
_media_lable
- the image label, i.e. "My nice imag...
Dataflow Per-Store Import Causing Copy of All Attributes
Fancy importing a subset of some product attributes on a per-store basis, whilst keeping the attributes that weren't imported using the defaults?
Tough, you can't!
Well, not with dataflow anyway. [This card](https://makandracards.com/magento...
URL Route Parameters
Mage_Core_Model_Url::getUrl()
These are the core set of route parameters, you can be fairly sure that any
call to getUrl()
which accepts route parameters will come through this method,
so any of these parameters should work.
|---------------...
Getting A Products URL
Potentially confusing due to the 3 methods you could use, all of which are in Mage_Catalog_Model_Product
:
public function getUrlPath($category=null)
public function getUrlInStore($params = array())
public function getProductUrl($use...
Layout Loading and Misc Notes
Layout XML files are loaded here via this stack - here we are loading the layout update for the rwd/default design package, for the CMS home page. I've put a dashed line on the demarcation between layout code and other code:
Mage_Core_Model_A...
Allowing Import Of Invisible Attributes
By setting a Product Attribute to be invisible via the visible
property, you stop the ability to import that attribute unless you alter the _forcedAttributesCodes
property of...
Get and Resize Category Images
public function getCategoryImage(Mage_Catalog_Model_Category $category, $width = 250, $height = 250)
{
// return when no image exists
if (!$category->getImage()) {
return false;
}
// return when...
Cache Clearing And General Information
Clean everything (use either):
Mage::app()->getCacheInstance()->flush();
Mage::app()->getCache()->clean();
Clean specific types:
Mage::app()->getCacheInstance()->cleanType('config');
Mage::app()->getCacheInstance()->cleanType('l...
startSetup() and endSetup()
Ever wondered what they do? Basically they disable and then enable foreign key checks, and set the SQL mode to NO_AUTO_VALUE_ON_ZERO, then back to the old SQL mode. Below is the code taken from Varien_Db_Adapter_Pdo_Mysql
:
/**
* Run ad...