Overview

Packages

  • IllApps
    • Shipsync
  • PHP

Classes

  • IllApps_Shipsync_Block_Adminhtml_Sales_Order_Shipment_Abstract
  • IllApps_Shipsync_Block_Adminhtml_Sales_Order_Shipment_Packages_View
  • IllApps_Shipsync_Block_Adminhtml_Sales_Order_Shipment_Packages_View_Form
  • IllApps_Shipsync_Block_Adminhtml_Sales_Order_Shipment_Packages_View_Items
  • IllApps_Shipsync_Block_Adminhtml_Sales_Order_Shipment_Packages_View_Package
  • IllApps_Shipsync_Block_Adminhtml_Sales_Order_Shipment_View
  • IllApps_Shipsync_Block_Adminhtml_Sales_Order_View
  • IllApps_Shipsync_Block_Adminhtml_Shipsync
  • IllApps_Shipsync_Block_Adminhtml_Shipsync_Option
  • IllApps_Shipsync_Helper_Data
  • IllApps_Shipsync_IndexController
  • IllApps_Shipsync_Model_Mysql4_Setup
  • IllApps_Shipsync_Model_Mysql4_Shipment_Package
  • IllApps_Shipsync_Model_Mysql4_Shipment_Package_Collection
  • IllApps_Shipsync_Model_Sales_Order_Shipment_Package
  • IllApps_Shipsync_Model_Sales_Order_Shipment_Package_Item
  • IllApps_Shipsync_Model_Sales_Quote_Address
  • IllApps_Shipsync_Model_Shipment_Abstract
  • IllApps_Shipsync_Model_Shipment_Package
  • IllApps_Shipsync_Model_Shipment_Request
  • IllApps_Shipsync_Model_Shipment_Response
  • IllApps_Shipsync_Model_Shipment_Result
  • IllApps_Shipsync_Model_Shipping_Carrier_Abstract
  • IllApps_Shipsync_Model_Shipping_Carrier_Fedex
  • IllApps_Shipsync_Model_Shipping_Carrier_Fedex_Address
  • IllApps_Shipsync_Model_Shipping_Carrier_Fedex_Package
  • IllApps_Shipsync_Model_Shipping_Carrier_Fedex_Rate
  • IllApps_Shipsync_Model_Shipping_Carrier_Fedex_Ship
  • IllApps_Shipsync_Model_Shipping_Carrier_Fedex_Source_B13afilingoption
  • IllApps_Shipsync_Model_Shipping_Carrier_Fedex_Source_Freemethod
  • IllApps_Shipsync_Model_Shipping_Carrier_Fedex_Source_Label_Image
  • IllApps_Shipsync_Model_Shipping_Carrier_Fedex_Source_Label_Orientation
  • IllApps_Shipsync_Model_Shipping_Carrier_Fedex_Source_Label_Stock
  • IllApps_Shipsync_Model_Shipping_Carrier_Fedex_Source_Method
  • IllApps_Shipsync_Model_Shipping_Carrier_Fedex_Source_Packaging
  • IllApps_Shipsync_Model_Shipping_Carrier_Fedex_Source_Rate
  • IllApps_Shipsync_Model_Shipping_Carrier_Fedex_Source_Ratediscount
  • IllApps_Shipsync_Model_Shipping_Carrier_Fedex_Source_Residencedelivery
  • IllApps_Shipsync_Model_Shipping_Carrier_Fedex_Source_Signature
  • IllApps_Shipsync_Model_Shipping_Carrier_Fedex_Source_Smartpost_Endorsement
  • IllApps_Shipsync_Model_Shipping_Carrier_Fedex_Source_Smartpost_Indicia
  • IllApps_Shipsync_Model_Shipping_Carrier_Fedex_Source_Unitofmeasure
  • IllApps_Shipsync_Model_Shipping_Carrier_Fedex_Track
  • IllApps_Shipsync_Model_Shipping_Package
  • IllApps_Shipsync_Model_Shipping_Package_Item
  • IllApps_Shipsync_Model_Shipping_Package_Origins
  • IllApps_Shipsync_Model_Shipping_Package_Sort
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: 
 3: /**
 4:  * ShipSync
 5:  *
 6:  * @category   IllApps
 7:  * @package    IllApps_Shipsync
 8:  * @copyright  Copyright (c) 2014 EcoMATICS, Inc. DBA IllApps (http://www.illapps.com)
 9:  * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
10:  */
11: 
12: /**
13:  * IllApps_Shipsync_Block_Adminhtml_Sales_Order_Shipment_View
14:  */
15: class IllApps_Shipsync_Block_Adminhtml_Sales_Order_Shipment_View extends Mage_Adminhtml_Block_Sales_Order_Shipment_View
16: {
17: 
18:     /**
19:      * Construct
20:      */
21:     public function __construct()
22:     {
23:         parent::__construct();
24:         
25:         // Get package model
26:         $shipmentPackage = Mage::getModel('shipping/shipment_package');
27:         
28:         // Get all packages
29:         $packages = $shipmentPackage->getCollection();
30:         
31:         if ($packages) {
32:             $this->_addButton('view_shipment_packages', array(
33:                 'label' => Mage::helper('sales')->__('View Shipment Packages'),
34:                 'onclick' => 'setLocation(\'' . $this->getUrl('shipsync/index/packages', array(
35:                     'shipment_id' => $this->getShipment()->getId()
36:                 )) . '\')'
37:             ));
38:         }
39:         
40: 
41:         // Loop through available packages
42:         foreach ($packages->getData() as $package) {
43:             // If package matches order
44:             if ($shipmentPackage->load($package['package_id'])->getOrderShipmentId() == $this->getShipment()->getId()) {
45:                 // Get label URL
46:                 $url = $this->getUrl('shipsync/index/label/', array(
47:                     'id' => $package['package_id']
48:                 ));
49:                 
50:                 // If package has COD label
51:                 if ($package['cod_label_image'] != "") {
52:                     // Set COD label URL
53:                     $codurl = $this->getUrl('shipsync/index/codlabel/', array(
54:                         'id' => $package['package_id']
55:                     ));
56:                     
57:                     // Add button for COD label
58:                     $this->_addButton('reprint_cod_label', array(
59:                         'label' => Mage::helper('sales')->__('Print COD Label'),
60:                         'onclick' => 'setLocation(\'' . $codurl . '\')'
61:                     ));
62:                 }
63:                 
64:                 if ($package['return_label_image'] != "") {
65:                     $returnurl = $this->getUrl('shipsync/index/returnlabel/', array(
66:                         'id' => $package['package_id']
67:                     ));
68: 
69:                     // Add button for COD label
70:                     $this->_addButton('reprint_return_label', array(
71:                         'label' => Mage::helper('sales')->__('Print Return Label'),
72:                         'onclick' => 'setLocation(\'' . $returnurl . '\')'
73:                     ));
74:                 }
75: 
76:                 // Add print label button
77:                 $this->_addButton('reprint_label', array(
78:                     'label' => Mage::helper('sales')->__('Print Label'),
79:                     'onclick' => 'setLocation(\'' . $url . '\')'
80:                 ));
81:             }
82:         }
83:     }
84: }
85: 
shipsync-community API documentation generated by ApiGen 2.8.0