upated shipping fee and using voucher code
This commit is contained in:
@@ -315,6 +315,7 @@ class PaypalController extends Controller
|
||||
$voucher = $m->selectVoucherWhereIn($voucherIds);
|
||||
$item_id = $item->Id;
|
||||
$totalValue = $voucher[0]->VoucherValue;
|
||||
|
||||
if ($voucher[0]->VoucherType == "Percentage") {
|
||||
$getPercentageValue = $totalValue / 100;
|
||||
$getDiscountValue = ($getSubtotal[0]->Subtotal * $getPercentageValue);
|
||||
@@ -323,7 +324,7 @@ class PaypalController extends Controller
|
||||
);
|
||||
|
||||
$m->updateVoucherValueInCart($data, $item_id);
|
||||
} else if ($voucher[0]->VoucherType == "Percentage") {
|
||||
} else if ($voucher[0]->VoucherType == "Flat") {
|
||||
$data = array(
|
||||
'Price' => round($totalValue * -1, 2)
|
||||
);
|
||||
@@ -336,6 +337,9 @@ class PaypalController extends Controller
|
||||
} else if ($voucher[0]->VoucherType == "Shipping") {
|
||||
return $shippingFee = 0;
|
||||
}
|
||||
} else {
|
||||
$getSmallItemQty += $item->Quantity;
|
||||
$CAShippingfee += $item->Quantity; // for canada
|
||||
}
|
||||
// var_dump($item->ShippingCostId);
|
||||
// if ($item->ShippingCostId == 1) {
|
||||
@@ -347,8 +351,7 @@ class PaypalController extends Controller
|
||||
// } else if ($item->ShippingCostId == 4) {
|
||||
// $getDGSItemQty += $item->Quantity;
|
||||
// }
|
||||
$getSmallItemQty += $item->Quantity;
|
||||
$CAShippingfee += $item->Quantity; // for canada
|
||||
|
||||
}
|
||||
|
||||
$array_address_book = $UserModel->selectAddresBook('UserId', $userId);
|
||||
|
||||
Reference in New Issue
Block a user