Plugin.php 768 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. *
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. namespace Magento\Multishipping\Controller\Checkout;
  8. class Plugin
  9. {
  10. /**
  11. * @var \Magento\Checkout\Model\Cart
  12. */
  13. protected $cart;
  14. /**
  15. * @param \Magento\Checkout\Model\Cart $cart
  16. */
  17. public function __construct(\Magento\Checkout\Model\Cart $cart)
  18. {
  19. $this->cart = $cart;
  20. }
  21. /**
  22. * Disable multishipping
  23. *
  24. * @param \Magento\Framework\App\Action\Action $subject
  25. * @return void
  26. * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  27. */
  28. public function beforeExecute(\Magento\Framework\App\Action\Action $subject)
  29. {
  30. $this->cart->getQuote()->setIsMultiShipping(0);
  31. }
  32. }