Jump to content

Automatic Base-Price calculation


Claudiocool

Recommended Posts

The basic prices must be calculated in the Presta 1.6 (if it is still in the 1.7, I don't know) by hand. So every time I have to dig out the calculator and even calculate how much 100 ml (or just a liter) of my product with 420 ml content costs, because otherwise an unemployed german lawyer could stumble over it and scent revenue.

What have I achieved so far?
I have changed the Product.tpl, so now not more the amount  has to be included in the base price, but the amount of content in relation to the respectively desired base amount, eg. 0.42 for a basic price in liters or 4.2 for a basic price in 100ml.

For this reason the original line was changed from (in my script at line 309)

{convertPrice price = $ unit_price}

to

{convertPrice price = $ productPrice / $ unit_price * (1+ (1 * $ tax_rate / 100))}

The translations in the box have been changed accordingly, so this looks like this:

grundmenge.jpg

That works quite well, the calculator can remain in the desk and calculation errors are eliminated,  because the base price will be automatically recalculated.

So far so good, that's definitely better than in the original version of the shop ... Unfortunately, there is still a small stumbling block ... $ productPrice is the retail price, and that's not so fine if you work with quantity scales or special prices. Here, therefore, the variable should be replaced by the price that is in the box above, and the baseprice should be calculated with the currently valid price.

Does anyone know how to get this variable into the above calculation?

It should change simultanously to the product price shown in the box.

Edited by Claudiocool (see edit history)
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...