FR: ability to query raw prices through AJAX #747
Replies: 3 comments 3 replies
-
I don't believe there's any way for us to add extra fields like you've suggested without making a breaking change around how folks use prices in Antlers. I'm guessing you're talking about when you get all line items from the cart - correct? |
Beta Was this translation helpful? Give feedback.
-
Maybe giving control over currency sign placement by currency might be an option then. There are a lot of different ways how countries handle the placement of their currency signs (check here) and being stuck with a preceding currency sign without space seems a bit limiting. Or is there an option I just haven't found yet? |
Beta Was this translation helpful? Give feedback.
-
Hey! I've just pushed out an update (v4.2.0) which takes advantage of Statamic's new 'Computed Values' feature meaning we can actually return a separate 'raw price'. In fact, after updating, if you do an AJAX request, you should see a Have a great rest of your weekend! |
Beta Was this translation helpful? Give feedback.
-
What would you like to see added?
I think currently there is no option to obtain the raw prices (without currency signs) through AJAX, but it would be useful for calculations or having more control over how currency signs are displayed (e.g. before or after the amount)
Maybe some aditional fields would work like
grand_total_raw
orshipping_total_raw
or prices could be objects like
Is there a workaround you can use in the meantime?
Sure, stripping of signs and parsing as numbers can be done to get something to calculate with.
Priority wise - where's this feature for you?
Nice to have
Beta Was this translation helpful? Give feedback.
All reactions