added shipping fee voucher code

This commit is contained in:
franknstayn
2022-02-26 20:20:43 +08:00
parent c15e614c3e
commit b25f55dbdd
5 changed files with 48 additions and 8 deletions

View File

@@ -30,7 +30,7 @@ class PaypalController extends Controller
public function __construct()
{
$paypal_env = "live";
$paypal_env = "sandbox";
$paypal_apiUrl = 'https://api.paypal.com'; // default
if ($paypal_env == 'live') {
@@ -323,7 +323,7 @@ class PaypalController extends Controller
);
$m->updateVoucherValueInCart($data, $item_id);
} else {
} else if ($voucher[0]->VoucherType == "Percentage") {
$data = array(
'Price' => round($totalValue * -1, 2)
);
@@ -333,6 +333,8 @@ class PaypalController extends Controller
// 'totalValue' => $totalValue,
// 'type' => 'Flat'
// );
} else if ($voucher[0]->VoucherType == "Shipping") {
return $shippingFee = 0;
}
}
// var_dump($item->ShippingCostId);