diff --git a/app/Http/Controllers/paypal/PaypalController.php b/app/Http/Controllers/paypal/PaypalController.php index 9c2093b..61d1017 100755 --- a/app/Http/Controllers/paypal/PaypalController.php +++ b/app/Http/Controllers/paypal/PaypalController.php @@ -399,7 +399,7 @@ class PaypalController extends Controller public function getTax($cartKey) { $m = new TeamStoreModel; - $updated_getSubtotal = $m->getSubtotal($cartKey); + $updated_getSubtotal = $m->getSubtotalNew($cartKey); $grouped_item = $m->selectTeamStoreGroupByCartKey($cartKey); if (count($grouped_item) <= 0) { diff --git a/app/Models/teamstore/TeamStoreModel.php b/app/Models/teamstore/TeamStoreModel.php index 6073ac4..8cb17fa 100755 --- a/app/Models/teamstore/TeamStoreModel.php +++ b/app/Models/teamstore/TeamStoreModel.php @@ -189,6 +189,16 @@ class TeamStoreModel extends Model return $i; } + function getSubtotalNew($cartKey) + { + + $i = DB::table('cart_tmp')->select(DB::raw('SUM(Quantity * Price) AS Subtotal')) + ->where('CartKey', '=', $cartKey) + // ->where('VoucherId', '=', null) + ->get(); + return $i; + } + function updateStoreItem($data, $url) { $i = DB::table('teamstore_products')->where('ProductURL', $url)