コード例 #1
0
 private function processExistShipment(Mage_Adminhtml_Block_Sales_Order_Shipment_View $block)
 {
     $shipmentId = $block->getRequest()->getParam('shipment_id');
     if (empty($shipmentId)) {
         return;
     }
     /** @var Mage_Sales_Model_Order_Shipment $shipment */
     $shipment = Mage::getModel('sales/order_shipment')->load((int) $shipmentId);
     try {
         /** @var Ess_M2ePro_Model_Order $order */
         $order = Mage::helper('M2ePro/Component_Amazon')->getObject('Order', (int) $shipment->getOrderId(), 'magento_order_id');
     } catch (Exception $exception) {
         return;
     }
     if (is_null($order) || !$order->getId()) {
         return;
     }
     if (!$order->isMagentoShipmentCreatedByOrder($shipment)) {
         return;
     }
     /** @var Ess_M2ePro_Model_Amazon_Order $amazonOrder */
     $amazonOrder = $order->getChildObject();
     if (!$amazonOrder->isMerchantFulfillmentApplied() || !$amazonOrder->getData('merchant_fulfillment_label')) {
         return;
     }
     $getLabelUrl = $block->getUrl('M2ePro/adminhtml_common_amazon_order_merchantFulfillment/getLabel', array('order_id' => $order->getId()));
     $block->updateButton('print', 'onclick', 'window.open(\'' . $getLabelUrl . '\')');
 }
コード例 #2
0
ファイル: View.php プロジェクト: GabrielCC/zitec-dpd-master
 public function __construct()
 {
     parent::__construct();
     if ($this->_hasPdfShippingLabel()) {
         $this->_addButton('zitec_print_shipping_label', array('label' => $this->_getHelper()->__('Print Shipping Labels'), 'onclick' => "setLocation('{$this->_getPrintShippingLabelsUrl()}')"));
     }
 }
コード例 #3
0
ファイル: View.php プロジェクト: xiaoguizhidao/magento
 public function getHeaderText()
 {
     $header = parent::getHeaderText();
     $status = $this->getShipment()->getUdropshipStatus();
     if (is_numeric($status)) {
         $statuses = Mage::getSingleton('udropship/source')->setPath('shipment_statuses')->toOptionHash();
         $header .= ' [' . $statuses[$this->getShipment()->getUdropshipStatus()] . ']';
     }
     return $header;
 }
コード例 #4
0
 public function __construct()
 {
     parent::__construct();
     /*  if ($this->getShipment()->getId()) {
             $this->_addButton('subscribe', array(
                     'label'     => Mage::helper('sales')->__('Subscribe to Tracking Information'),
                     'class'     => 'save',
                     'onclick'   => 'setLocation(\''.$this->getShipTrackUrl($this->getShipment()->getId()).'\')'
                 )
             );
         }*/
 }
コード例 #5
0
ファイル: View.php プロジェクト: GabrielCC/zitec-dpd-master
 public function __construct()
 {
     parent::__construct();
     if (!$this->_getHelper()->moduleIsActive()) {
         return;
     }
     if (!$this->_getHelper()->isShippingMethodDpd($this->getShipment()->getOrder()->getShippingMethod()) || $this->_getHelper()->isCancelledWithDpd($this->getShipment())) {
         return;
     }
     $isManifestClosed = $this->_getHelper()->isManifestClosed($this->getShipment()->getId());
     if ($isManifestClosed) {
         $onClick = 'setLocation(\'' . $this->_getManifestUrl() . '\')';
     } else {
         $onClick = "deleteConfirm('" . $this->_getHelper()->__('Once the manifest is closed, you will not be able to make further changes to the shipping address. Do you want to continue?') . "', '" . $this->_getManifestUrl() . "')";
     }
     $this->_addButton('closemanifest', array('label' => $isManifestClosed ? $this->_getHelper()->__('Print Manifest') : $this->_getHelper()->__('Close Manifest'), 'class' => 'save', 'onclick' => $onClick, 'sort_order' => -10));
 }
コード例 #6
0
 public function __construct()
 {
     parent::__construct();
 }