1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <?php
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- namespace Magento\OfflineShipping\Model\Carrier;
- use Magento\Quote\Model\Quote\Address\RateRequest;
- /**
- * Pickup shipping model
- *
- * @api
- * @since 100.0.2
- */
- class Pickup extends \Magento\Shipping\Model\Carrier\AbstractCarrier implements
- \Magento\Shipping\Model\Carrier\CarrierInterface
- {
- /**
- * @var string
- */
- protected $_code = 'pickup';
- /**
- * @var bool
- */
- protected $_isFixed = true;
- /**
- * @var \Magento\Shipping\Model\Rate\ResultFactory
- */
- protected $_rateResultFactory;
- /**
- * @var \Magento\Quote\Model\Quote\Address\RateResult\MethodFactory
- */
- protected $_rateMethodFactory;
- /**
- * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
- * @param \Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory
- * @param \Psr\Log\LoggerInterface $logger
- * @param \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory
- * @param \Magento\Quote\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory
- * @param array $data
- */
- public function __construct(
- \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
- \Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory,
- \Psr\Log\LoggerInterface $logger,
- \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory,
- \Magento\Quote\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory,
- array $data = []
- ) {
- $this->_rateResultFactory = $rateResultFactory;
- $this->_rateMethodFactory = $rateMethodFactory;
- parent::__construct($scopeConfig, $rateErrorFactory, $logger, $data);
- }
- /**
- * @param RateRequest $request
- * @return \Magento\Shipping\Model\Rate\Result
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
- */
- public function collectRates(RateRequest $request)
- {
- // Pickup shipping method is not supported in Magento2 yet.
- return false;
- }
- /**
- * Get allowed shipping methods
- *
- * @return array
- */
- public function getAllowedMethods()
- {
- return ['pickup' => __('Store Pickup')];
- }
- }
|