Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Calculating prices on the fly


DJ Soniq

Recommended Posts

Posted

Hope this is possible... have the need to calculate prices on the fly via the use of "price codes" in a separate related table to the products. Have been able to use javascript to do this by creating hidden price inputs for each product. But since only the "product_id" is added to the cart with osC, I am not sure how to do this. Could the cart accept both the "product_id" and a "generated price" instead of pulling the price from product table?

 

All help is appreciated.

Posted

If a formula can be written then the prices can be calculated on the fly ...

 

You just need to define the formula and how it relates to the price. Then edit the areas where the price is used and I would call a function to grab the price so that you only have to write the calculation once and can just pass the products_id to get the info needed to compute the price.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...