Pickup.php 633 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Ups\Model\Config\Source;
  7. /**
  8. * Class Pickup
  9. */
  10. class Pickup extends \Magento\Ups\Model\Config\Source\Generic
  11. {
  12. /**
  13. * Carrier code
  14. *
  15. * @var string
  16. */
  17. protected $_code = 'pickup';
  18. /**
  19. * {@inheritdoc}
  20. */
  21. public function toOptionArray()
  22. {
  23. $ups = $this->carrierConfig->getCode($this->_code);
  24. $arr = [];
  25. foreach ($ups as $k => $v) {
  26. $arr[] = ['value' => $k, 'label' => __($v['label'])];
  27. }
  28. return $arr;
  29. }
  30. }