updated shipping fees

This commit is contained in:
franknstayn
2022-01-21 20:13:46 +08:00
parent 0b550e1aba
commit d104563ce6
3 changed files with 15 additions and 7 deletions

View File

@@ -299,7 +299,7 @@ class PaypalController extends Controller
$items = $m->myCart($cartKey); // item from cart_tmp $items = $m->myCart($cartKey); // item from cart_tmp
$getSubtotal = $m->getSubtotal($cartKey); $getSubtotal = $m->getSubtotal($cartKey);
// var_dump($getSubtotal); // var_dump($getSubtotal);
if($getSubtotal[0]->Subtotal >= 150) { if($getSubtotal[0]->Subtotal >= 99) {
return $shippingFee = 0; return $shippingFee = 0;
} }
@@ -355,10 +355,18 @@ class PaypalController extends Controller
$countryCode = ""; $countryCode = "";
if (count($array_address_book) > 0) { if (count($array_address_book) > 0) {
$countryCode = $array_address_book[0]->CountryCode; $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; $getBulkyItemQty = ceil($getBulkyItemQty / 1) * 8;
$getMaskItemQty = ceil($getMaskItemQty / 25) * 8; $getMaskItemQty = ceil($getMaskItemQty / 25) * 8;
$getDGSItemQty = ceil($getDGSItemQty / 4) * 5; $getDGSItemQty = ceil($getDGSItemQty / 4) * 5;
@@ -367,9 +375,7 @@ class PaypalController extends Controller
if ($countryCode == "CA") { if ($countryCode == "CA") {
$shippingFee = $CAShippingfee; $shippingFee = $CAShippingfee;
} }
return $shippingFee; return $shippingFee;
} }

View File

@@ -362,7 +362,7 @@
@if ($getSubtotal >= 1 && $getSubtotal <= 150) @if ($getSubtotal >= 1 && $getSubtotal <= 150)
<div class="border rounded-2 p-2 mt-2"> <div class="border rounded-2 p-2 mt-2">
If you order $150 worth of product you get free shipping (pre tax). You are <strong>{{ number_format(150 - $getSubtotal, 2) }} {{ $store_array[0]->StoreCurrency }}</strong> away. If you order $99 worth of product you get free shipping (pre tax). You are <strong>{{ number_format(99 - $getSubtotal, 2) }} {{ $store_array[0]->StoreCurrency }}</strong> away.
</div> </div>
@endif @endif

View File

@@ -20,6 +20,8 @@
<script src='https://www.google.com/recaptcha/api.js'></script> <script src='https://www.google.com/recaptcha/api.js'></script>
<!-- Global site tag (gtag.js) - Google Analytics --> <!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-SB3QK6BR1N"></script> <script async src="https://www.googletagmanager.com/gtag/js?id=G-SB3QK6BR1N"></script>
<meta name="facebook-domain-verification" content="tbum5il0csyvzwvvrosy5dk2534zn0" />
<script> <script>
window.dataLayer = window.dataLayer || []; window.dataLayer = window.dataLayer || [];