Skip to content

Commit

Permalink
Adds Send to FlagShip button to admin order view
Browse files Browse the repository at this point in the history
  • Loading branch information
radua committed Jun 21, 2019
1 parent c511c0e commit 892d3fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions Plugin/UpdateTrackingDetails.php
Expand Up @@ -8,13 +8,15 @@ public function __construct(
\Flagship\Shipping\Plugin\SendToFlagshipButton $sendToFlagshipButton,
\Flagship\Shipping\Controller\Adminhtml\PrepareShipment\Index $prepareShipment,
\Magento\Framework\Module\Manager $moduleManager,
\Magento\Sales\Model\Order\ShipmentRepository $shipmentRepository
\Magento\Sales\Model\Order\ShipmentRepository $shipmentRepository,
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
){
$this->tracking = $tracking;
$this->prepareShipment = $prepareShipment;
$this->moduleManager = $moduleManager;
$this->sendToFlagshipButton = $sendToFlagshipButton;
$this->shipmentRepository = $shipmentRepository;
$this->scopeConfig = $scopeConfig;
}

public function beforeSetLayout(\Magento\Sales\Block\Adminhtml\Order\View $subject){
Expand All @@ -37,7 +39,9 @@ public function beforeSetLayout(\Magento\Sales\Block\Adminhtml\Order\View $subje
$this->updateTrackingDetails($flagshipId,$shipment);
}

$this->sendToFlagshipButton->addSendToFlagshipButton($subject);
if(!$this->scopeConfig->getValue('carriers/flagship/show_button')){
$this->sendToFlagshipButton->addSendToFlagshipButton($subject);
}

return;
}
Expand Down
2 changes: 1 addition & 1 deletion view/adminhtml/templates/displayPacking.phtml
Expand Up @@ -24,7 +24,7 @@

$packing = '';
foreach ($packingDetails as $packingDetail) {
$packing .= normalizePackingDetail($packingDetail);
$packing .= normalizePackingDetail($packingDetail['detail']);
}

echo $packing;
Expand Down

0 comments on commit 892d3fd

Please sign in to comment.