Snippets with the tag: id

Get product type from product ID

Description

Get product type from product ID

Code

$product = Mage::getModel('catalog/product')->load($product_id);
$productType = $product->getTypeId();

Get products data in cart

Description

Display products data in cart

Code

$items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();

foreach($items as $item) {
        echo 'ID: '.$item->getProductId().'
'; echo 'Name: '.$item->getName().'
'; echo 'Sku: '.$item->getSku().'
'; echo 'Quantity: '.$item->getQty().'
'; echo 'Price: '.$item->getPrice().'
'; echo "
"; }

Show CMS block in html

Description

Show CMS block in html

Code

getLayout()->createBlock('cms/block')->setBlockId('block_identifier')->toHtml(); ?>