paypal voucher

fixed paypal vouchers. added round off function
This commit is contained in:
franknstayn
2019-11-05 22:51:38 +08:00
parent 7000bbebe3
commit 1dd7578508
6 changed files with 117 additions and 106 deletions

View File

@@ -92,7 +92,7 @@ class PaypalController extends Controller {
$getPercentageValue = $totalValue / 100;
$getDiscountValue = ($getSubtotal[0]->Subtotal * $getPercentageValue);
$data = array(
'Price' => $getDiscountValue * -1
'Price' => round($getDiscountValue * -1, 2)
);
$m->updateVoucherValueInCart($data, $item_id);
@@ -108,10 +108,11 @@ class PaypalController extends Controller {
$order_items = array();
$updated_items = $m->myCart($cartKey);
$updated_getSubtotal = $m->getSubtotal($cartKey);
var_dump($updated_items);
$order_subtotal = $updated_getSubtotal[0]->Subtotal;
// $order_subtotal = $updated_getSubtotal[0]->Subtotal;
$order_grandtotal = $updated_getSubtotal[0]->Subtotal;
var_dump($order_grandtotal);
// $tax_value = 0.10;
if($grouped_item[0]->StoreId == 76 || $grouped_item[0]->StoreId == 78){
@@ -121,7 +122,9 @@ class PaypalController extends Controller {
}
$tax = $order_grandtotal * $tax_value;
var_dump($tax);
foreach($updated_items as $key => $item){
// $descriptions = "Name: " . $item->Name . " Number: " . $item->Number . " Size: " . $item->Size;"?"
@@ -138,11 +141,13 @@ class PaypalController extends Controller {
$item_list = PayPal::ItemList();
$item_list->setItems($order_items);
var_dump($order_grandtotal);
$amount_details = PayPal::Details();
$amount_details->setSubtotal($order_subtotal);
$amount_details->setSubtotal($order_grandtotal);
$amount_details->setTax($tax);
var_dump($item_list->items);
$amount = PayPal::Amount();
$amount->setCurrency($store_array[0]->StoreCurrency);

View File

@@ -823,6 +823,7 @@ class UserController extends Controller {
$arrayItems = $post['item'];
$order = 1;
$UserModel = new UserModel;
foreach ($arrayItems as $item) {
$i = $UserModel->updateThumbnailOrdering($order, $item);
$order++;