FreeShippingOptions.php 908 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\OfflineShipping\Model\Source\SalesRule;
  7. use Magento\Framework\Data\OptionSourceInterface;
  8. use Magento\OfflineShipping\Model\SalesRule\Rule;
  9. /**
  10. * @api
  11. * @since 100.1.0
  12. */
  13. class FreeShippingOptions implements OptionSourceInterface
  14. {
  15. /**
  16. * {@inheritdoc}
  17. * @codeCoverageIgnore
  18. * @since 100.1.0
  19. */
  20. public function toOptionArray()
  21. {
  22. return [
  23. [
  24. 'value' => 0,
  25. 'label' => __('No')
  26. ],
  27. [
  28. 'value' => Rule::FREE_SHIPPING_ITEM,
  29. 'label' => __('For matching items only')
  30. ],
  31. [
  32. 'value' => Rule::FREE_SHIPPING_ADDRESS,
  33. 'label' => __('For shipment with matching items')
  34. ]
  35. ];
  36. }
  37. }