2013 August

Return Product Attributes

<?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//…

Get associated products

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…

How to delete a quote in Magento

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…

Cart Data

<?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());}?>

1 2 3 4 13