Created
February 14, 2019 11:01
-
-
Save torunar/4b5990dc235d2514da5594321b4d6a69 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/addons/lite_checkout/controllers/frontend/checkout.post.php b/app/addons/lite_checkout/controllers/frontend/checkout.post.php | |
index 74b4540cb7..0b3f5cb0eb 100644 | |
--- a/app/addons/lite_checkout/controllers/frontend/checkout.post.php | |
+++ b/app/addons/lite_checkout/controllers/frontend/checkout.post.php | |
@@ -55,12 +55,16 @@ if ($mode == 'checkout') { | |
$user_data['name'] = trim($user_data['firstname'] . ' ' . $user_data['lastname']); | |
- if ($cart['payment_id'] === 0) { | |
+ if ((float) $cart['total'] == 0) { | |
$payment_methods = []; | |
+ $cart['payment_id'] = 0; | |
} else { | |
/** @var array $payment_methods */ | |
$payment_methods = $view->getTemplateVars('payment_methods'); | |
$payment_methods = fn_lite_checkout_flatten_payments_list($payment_methods); | |
+ if (empty($cart['payment_id'])) { | |
+ $cart['payment_id'] = $payment_methods[0]['payment_id']; | |
+ } | |
} | |
$view->assign([ | |
@@ -70,6 +74,7 @@ if ($mode == 'checkout') { | |
'step_one' => true, | |
'step_two' => true, | |
], | |
+ 'cart' => $cart, | |
]); | |
} elseif ($mode == 'delete') { | |
fn_lite_checkout_restore_chosen_shipping($cart); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment