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.
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.
I’m trying to show/hide a div in the checkout process based on the cart subtotal or grand total (we show both, just not sure if either is easier to work with). Would I be able to use the above to do so?
Hello, my name is Richard Castera. I have more than 12 years of experience architecting, implementing, leading and launching large scale, high performance software products in a fast-paced agile environment.
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)
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.
Thanks Richard!
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 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 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.
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 to get items and their names in an array??
Perfect, just what I needed! Thanks a bunch!
Just wat i needed thanks a lot!
Hey Richard
I’m trying to show/hide a div in the checkout process based on the cart subtotal or grand total (we show both, just not sure if either is easier to work with). Would I be able to use the above to do so?
Thanks
Adam Hodson