Skip to content
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

Merged
merged 10 commits into from
May 19, 2016
Merged

Re-implement minimum purchase amount #5564

merged 10 commits into from
May 19, 2016

Conversation

maximebiloe
Copy link
Contributor

@maximebiloe maximebiloe commented May 13, 2016

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.

@maximebiloe maximebiloe changed the title Re-implement minimumpurchase amount Re-implement minimum purchase amount May 16, 2016
@@ -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);
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maximebiloe maximebiloe added waiting for code review Waiting for QA Status: action required, waiting for test feedback and removed waiting for wording labels May 18, 2016
@dSkrbic dSkrbic added QA ✔️ Status: check done, code approved and removed Waiting for QA Status: action required, waiting for test feedback labels May 18, 2016
$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.).',
[],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

array()

@mickaelandrieu
Copy link
Contributor

Thank you @maximebiloe

@mickaelandrieu mickaelandrieu merged commit b975d24 into PrestaShop:develop May 19, 2016
$this->priceFormatter->convertAndFormat($minimalPurchase),
$this->priceFormatter->convertAndFormat($productsTotalExcludingTax)
) :
'',
Copy link
Contributor

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?

@maximebiloe maximebiloe deleted the dev/fix/minimum-amount-to-order branch January 17, 2017 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
QA ✔️ Status: check done, code approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants