Magento - Get the Total Price of items currently in the Cart
Ever wanted to get the total price of items in your Magento cart? Here you go:
<?php echo $this->helper('checkout')->formatPrice(Mage::getSingleton('checkout/cart')->getQuote()->getGrandTotal()); ?>
Hello Richard, I really like...
Hello Richard,
I really like your blog...not just the information but the way you display the information.
I was wondering if there's a way to store custom options on the product page to be able to add into the shopping cart? The reason why I'm asking is I'm working on a project and I need complete flexibility over my custom options.
I have an eyeglass prescription website and adding prescription lenses process needs to be very unique and easy to use but I'm finding it very difficult to do this in Magento. I just want to add things in the custom options without it being checked and omitted.
Hi did you ever have a...
Hi did you ever have a solution on this for how to do custom options for lenses,need this fora site ,would also consider purchasing some code for this
Thanks Richard!...
Thanks Richard!
Hi Thanx Richard !!! its...
Hi Thanx Richard !!! its Works for me but i have one more Query..
how can i get Discount Price ?
Waiting for your help
Thanx again
Thanx Very very Much for...
Thanx Very very Much for this..
But have 1 more Query.. how can i get Discount Amount?i have applied Shopping Cart rules and want discount amount...
Can you help me
and can you tell me whats use of getSingleton
why its uses?
how can i use?
Thanx in Advance...
This is partially correct. It...
This is partially correct. It answers the question "Ever wanted to get the total price of items in your Magento cart formatted in a span with the price class and a dollar sign?
$138.00
The simple act of trying to just get the damn FLOAT value to assign to a variable is wasting my time.
As mentioned above, this...
As mentioned above, this returns the total price in a span tag like this (with tags instead of brackets):
$135.13
I used the PHP function str_replace to remove the span:
// Get grand total in cart
// Remove span tag from result
(Note that $grandTotal will still show the dollar sign or similar - not only the number)
Hi Richard! Thanks a lot!...
Hi Richard!
Thanks a lot! Such a helpful tutorial. Can you please post a tutorial on custom payment gateway creation in magento.
=)
Thanks for the code! Now, how...
Thanks for the code! Now, how to get items and their names in an array??
Post new comment