Magento Home URL
- Mage::getBaseUrl();
Magento Home Directory
- Mage::getBaseDir();
URL of a file in the skin directory
- $this->getSkinUrl(‘images/myfile.png’);
- Mage::getDesign()->getSkinUrl(‘images/myfile.png’);
Format a price value
- Mage::helper(‘core’)->formatPrice($amount);
Get the display value of a (multi-)select product attribute
- echo $product->getAttributeText(‘manufacturer’);
Create an object instance in magento
- Mage::getModel(‘module/class’);
- Mage::helper(‘module/class’);
- Mage::app()->getLayout()->createBlock(‘module/class’, ‘name_in_layout’);
GET/POST parameters
- Mage::app()->getRequest()->getParam(‘param_name’);
- Mage::app()->getRequest()->getParams();
Get the Id of the curent store view
- Mage::app()->getStore()->getId();
Get all Store Views
- Mage::app()->getStores();
Get the configurable/grouped/bundled product a simple product belongs to
- $simpleProduct->loadParentProductIds();
- $parentProductIds = $simpleProduct->getParentProductIds();
Get the simple products assigned to a configurable product
$configProduct->getTypeInstance()->getUsedProductCollection($configProduct);
Get an instance of an attribute
Mage::getSingleton(‘eav/config’)->getAttribute($entityType, $attributeCode);
No comments:
Post a Comment