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

Unable to delete item from checkout cart with minimum order amount #7398

Closed
ghost opened this issue Nov 10, 2016 · 4 comments
Closed

Unable to delete item from checkout cart with minimum order amount #7398

ghost opened this issue Nov 10, 2016 · 4 comments

Comments

@ghost
Copy link

ghost commented Nov 10, 2016

Preconditions

  1. PHP 7.0.12
  2. MariaDB 10.0.27 or 10.1.19
  3. Magento 2.1.2
  4. Apache 2.4.18 or Nginx 1.10.2

Steps to reproduce

  1. Login to Admin
  2. Go to Stores -> Configuration -> Sales(tab) -> Sales(section) -> Minimum Order Amount
  3. Set Enable -> Yes
  4. Set Minimum Amount -> 100
  5. Set Description Message && Error to Show in Shopping Cart -> Sorry, but minimum order is $100.
  6. Save config && Flush Cache
  7. Go to frontend
  8. Add to card item with price lower then 100$.
  9. Go to checkout cart -> delete item (actual 1 result).
  10. Click mini cart -> delete item (actual 2 result).

Expected result

The buyer should be able to remove items from the checkout cart.

Actual result

Fatal error: Uncaught TypeError: Argument 1 passed to Magento\Framework\Exception\InputException::__construct() must be an instance of Magento\Framework\Phrase, string given, called in /var/www/magento2/vendor/magento/module-quote/Model/ShippingAddressManagement.php on line 121 and defined in /var/www/magento2/vendor/magento/framework/Exception/InputException.php:51
Stack trace: 
#0 /var/www/magento2/vendor/magento/module-quote/Model/ShippingAddressManagement.php(121): Magento\Framework\Exception\InputException->__construct('Sorry, but mini...') 
#1 /var/www/magento2/vendor/magento/module-quote/Model/Quote/ShippingAssignment/ShippingProcessor.php(66): Magento\Quote\Model\ShippingAddressManagement->assign('3', Object(Magento\Quote\Model\Quote\Address)) 
#2 /var/www/magento2/vendor/magento/module-quote/Model/Quote/ShippingAssignment/ShippingAssignmentProcessor.php(76): Magento\Quote\Model\Quote\ShippingAssignment\ShippingProcessor->save(Object(Magento\Quote\Model\Shipping), Object(Magento\Quote\Model\Quote)) 
#3 /var/www/magent in /var/www/magento2/vendor/magento/framework/Exception/InputException.php on line 51
{
    "readyState": 4,
    "responseText": "<br />\n<b>Fatal error</b>:  Uncaught TypeError: Argument 1 passed to Magento\\Framework\\Exception\\InputException::__construct() must be an instance of Magento\\Framework\\Phrase, string given, called in /var/www/magento2/vendor/magento/module-quote/Model/ShippingAddressManagement.php on line 121 and defined in /var/www/magento2/vendor/magento/framework/Exception/InputException.php:51\nStack trace:\n#0 /var/www/magento2/vendor/magento/module-quote/Model/ShippingAddressManagement.php(121): Magento\\Framework\\Exception\\InputException-&gt;__construct('Sorry, but mini...')\n#1 /var/www/magento2/vendor/magento/module-quote/Model/Quote/ShippingAssignment/ShippingProcessor.php(66): Magento\\Quote\\Model\\ShippingAddressManagement-&gt;assign('3', Object(Magento\\Quote\\Model\\Quote\\Address))\n#2 /var/www/magento2/vendor/magento/module-quote/Model/Quote/ShippingAssignment/ShippingAssignmentProcessor.php(76): Magento\\Quote\\Model\\Quote\\ShippingAssignment\\ShippingProcessor-&gt;save(Object(Magento\\Quote\\Model\\Shipping), Object(Magento\\Quote\\Model\\Quote))\n#3 /var/www/magent in <b>/var/www/magento2/vendor/magento/framework/Exception/InputException.php</b> on line <b>51</b><br />\n",
    "status": 200,
    "statusText": "OK"
}
@ghost ghost changed the title Unable to delete item from checkout card with minimum amount Unable to delete item from checkout cart with minimum order amount Nov 10, 2016
@ghost
Copy link
Author

ghost commented Nov 10, 2016

In file vendor/magento/module-quote/Model/ShippingAddressManagement.php on 121 line need to replace

if (!$quote->validateMinimumAmount($quote->getIsMultiShipping())) {
    throw new InputException($this->getMinimumAmountErrorMessage()->getMessage());
}

with

if (!$quote->validateMinimumAmount($quote->getIsMultiShipping())) {
    throw new InputException(__($this->getMinimumAmountErrorMessage()->getMessage()));
}

But after this fix you will see:
screenshot from 2016-11-11 00-07-54

@ghost
Copy link
Author

ghost commented Nov 10, 2016

When comment or remove this 3 lines (if block) - all works fine - Update, Delete, Add.
And when you go to checkout - you will get correct message about minimum order amount.

@Serhiy-Nazarov
Copy link

#6151

@veloraven
Copy link
Contributor

@Hawok thank you for your report but I'm closing it as duplicate.

magento-devops-reposync-svc pushed a commit that referenced this issue Apr 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants