Dawn - Creating A Dynamic Total Price Display For Products Based On Quantity Selection

Alessio0000
Tourist
32 0 3

I'm interested in implementing a dynamic pricing feature on my product pages that would show the total price based on the selected quantity, similar to what's commonly seen in cart or checkout pages. For instance, if a T-shirt costs $20 each and a customer chooses a quantity of 4, I'd like a dynamic price box to display a total of $80, alongside the text "Total $80."

Importantly, I want this feature to be independent of the standard price box found on the product page. Essentially, I'm seeking guidance on how to create a dynamic pricing component that can display both the unit price and the total price, akin to what's seen during the checkout process. How can I go about implementing this function?

This is the website for reference: www.isabac.it

Replies 2 (2)

PaulNewton
Shopify Partner
6275 574 1324

Overly broad, if you don't already know javascript enough to ask a much better specific question your gonna have a steep curve in front of you.

The gist,

Add the elements used for the display the combined price to the theme.

Then use javascript to add an event listener to the quantity box , when it changes, get the amount from the regular price display elements or via ajax, then multiply to get total value, update display elements.

 

If you just need this customization built then contact me directly by mail for services.
Please always provide context, examples: store url, theme name, post url(s) , or any further detail.
Contact Info in signature.

 

Good Hunting.

 

Save time & money ,Ask Questions The Smart Way


Confused? Busy? Get the solution you need paull.newton+shopifyforum@gmail.com


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org


Alessio0000
Tourist
32 0 3

The combined price of all of the items in a line item in the currency's subunit, before any discounts have been applied.

The value is equal to line_item.original_price multiplied by line_item.quantity. It's output in the customer's local (presentment) currency.


I've seen that there is an object used in the cart that already calculates the total price. Is it possible to use in the product page?