Should be the same for all versions to dateWhat does it do:
================
This mod makes qty discounts apply to product options as well. It applies qty discounts to options by taking whatever the percentage the discount is to the price, and apply that same percentage to the options.
Example.
Product base price is 100
Option: Color: Red is 5.00
Option: Size: Lrg is 10.00
Discount @ 1 is 95.00 = 95.00
Percentage difference is 95/100 (.95) or 95% of the normal price
95% of 5.00 makes Option: Color: Red = 4.75
95% of 10.00 makes Option: Size: Lrg = 9.50
Before mod Total: 95 + 5.00 + 10.00 = 110.00
After mod Total: 95+ 4.75 + 9.50 = 109.25
Discount @ 2 is 75.00 x 2 = 140
Percentage difference is 75/100 (.75) or 75% of the normal price
75% of 5.00 makes Option: Color: Red = 3.75 x 2 = 7.50
75% of 10.00 makes Option: Size: Lrg = 7.50 x 2 = 15.00
Before mod Total: 140 + 10.00 + 20.00 = 170.00
After mod Total: 140 + 7.50 + 15.00 = 162.50
1. EDIT: system/library/cart.php (or system/helper/cart.php for older versions)
2. FIND:
Code: Select all
$price = $product_discount_query->row['price'];
Code: Select all
//Q: Apply discount percentage to Option
foreach ($option_data as $key => $value) {
$option_data[$key]['price'] = $option_data[$key]['price'] * ($product_discount_query->row['price'] / $product_query->row['price']);
}
$option_price = $option_price * ($product_discount_query->row['price'] / $product_query->row['price']);
//
5. FIND:
Code: Select all
foreach ($option['option_value'] as $option_value) {
Code: Select all
//Q: Option Discounts
if ($option_value['price']) {
if (isset($option_discount) && $option_discount) {
$option_value_price = (float)$option_value['price'] * $option_discount;
} else {
$option_value_price = (float)$option_value['price'];
}
}//