how to get cart value in magento


<div class=”add-qoute-btn”>
<?php
echo  $this->helper(‘checkout/cart’)->getSummaryCount();
echo “<pre>”;
echo$test= Mage::getSingleton(‘core/session’)->getFormKey();
?>
<?php

// $items = Mage::getModel(‘checkout/cart’)->getQuote()->getAllItems();

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

foreach($items as $item) {

echo ‘ID: ‘.$item->getProductId().'<br />’;

echo ‘Name: ‘.$item->getName().'<br />’;

echo ‘Sku: ‘.$item->getSku().'<br />’;

echo ‘Quantity: ‘.$item->getQty().'<br />’;

echo ‘Price: ‘.$item->getPrice().'<br />’;

echo “<br />”;

}

?>

Total items added in cart

<?php

Mage::getModel(‘checkout/cart’)->getQuote()->getItemsCount();

Mage::getSingleton(‘checkout/session’)->getQuote()->getItemsCount();

?>

Total Quantity added in cart

<?php

Mage::getModel(‘checkout/cart’)->getQuote()->getItemsQty();

Mage::getSingleton(‘checkout/session’)->getQuote()->getItemsQty();

?>

Sub Total for item added in cart

<?php

Mage::getModel(‘checkout/cart’)->getQuote()->getSubtotal();

Mage::getSingleton(‘checkout/session’)->getQuote()->getSubtotal();

?>

Grand total for item added in cart

<?php

Mage::helper(‘checkout’)->formatPrice(Mage::getModel(‘checkout/cart’)->getQuote()->getGrandTotal());

Mage::helper(‘checkout’)->formatPrice(Mage::getSingleton(‘checkout/session’)->getQuote()->getGrandTotal());

?>

 

Get number of items in cart and total quantity in cart

<?php

$totalItems = Mage::getModel(‘checkout/cart’)->getQuote()->getItemsCount();

$totalQuantity = Mage::getModel(‘checkout/cart’)->getQuote()->getItemsQty();

?>

Aacute character remove in csv


$str = iconv(‘ISO-8859-15’, ‘UTF-8’, $emapData[1]); $search = explode(“,”,”ç,æ,œ,á,é,í,ó,ú,à,è,ì,ò,ù,ä,ë,ï,ö,ü,ÿ,â,ê,î,ô,û,å,e,i,ø,u”); $replace = explode(“,”,”c,ae,oe,a,e,i,o,u,a,e,i,o,u,a,e,i,o,u,y,a,e,i,o,u,a,e,i,o,u”); $urlTitle = str_replace($search, $replace, $str);

Shortcode Toggle Plugin Use hide and show button


jQuery(document).ready(function(){  jQuery(“.toggle_content”).hide();
jQuery(“.toggle_title”).click(function()
{
jQuery(“.toggle_content”).hide();
jQuery(this).toggleClass(“toggle_active”).next().slideToggle(“slow”);
jQuery(this).hide();

jQuery(‘.toggle_title’).not(this).each(function(){
jQuery(this).show();
});
return false
});
});