PDA

View Full Version : Discount Coupon Codes



michael_s
04-30-2009, 01:00 AM
problem with Min Order Min Order Type: Price Total

if you use: DISPLAY_PRICE_WITH_TAX == true

Example:
- if you have in shopping cart one item: that has a price without tax: 10$ and a tax 50% that is added to the initial price and the min order is 13 it won't let use the discount coupon because it compare the initial price of the product with the min order




catalog/includes/classes/discount_coupon.php

to add the tax to the product search for function:

function total_valid_products( $products = array() )


there u will find this line:

$price = ( $products[$i]['price'] + $cart->attributes_price( $products[$i]['id'] ) ) * $products[$i]['quantity'];


replace with

if (DISPLAY_PRICE_WITH_TAX == "true"){
$product_tax = tep_get_tax_rate($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']);
$price = ( tep_add_tax($products[$i]['price'], $product_tax) + $cart->attributes_price( $products[$i]['id'] ) ) * $products[$i]['quantity'];

}else{
$price = ( $products[$i]['price'] + $cart->attributes_price( $products[$i]['id'] ) ) * $products[$i]['quantity'];
}


That's all. Thanks to this great contribution. All credit to kgt .


The file attached contains only the explanation.




More... (http://addons.oscommerce.com/info/4269)