on order build, retrieve pricing from the cart rather than recalculating it
authorTony Cook <tony@develop-help.com>
Sat, 18 Apr 2020 03:05:22 +0000 (13:05 +1000)
committerTony Cook <tony@develop-help.com>
Sat, 18 Apr 2020 03:05:22 +0000 (13:05 +1000)
site/cgi-bin/modules/BSE/UI/Shop.pm

index 2510a18..e03e7dd 100644 (file)
@@ -1802,11 +1802,11 @@ sub _build_items {
        $work{$col} = $product->$col() unless exists $work{$col};
       }
       my ($price, $tier) = $product->price(user => scalar $req->siteuser);
-      $work{price} = $price;
-      $work{tier_id} = $tier ? $tier->id : undef;
-      $work{extended_retailPrice} = $work{units} * $work{price};
-      $work{extended_gst} = $work{units} * $work{gst};
-      $work{extended_wholesale} = $work{units} * $work{wholesalePrice};
+      $work{price} = $item->price;
+      $work{tier_id} = $item->tier_id;
+      $work{extended_retailPrice} = $item->extended_retailPrice;
+      $work{extended_gst} = $item->extended_gst;
+      $work{extended_wholesale} = $item->extended_wholesale;
       if ($cart->coupon_active) {
        $work{product_discount} = $item->product_discount;
        $work{product_discount_units} = $item->product_discount_units;