Skip to content

Commit

Permalink
Fix magento#2132 - Enabled Store Pickup Shipping Method
Browse files Browse the repository at this point in the history
* Added config options
* Changed error in the model
* Auto-Formated system.xml (too long lines)
  • Loading branch information
amenk committed Oct 18, 2015
1 parent 24abff1 commit 80a2fa4
Show file tree
Hide file tree
Showing 3 changed files with 141 additions and 53 deletions.
24 changes: 11 additions & 13 deletions app/code/Magento/OfflineShipping/Model/Carrier/Pickup.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,22 @@ public function collectRates(RateRequest $request)
return false;
}

/** @var \Magento\Shipping\Model\Rate\Result $result */
$result = $this->_rateResultFactory->create();
/** @var \Magento\Shipping\Model\Rate\Result $result */
$result = $this->_rateResultFactory->create();

if (!empty($rate)) {
/** @var \Magento\Quote\Model\Quote\Address\RateResult\Method $method */
$method = $this->_rateMethodFactory->create();
/** @var \Magento\Quote\Model\Quote\Address\RateResult\Method $method */
$method = $this->_rateMethodFactory->create();

$method->setCarrier('pickup');
$method->setCarrierTitle($this->getConfigData('title'));
$method->setCarrier('pickup');
$method->setCarrierTitle($this->getConfigData('title'));

$method->setMethod('store');
$method->setMethodTitle(__('Store Pickup'));
$method->setMethod('store');
$method->setMethodTitle(__('Store Pickup'));

$method->setPrice(0);
$method->setCost(0);
$method->setPrice(0);
$method->setCost(0);

$result->append($method);
}
$result->append($method);

return $result;
}
Expand Down
Loading

1 comment on commit 80a2fa4

@UglyWillDuckling
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I implemented this, but it still requires the customer to give his or hers own address. Any way to fix that?

Please sign in to comment.