I guess you all know that when you add a product attribute you can choose the prefix of + or -, but at the moment I am in need of * (times/multiplication).
I wish to make a sort of rental modification in that people can order products and each product will have a Days attribute and they can order it for a certain amount of days. If I enter the price of the product if renting it for 1 day, I can simply have the attribute set to * so that if they choose 4 days for example it will times the product amount (which is equal to one day) by 4 to get the total for the amount of rent.
I have edited the files:
includes/classes/shopping_cart.php
and
admin/includes/classes/shopping_cart.php
The edits:
CODE
if ($attribute_price['price_prefix'] == '+') {
$this->total += $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
} elseif($attribute_price['price_prefix'] == '*') {
$this->total *= $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
}else{
$this->total -= $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
}
$this->total += $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
} elseif($attribute_price['price_prefix'] == '*') {
$this->total *= $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
}else{
$this->total -= $qty * tep_add_tax($attribute_price['options_values_price'], $products_tax);
}
This then works for the shopping_cart pages but nothing else and the product attribute is having no effect else where. I need someone experienced to help me out on this one. Possible payment for solution may occur. Thanks all
