Edit the file:
/includes/classes/shopping_cart.php
and down near the bottom, add the code in RED:
Code:
return $in_cart_check_qty;
}
// eof: change $total_count for options_id/options_values_id combo
//////////////////////////////////////////////////////////
// This in_cart_product_total_price function will need to be removed in future releases - it will be there in the core
/**
* calculate products_id price in cart
* USAGE: $product_total_price = $this->in_cart_product_total_price(12);
* USAGE: $chk_product_cart_total_price = $_SESSION['cart']->in_cart_product_total_price(12);
*
* @param mixed $product_id
*/
function in_cart_product_total_price($product_id) {
$products = $this->get_products();
//echo '<pre>'; echo print_r($products); echo '</pre>';
for ($i=0, $n=sizeof($products); $i<$n; $i++) {
$productsName = $products[$i]['name'];
$ppe = $products[$i]['final_price'];
$ppt = $ppe * $products[$i]['quantity'];
$productsPriceEach = $ppe + $products[$i]['onetime_charges'];
$productsPriceTotal = $ppt + $products[$i]['onetime_charges'];
if ((int)$product_id == (int)$products[$i]['id']) {
// echo 'GOOD id: ' . $products[$i]['id'] . ' vs ' . ' $product_id: ' . $product_id . ' $products[$i][name]: ' . $products[$i]['name'] . ' $productsPriceEach: ' . $productsPriceEach . ' $productsPriceTotal: ' . $productsPriceTotal . '<br><br>';
$in_cart_product_price += $productsPriceTotal;
} else {
// echo 'NOT GOOD id: ' . $products[$i]['id'] . ' vs ' . ' $product_id: ' . $product_id . ' $products[$i][name]: ' . $products[$i]['name'] . ' $productsPriceEach: ' . $productsPriceEach . ' $productsPriceTotal: ' . $productsPriceTotal . '<br><br>';
}
} // end FOR loop
return $in_cart_product_price;
}
// This in_cart_product_total_price function will need to be removed in future releases - it will be there in the core
//////////////////////////////////////////////////////////
}
Next, edit the file and add the code in RED:
/includes/modules/order_total/ot_group_pricing.php
Code:
$gift_vouchers = $_SESSION['cart']->gv_only();
// bof: Custom snailmail GV no Group Discount
// change 370 to proper products_id
$snail_gift_vouchers += $_SESSION['cart']->in_cart_product_total_price(370);
//echo '$snail_gift_vouchers: ' . $snail_gift_vouchers . '<br>';
$discount = ($orderTotal['total'] - $gift_vouchers - $snail_gift_vouchers) * $group_discount->fields['group_percentage'] / 100;
// eof: Custom snailmail GV no Group Discount
// echo "discout = $discount<br>";
$od_amount['total'] = round($discount, 2);
$ratio = $od_amount['total']/$order_total;
/**
Now see if this alters the Group Discount ... the 370 is the products_id for your Snail Mail Gift Certificate ...
Bookmarks