hi,
if the quantity of a product in front-end is changed, the total price is calculated,
could anybody give me a hint in what file this calculation is done?
regards Wolfgang
You can use this: http://www.opencart.com/index.php?route ... n_id=20150
It isn't something simple that can be done by modifying one single file. You need to take into account for various factors such as taxes, currencies etc. So best to get an extension that just does that.
It isn't something simple that can be done by modifying one single file. You need to take into account for various factors such as taxes, currencies etc. So best to get an extension that just does that.
thanks for your reply,
but the extension is not doing what i want to do!
short explanation of what i want to do:
if i change the quantity of a product on the productpage in the frontend, the total price is calculated,
there i would like to do a modification, if the quantity is from 1 to 10 the total should be +10%, if the
quantity is from 11 to 100 pieces the total should be as it is, and above 100 pieces the total should be -10%
therefore i need to know where the price*quantity is calculated to add the mentioned calculation there!
this can't be done in the adminarea because the basic price of the product is 0,- and the ral price is calculated on some options.
any ideas to that?
regards
but the extension is not doing what i want to do!
short explanation of what i want to do:
if i change the quantity of a product on the productpage in the frontend, the total price is calculated,
there i would like to do a modification, if the quantity is from 1 to 10 the total should be +10%, if the
quantity is from 11 to 100 pieces the total should be as it is, and above 100 pieces the total should be -10%
therefore i need to know where the price*quantity is calculated to add the mentioned calculation there!
this can't be done in the adminarea because the basic price of the product is 0,- and the ral price is calculated on some options.
any ideas to that?
regards
calculation of price is done within system/library/cart.php 

thanks,
that helped a little bit!
now the price and total in cart is ok, as expected!
BUT the price displayed is wrong, it seems that this cart.php is only called once when starting with
quantity=1, when quantity is changed in the frontend the display only calculates with the price of one
piece, but when i press "add to cart" the price is calculated right!
i added some:
and than:
into the cart.php
have you got any ideas what could be wrong there???
regards
that helped a little bit!
now the price and total in cart is ok, as expected!
BUT the price displayed is wrong, it seems that this cart.php is only called once when starting with
quantity=1, when quantity is changed in the frontend the display only calculates with the price of one
piece, but when i press "add to cart" the price is calculated right!
i added some:
Code: Select all
if ( $quantity < 10 ) {
$add_scale = 1.1;
} else {
$add_scale = 0.9;
}
Code: Select all
'price' => ($price + $option_price) * $add_scale,
'total' => ($price + $option_price) * $quantity * $add_scale,
have you got any ideas what could be wrong there???
regards
cart.php is only for items in cart. For the rest, look within the individual controller files for calculations.
Who is online
Users browsing this forum: Baidu [Spider] and 3 guests