Total Price from quantity on product page #2175
Replies: 5 comments
-
I needed exactly this feature, a total price on the product page. I solved it by adding a js in the phtml block on price rendering. In my case, I only need to take care of one specific product type with tier pricing. I didn't need to implement for all product types and for all possible price configurations. I think it's probably doable but not so straight forward. |
Beta Was this translation helpful? Give feedback.
-
Hello Thanks for the reply. I am not a developer kindly Could you share this your solution? Thank you |
Beta Was this translation helpful? Give feedback.
-
If you copy and paste the following, it has a very high chance of not working as you expect. That being said, insert the following script at the end of this file: <script>
optionsPrice.unitPrice = optionsPrice.productPrice;
if($('qty')) $('qty').observe('blur', function(e) {
$('qty').value = Math.max($F('qty').replace(/[^\d].*/, ''), 1);
optionsPrice.productPrice = Math.max(optionsPrice.unitPrice, $F('qty') * optionsPrice.unitPrice);
optionsPrice.reload();
});
</script> What it does: As I said, it will probably not work in your case without more customization. |
Beta Was this translation helpful? Give feedback.
-
@Danieleeffe1 - Did the code provide by @kiatng solved your issue? I would like to close since it has not had feedback for 1 year. |
Beta Was this translation helpful? Give feedback.
-
I thank the community for trying to help me. Unfortunately, the code provided did not have any satisfactory results |
Beta Was this translation helpful? Give feedback.
-
Goodmorning everyone.
I recently had the opportunity to deal with various E-commerce.
Some of these offer the possibility on the product page to obtain a quick quote on the total price of the product displayed based on the quantity entered by the customer before placing the product in the cart.
Magento / OpemnMage on the product page displays the unit price, example:
TSHIRT 10 €
I think it would be very useful (and current) to insert a function described above.
the prices to be taken and multiplied would obviously be
normal-price
special-price
tier-price
etc
etc
etc
What do you think?
Or is there already a module that does this?
Beta Was this translation helpful? Give feedback.
All reactions