GuestShippingMethodManagementInterface.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Quote\Model\GuestCart;
  7. /**
  8. * Interface \Magento\Quote\Model\GuestCart\GuestShippingMethodManagementInterface
  9. *
  10. */
  11. interface GuestShippingMethodManagementInterface
  12. {
  13. /**
  14. * Set the carrier and shipping methods codes for a specified cart.
  15. *
  16. * @param string $cartId The shopping cart ID.
  17. * @param string $carrierCode The carrier code.
  18. * @param string $methodCode The shipping method code.
  19. * @return bool
  20. * @throws \Magento\Framework\Exception\InputException The shipping method is not valid for an empty cart.
  21. * @throws \Magento\Framework\Exception\CouldNotSaveException The shipping method could not be saved.
  22. * @throws \Magento\Framework\Exception\StateException The billing or shipping address is missing.
  23. * @throws \Magento\Framework\Exception\NoSuchEntityException The specified cart contains only virtual products
  24. * so the shipping method does not apply.
  25. */
  26. public function set($cartId, $carrierCode, $methodCode);
  27. /**
  28. * Return selected shipping method for a specified quote.
  29. *
  30. * @param string $cartId The shopping cart ID.
  31. * @return \Magento\Quote\Api\Data\ShippingMethodInterface Shipping method.
  32. * @throws \Magento\Framework\Exception\NoSuchEntityException The specified shopping cart does not exist.
  33. * @throws \Magento\Framework\Exception\StateException The shipping address is missing.
  34. */
  35. public function get($cartId);
  36. }