Developer forum

Forum » Templates » eCom Price overrule DB price

eCom Price overrule DB price


Reply

I would like to make some discount-calculations with a piece of Javascript, embedded in my product detail template. I have to do it this way because the eCom dicount module doesn't support dicsounts based on Manufacturers.

 

Is it possible to set the value of a hidden form field to the calculated discount price, and post that new price with the submission of "Add to cart" and make the new price overrule the price in the product database?

 

I know how to set up the Javascript bit, but I'm not sure about the new price overruling the price in the database.


Replies

 
Nicolai Høeg Pedersen
Reply
hf@oerskov.dk wrote:

I would like to make some discount-calculations with a piece of Javascript, embedded in my product detail template. I have to do it this way because the eCom dicount module doesn't support dicsounts based on Manufacturers.

 

Is it possible to set the value of a hidden form field to the calculated discount price, and post that new price with the submission of "Add to cart" and make the new price overrule the price in the product database?

 

I know how to set up the Javascript bit, but I'm not sure about the new price overruling the price in the database.


 

You cannot override the price using a form or querystring parameter in ecom due to security issues. Then you would be able to override prices by hacking the system - a problem in the old shopping system.

 

To calculate discounts based on your own algorithm you can code your own discount add in for Dynamicweb - this can be based on whatever you want. See docs here: http://documentation.dynamicweb.dk/Development-23323.aspx The document with sales discounts.

 

You must be logged in to post in the forum