Post by hrevis25 » Sun Apr 23, 2017 6:43 pm

Hello,
I want to edit the price calculations doing the following:
Radio buttons:
Total price = (unit price * quantity) + / - radio button.
Checkbox:
Total price = (unit price + checkbox) * quantity

I did some changes in the code below in
system/library/cart.php
but the calculations are the same for all input types (radio button, selection, dropdown).
Any ideas??
$product_data[] = array(
'cart_id' => $cart['cart_id'],
'product_id' => $product_query->row['product_id'],
'name' => $product_query->row['name'],
'model' => $product_query->row['model'],
'shipping' => $product_query->row['shipping'],
'image' => $product_query->row['image'],
'option' => $option_data,
'download' => $download_data,
'quantity' => $cart['quantity'],
'minimum' => $product_query->row['minimum'],
'subtract' => $product_query->row['subtract'],
'stock' => $stock,
'price' => ($price + $option_price),
'total' => ($price * $cart['quantity']) + $option_price,
'reward' => $reward * $cart['quantity'],
'points' => ($product_query->row['points'] ? ($product_query->row['points'] + $option_points) * $cart['quantity'] : 0),
'tax_class_id' => $product_query->row['tax_class_id'],
'weight' => ($product_query->row['weight'] + $option_weight) * $cart['quantity'],
'weight_class_id' => $product_query->row['weight_class_id'],
'length' => $product_query->row['length'],
'width' => $product_query->row['width'],
'height' => $product_query->row['height'],
'length_class_id' => $product_query->row['length_class_id'],
'recurring' => $recurring
);

Active Member

Posts

Joined
Wed Apr 19, 2017 8:27 pm
Who is online

Users browsing this forum: No registered users and 438 guests