how can add dynamic price in a custom module?
-
16-10-2019 - |
سؤال
I created a custom module, which act as a product view page for my bundle products. I have successfully displayed name, descriptions and options in my module. Now I am stuck in dynamic pricing section. I need to change the price of the bundle product dynamically, when check boxes of bundle product get clicked. How can I achieve this? Not that my module doesn't have any relation to the default product view page.
المحلول
The same way the standard bundle product view page does it: with javascript. Note that the standard Magento template (bundle/catalog/product/price.phtml
) is a bad example of how to do it. If you can do better, I applaud you. The crux is in js/varien/product.js, see the reloadPrice for starters.
But - don't make the same mistake of trying to parse the HTML. Load the data via json and work with that.