<?php$_product->getThisattribute();$_product->getAttributeText(‘thisattribute’);$_product->getResource()->getAttribute(‘thisattribute’) ->getFrontend()->getValue($_product);$_product->getData(‘thisattribute’);// The following returns the option IDs for an //attribute that is a multiple-select field: $_product->getData(‘color’); // i.e. 456,499//…
2013 August
<?phprequire_once(‘app/Mage.php’); //Path to Magentoumask(0);Mage::app();// Run you code here?>
<?phpif($_product->getTypeId() == “configurable”) { $ids = $_product->getTypeInstance()->getUsedProductIds();?><ul> <?php foreach ($ids as $id) { $simpleproduct = Mage::getModel(‘catalog/product’) ->load($id); ?> <li> <?php…
Here, you will see how to create Catalog Price Rule in Magento through code. Catalog Rules are applied on products…
First, use get_class to get the name of an object’s class. <?php $class_name = get_class($object); ?> Then, pass that get_class_methods…
In /app/design/frontend/default/site/template/catalog/product/view/type/ <?php $_helper = $this->helper(‘catalog/output’); ?><?php $_associatedProducts = $this->getAllowProducts() ?><?php //var_dump($_associatedProducts); ?><br /><br /><?php if (count($_associatedProducts)): ?> <?php foreach…
<?php$currentCategory = Mage::registry(‘current_category’);$currentProduct = Mage::registry(‘current_product’);$currentCmsPage = Mage::registry(‘cms_page’);?>
Use the code below to delete a quote: <?php$quoteID = Mage::getSingleton(“checkout/session”) ->getQuote()->getId();if($quoteID){ try { $quote = Mage::getModel(“sales/quote”)->load($quoteID); $quote->setIsActive(false); $quote->delete(); return…
<?php$cart = Mage::getModel(‘checkout/cart’)->getQuote()->getData();print_r($cart);$cart = Mage::helper(‘checkout/cart’)->getCart()->getItemsCount();print_r($cart);$session = Mage::getSingleton(‘checkout/session’);foreach ($session->getQuote()->getAllItems() as $item) { echo $item->getName(); Zend_Debug::dump($item->debug());}?>