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_Shipsync
14:  */
15: class IllApps_Shipsync_Block_Adminhtml_Shipsync extends Mage_Adminhtml_Block_Widget
16: {
17: 
18:     /**
19:      * Construct
20:      */
21:     public function __construct()
22:     {
23:         parent::__construct();
24:         
25:         $order_id = $this->getRequest()->getParam('order_id'); // Get order id
26:         
27:         $shippingPackage = Mage::getModel('shipsync/shipping_package'); // Get shipping package model
28:         
29:         $this->setOrder(Mage::getModel('sales/order')->load($order_id)); // Set order model        
30:         $this->setOrderUrl($this->getUrl('adminhtml/sales_order/view', array('order_id' => $order_id))); // Set order url
31:         $this->setOrderAdminDate($this->formatDate($this->getOrder()->getCreatedAtDate(), 'medium', true)); // Set order admin date
32:         $this->setOrderStoreDate($this->formatDate($this->getOrder()->getCreatedAtStoreDate(), 'medium', true)); // Set order store date
33:         $this->setOrderTimezone($this->getOrder()->getCreatedAtStoreDate()->getTimezone()); // Set order timezone
34:         $this->setShippingMethod(explode('_', $this->getOrder()->getShippingMethod())); // Set shipping method
35:         $this->setDefaultPackages(Mage::getModel('shipsync/shipping_package')->getDefaultPackages(array('fedex')));
36:         $this->setItems($shippingPackage->getParsedItems($this->getOrder()->getAllItems(), true)); // Set items
37:         $this->setPackages($shippingPackage->estimatePackages($this->getItems(), $this->getDefaultPackages())); // Set packages
38:         $this->setCarrier(Mage::getModel('usa/shipping_carrier_fedex')); // Set carrier model
39:         $this->setCarrierTitle(Mage::getStoreConfig('carriers/fedex/title')); // Set carrier title
40:         $this->setCarrierCode(strtoupper($this->getShippingMethod(0))); // Set carrier code
41:         $this->setMethodCode($this->getShippingMethod(1)); // Set method code
42:         $this->setMethod($this->getCarrier()->getCode('method', $this->getMethodCode())); // Set method 
43:         $this->setAllowedMethods(explode(",", Mage::getStoreConfig('carriers/fedex/allowed_methods'))); // Set allowed methods  
44:         $this->setDimensionUnits($this->getCarrier()->getDimensionUnits()); // Set dimension units
45:         $this->setWeightUnits($this->getCarrier()->getWeightUnits()); // Set weight units   
46:         $this->setSaturdayDelivery((bool) strpos($this->getOrder()->getShippingDescription(), 'Saturday Delivery')); // Determine if shipment delivers on Saturday
47:         $this->setAddressValidation(Mage::getStoreConfig('carriers/fedex/shipping_address_validation'));
48:         $this->setResidenceDelivery(Mage::getStoreConfig('carriers/fedex/shipping_residence_delivery'));
49:         $this->setFormKey(Mage::getSingleton('core/session')->getFormKey()); // Set form key        
50:         
51:         $this->setShipperCompany(Mage::app()->getStore()->getFrontendName());
52: 
53:         if ($this->getOrder()->getEmailSent()) // Check if order email is sent
54:             {
55:             $this->setEmailSentMsg(Mage::helper('sales')->__('the order confirmation email was sent'));
56:         } // Set 'sent' message
57:         else {
58:             $this->setEmailSentMsg(Mage::helper('sales')->__('the order confirmation email is not sent'));
59:         } // Set 'not sent' message
60: 
61:         $this->setLabelImageType(Mage::getStoreConfig('carriers/fedex/label_image'));
62:         $this->setLabelStockType(Mage::getStoreConfig('carriers/fedex/label_stock'));
63:         $this->setLabelPrintingOrientation(Mage::getStoreConfig('carriers/fedex/label_orientation'));
64:         $this->setEnableJavaPrinting(Mage::getStoreConfig('carriers/fedex/enable_java_printing'));
65:         $this->setPrinterName(Mage::getStoreConfig('carriers/fedex/printer_name'));
66:         $this->setPackingList(Mage::getStoreConfig('carriers/fedex/packing_list'));
67:         $this->setSignature(Mage::getStoreConfig('carriers/fedex/signature'));
68:         $this->setReturnLabel(Mage::getStoreConfig('carriers/fedex/return_label'));
69:     }
70:     
71: }
72: 
shipsync-community API documentation generated by ApiGen 2.8.0