A newbie here. I'm using the "Custom Price Calculation" module which lets each product have a small snippet of PHP to calculate custum prices or other minor task.
I', setting up a store and I have products I give away, the amount you get depends on your cart total, I have tried several things, this is the latest attempt, but I keep coming up with 0 products allowed, I'm thinking my code that calculates the cart's amount is defective, here is a copy;
$cart_items = uc_cart_get_contents();
$car_total = 0;
if (!empty($cart_items)) {
foreach ($cart_items as $c_item) {
$cart_total += ($c_item->price) * $c_item->qty;
}
}
$cart_credits = round($cart_total / 3);
if ($item->qty > $cart_credits) {
$item->qty = $cart_credits;
}
$item->price = $item->price;
Any tips is appreciated.
Thanks
Cecil
k5nwa






Joined: 05/25/2008