-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-implement minimum purchase amount #5564
Re-implement minimum purchase amount #5564
Conversation
maximebiloe
commented
May 13, 2016
•
edited
Loading
edited
Questions | Answers |
---|---|
Branch? | develop |
Description? | In the BO you can set a minimum amount to purchase but it wasn't tae into account in FO. Now we disable the checkout button in shopping cart and also display a warning. We prevent to access to the checkout too by redirecting to the shopping cart. |
Type? | bug fix |
Category? | FO |
BC breaks? | no |
Deprecations? | no |
Fixed ticket? | http://forge.prestashop.com/browse/BOOM-120 |
How to test? | Set a minimum amount to purchase in the BO, then try to order and check the behavior. |
@@ -213,6 +213,7 @@ public function present($cart) | |||
$products = $this->addCustomizedData($products, $cart); | |||
$subtotals = []; | |||
|
|||
$productsTotalExcludingTax = $cart->getOrderTotal(false, Cart::ONLY_PRODUCTS); | |||
$total_excluding_tax = $cart->getOrderTotal(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some times we use _
, sometimes camelCase, is it going to by standarized somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, now it's camelCase. We will change all old snake case legacy code, every time we can, smoothly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$this->translator->trans( | ||
'A minimum shopping cart total of %s (tax excl.) is required to validate your order. | ||
Current cart total is %s (tax excl.).', | ||
[], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
array()
Thank you @maximebiloe |
$this->priceFormatter->convertAndFormat($minimalPurchase), | ||
$this->priceFormatter->convertAndFormat($productsTotalExcludingTax) | ||
) : | ||
'', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just an idea right now…
As the PSR / Symfony do not control the ternary operator structure, maybe we should follow the AirBnb one?