Get all items in cart currently in Magetno

<?php $cart = Mage::getModel(‘checkout/cart’)->getQuote(); foreach ($cart->getAllItems() as $item) { $productId =$item->getProduct()->getId(); $productName = $item->getProduct()->getName(); $productPrice = $item->getProduct()->getPrice(); } ?>

Get Customer billing address by Customer Id magento

<?php $customerid = 1; $costomerdata = Mage::getModel(‘customer/customer’)->load($customerid); $billingaddress = Mage::getModel(‘customer/address’)->load($costomerdata ->default_billing); $addressdata = $billingaddress ->getData(); echo $addressdata[‘street’]; echo $addressdata[‘city’]; echo $addressdata[‘postcode’]; …

GET MAGENTO FIRST LEVEL CATEGORIES

<?php $categories = Mage::getModel(‘catalog/category’)->getCollection() ->addAttriuteToSelect(‘*’)   //  you can just add some attributes ->addAttributeToFilter(‘level’,2)  //2 is actually the first level …

How to remove product from wishlist in magento

<?php $_wishlistItem = Mage::getModel(‘wishlist/item’)->loadByProductWishlist( $this->helper(‘wishlist’)->getWishlist()->getId(), $item->getId(), $item->getStoreId() ); $_wishlistRemoveUrl = $this->helper(‘wishlist’)->getRemoveUrl($_wishlistItem); ?> <a href=”<?php echo $_wishlistRemoveUrl; ?>”><img src=”<?php echo $this->getSkinUrl(‘images/close.png’); …

How to get wishlist collection in Magento

<?php $customer = Mage::getSingleton(‘customer/session’)->getCustomer(); if($customer->getId()) { $wishlist = Mage::getModel(‘wishlist/wishlist’)->loadByCustomer($customer, true); $wishListItemCollection = $wishlist->getItemCollection(); foreach ($wishListItemCollection as $item) { echo $item->getName(); …