From d104563ce62fd59be78e7e854d0484bfeff6c345 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Fri, 21 Jan 2022 20:13:46 +0800 Subject: [PATCH] updated shipping fees --- .../Controllers/paypal/PaypalController.php | 18 ++++++++++++------ resources/views/merchbay/cart.blade.php | 2 +- resources/views/merchbay_main.blade.php | 2 ++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/paypal/PaypalController.php b/app/Http/Controllers/paypal/PaypalController.php index 091489f..cc55599 100755 --- a/app/Http/Controllers/paypal/PaypalController.php +++ b/app/Http/Controllers/paypal/PaypalController.php @@ -299,7 +299,7 @@ class PaypalController extends Controller $items = $m->myCart($cartKey); // item from cart_tmp $getSubtotal = $m->getSubtotal($cartKey); // var_dump($getSubtotal); - if($getSubtotal[0]->Subtotal >= 150) { + if($getSubtotal[0]->Subtotal >= 99) { return $shippingFee = 0; } @@ -355,10 +355,18 @@ class PaypalController extends Controller $countryCode = ""; if (count($array_address_book) > 0) { $countryCode = $array_address_book[0]->CountryCode; - $CAShippingfee = ceil($CAShippingfee / 2) * 50; + $CAShippingfee = ceil($CAShippingfee / 1) * 50; + } + + // $getSmallItemQty = ceil($getSmallItemQty / 3) * 8.99; + + if($getSmallItemQty >= 2) { + $getSmallItemQty = ceil(($getSmallItemQty - 1) / 1) * 2.49; + $getSmallItemQty = $getSmallItemQty + 8.99; + }else { + $getSmallItemQty = 8.99; } - $getSmallItemQty = ceil($getSmallItemQty / 3) * 8; $getBulkyItemQty = ceil($getBulkyItemQty / 1) * 8; $getMaskItemQty = ceil($getMaskItemQty / 25) * 8; $getDGSItemQty = ceil($getDGSItemQty / 4) * 5; @@ -367,9 +375,7 @@ class PaypalController extends Controller if ($countryCode == "CA") { $shippingFee = $CAShippingfee; } - - - + return $shippingFee; } diff --git a/resources/views/merchbay/cart.blade.php b/resources/views/merchbay/cart.blade.php index f3d7dec..6fa727c 100755 --- a/resources/views/merchbay/cart.blade.php +++ b/resources/views/merchbay/cart.blade.php @@ -362,7 +362,7 @@ @if ($getSubtotal >= 1 && $getSubtotal <= 150)
- If you order $150 worth of product you get free shipping (pre tax). You are {{ number_format(150 - $getSubtotal, 2) }} {{ $store_array[0]->StoreCurrency }} away. + If you order $99 worth of product you get free shipping (pre tax). You are {{ number_format(99 - $getSubtotal, 2) }} {{ $store_array[0]->StoreCurrency }} away.
@endif diff --git a/resources/views/merchbay_main.blade.php b/resources/views/merchbay_main.blade.php index d479cab..c9be73b 100755 --- a/resources/views/merchbay_main.blade.php +++ b/resources/views/merchbay_main.blade.php @@ -20,6 +20,8 @@ + +