Jump to content

Manipulating price on product page


icedfox

Recommended Posts

Dear developers, please help me with the following:

On the product page I have to calculate the price so I added some HTML/js elements on the page (dropdowns) of particular product. Using selected values the price should be calculated with javascript and shown on the page. Then same price of course must be in the cart. 

1. How to load an js-array from database (my tables) to product page?

2. How to get calculated price to cart (probably override price calculation function)?

 

Any help highly appreciated

Link to comment
Share on other sites

That won't be easy:

When you add a product to your cart the add() function in ajax-cart.js (of the blockcart module - usually defined in your theme) calls (via some detours) the function updateQty() in the file classes\Cart.php. But in the process no prices are transferred.

Link to comment
Share on other sites

Thank you for your answer regarding the 2nd question. But could someone explain me how to load data from database to product page? I already defined array {addJsDef productonmaterial[][]} in product.tpl, now - how to load data there? Thank you in advance!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...