Overview

Namespaces

  • None
  • PHP

Classes

  • Eabi_DpdEE_Block_Adminhtml_Config_Form_Field_Country
  • Eabi_DpdEE_Block_Info_Payment
  • Eabi_DpdEE_Block_Invoice
  • Eabi_DpdEE_Block_Order_Courier
  • Eabi_DpdEE_Helper_Data
  • Eabi_DpdEE_Model_Api
  • Eabi_DpdEE_Model_Button_Courier
  • Eabi_DpdEE_Model_Config
  • Eabi_DpdEE_Model_Flat
  • Eabi_DpdEE_Model_Observer
  • Eabi_DpdEE_Model_Payment_Processor
  • Eabi_DpdEE_Model_Post
  • Eabi_DpdEE_Model_Source_Label_Position
  • Eabi_DpdEE_Model_Source_Service
  • Eabi_Livehandler_Adminhtml_LivehandlerController
  • Eabi_Livehandler_Adminhtml_RemoveController
  • Eabi_Livehandler_Block_Adminhtml_Config_Form_Field_Button
  • Eabi_Livehandler_Block_Adminhtml_Config_Form_Field_Remove
  • Eabi_Livehandler_Block_Email
  • Eabi_LiveHandler_Block_Footer
  • Eabi_Livehandler_Helper_Data
  • Eabi_Livehandler_Helper_Keypair
  • Eabi_Livehandler_IndexController
  • Eabi_Livehandler_Model_Abstract
  • Eabi_Livehandler_Model_Action_Abstract
  • Eabi_Livehandler_Model_Action_Postoffice_Print
  • Eabi_Livehandler_Model_Action_Postoffice_Send
  • Eabi_Livehandler_Model_Adminhtml_Gridmanager
  • Eabi_Livehandler_Model_Directory_Collection
  • Eabi_Livehandler_Model_Entry
  • Eabi_Livehandler_Model_File_Object
  • Eabi_Livehandler_Model_Mysql4_Entry
  • Eabi_Livehandler_Model_Mysql4_Entry_Collection
  • Eabi_Livehandler_Model_Ordergrid
  • Eabi_Livehandler_Model_System_Config_Backend_Button
  • Eabi_Postoffice_Adminhtml_PostofficeController
  • Eabi_Postoffice_Block_Adminhtml_Config_Form_Field_License
  • Eabi_Postoffice_Block_Adminhtml_Config_Form_Field_Remove
  • Eabi_Postoffice_Block_Config_Rebuildbutton
  • Eabi_Postoffice_Helper_Countrycode
  • Eabi_Postoffice_Helper_Data
  • Eabi_Postoffice_IndexController
  • Eabi_Postoffice_Model_Carrier_Abstract
  • Eabi_Postoffice_Model_Carrier_Result
  • Eabi_Postoffice_Model_Carriermodule
  • Eabi_Postoffice_Model_Mysql4_Carriermodule
  • Eabi_Postoffice_Model_Mysql4_Carriermodule_Collection
  • Eabi_Postoffice_Model_Mysql4_Office
  • Eabi_Postoffice_Model_Mysql4_Office_Collection
  • Eabi_Postoffice_Model_Observer
  • Eabi_Postoffice_Model_Office
  • Eabi_Postoffice_Model_Orderview
  • Eabi_Postoffice_Model_Source_Sendevent
  • Eabi_Postoffice_Model_Updater
  • Overview
  • Namespace
  • Class
  • Tree

Class Eabi_Postoffice_Helper_Data

Helper class for dealing with situation, when Carrier provider needs some shipment data to be sent to Carrier providers server.

Mage_Core_Helper_Abstract
Extended by Eabi_Postoffice_Helper_Data
Author: Aktsiamaailm OÜ, Matis Halmann
Located at Eabi/Postoffice/Helper/Data.php
Methods summary
public
# autoSendAfterOnepage( )

Attempts to send order shipment data right at the moment, when user lands on the success page and user has just completed onepage checkout.

Shipment data is sent to the server only, when automatic data sending is enabled and the timing is set to right after order completion.

Shipment data is sent to the server in the following conditions:

  • Order has been fully paid, or payment method is Cash on delivery (to be implemented in future) and cash on delivery is allowed
  • Carrier supports automatic shipment data sending to the Carrier server
  • Merchant has enabled automatic shipment data sending to the server
  • Shipment data has not been sent to the server earlier

Attempts to send order shipment data right at the moment, when user lands on the success page and user has just completed onepage checkout.

Shipment data is sent to the server only, when automatic data sending is enabled and the timing is set to right after order completion.

Shipment data is sent to the server in the following conditions:

  • Order has been fully paid, or payment method is Cash on delivery (to be implemented in future) and cash on delivery is allowed
  • Carrier supports automatic shipment data sending to the Carrier server
  • Merchant has enabled automatic shipment data sending to the server
  • Shipment data has not been sent to the server earlier

See

Eabi_Postoffice_Model_Source_Sendevent source for possible automatic data sending moments.
public
# autoSendAfterMultishipping( )

Attempts to send order shipment data right at the moment, when user lands on the success page and user has just completed multishipping checkout.

Shipment data is sent to the server only, when automatic data sending is enabled and the timing is set to right after order completion.

Shipment data is sent to the server in the following conditions:

  • Order has been fully paid, or payment method is Cash on delivery (to be implemented in future) and cash on delivery is allowed
  • Carrier supports automatic shipment data sending to the Carrier server
  • Merchant has enabled automatic shipment data sending to the server
  • Shipment data has not been sent to the server earlier

Attempts to send order shipment data right at the moment, when user lands on the success page and user has just completed multishipping checkout.

Shipment data is sent to the server only, when automatic data sending is enabled and the timing is set to right after order completion.

Shipment data is sent to the server in the following conditions:

  • Order has been fully paid, or payment method is Cash on delivery (to be implemented in future) and cash on delivery is allowed
  • Carrier supports automatic shipment data sending to the Carrier server
  • Merchant has enabled automatic shipment data sending to the server
  • Shipment data has not been sent to the server earlier

See

Eabi_Postoffice_Model_Source_Sendevent source for possible automatic data sending moments.
public
# autoSendAfterShipment( mixed $observer )

Attempts to send order shipment data right at the moment, when Merchant has finished "Create Shipping" procedure for the order.

Shipment data is sent to the server only, when automatic data sending is enabled and the timing is set to right after order completion.

Shipment data is sent to the server in the following conditions:

  • Order has been fully paid, or payment method is Cash on delivery (to be implemented in future) and cash on delivery is allowed
  • Carrier supports automatic shipment data sending to the Carrier server
  • Merchant has enabled automatic shipment data sending to the server
  • Shipment data has not been sent to the server earlier

Attempts to send order shipment data right at the moment, when Merchant has finished "Create Shipping" procedure for the order.

Shipment data is sent to the server only, when automatic data sending is enabled and the timing is set to right after order completion.

Shipment data is sent to the server in the following conditions:

  • Order has been fully paid, or payment method is Cash on delivery (to be implemented in future) and cash on delivery is allowed
  • Carrier supports automatic shipment data sending to the Carrier server
  • Merchant has enabled automatic shipment data sending to the server
  • Shipment data has not been sent to the server earlier

See

Eabi_Postoffice_Model_Source_Sendevent source for possible automatic data sending moments.
public
# clearSessions( Varien_Object $observer )

Clears all the extra data created by this carrier or by the subclasses of this carrier.

Clears all the extra data created by this carrier or by the subclasses of this carrier.

It is called with the event sales_order_place_before

Parameters

$observer
Varien_Object
$observer

Throws

Exception
public
# sendManualOrderData( string $incrementId, string $eventName )

Attempts to send order shipment data right from the Merchant's manual call.

Shipment data is sent to the server in the following conditions:

  • Order has been fully paid, or payment method is Cash on delivery (to be implemented in future) and cash on delivery is allowed
  • Carrier supports automatic shipment data sending to the Carrier server
  • Merchant has enabled automatic shipment data sending to the server
  • Shipment data has not been sent to the server earlier

Attempts to send order shipment data right from the Merchant's manual call.

Shipment data is sent to the server in the following conditions:

  • Order has been fully paid, or payment method is Cash on delivery (to be implemented in future) and cash on delivery is allowed
  • Carrier supports automatic shipment data sending to the Carrier server
  • Merchant has enabled automatic shipment data sending to the server
  • Shipment data has not been sent to the server earlier

Parameters

$incrementId
string
$incrementId Order increment ID
$eventName
string
$eventName Name of the event.

See

Eabi_Postoffice_Model_Source_Sendevent source for possible automatic data sending moments.
public string|boolean
# getBarcode( string $incrementId )

Attempts to fetch the barcode, which has been generated by the remote Carrier.

Fetching barcode is only possible, when shipment data is successfully sent to the carrier and Carrier itself supports Barcodes.

Barcodes are used to print shipping labels.

Parameters

$incrementId
string
$incrementId Order increment ID.

Returns

string|boolean
barcode for the selected order, when successul, false in every other situation.
public Eabi_Postoffice_Model_Carrier_Abstract|boolean
# getShippingMethodInstance( string $incrementId )

Attempts to fetch shipping method instance for specified order increment id.

Shipping method is fetched only if it is instance of Eabi_Postoffice_Model_Carrier_Abstract otherwise boolean false is returned

Attempts to fetch shipping method instance for specified order increment id.

Shipping method is fetched only if it is instance of Eabi_Postoffice_Model_Carrier_Abstract otherwise boolean false is returned

Parameters

$incrementId
string
$incrementId order increment id

Returns

Eabi_Postoffice_Model_Carrier_Abstract|boolean
public string|boolean
# getBarcodePdf( string $incrementId )

Attempts to fetch the shipping label PDF created by the remote Carrier server.

Fetching barcode is only possible, when shipment data is successfully sent to the carrier and Carrier itself supports Barcodes.

Parameters

$incrementId
string
$incrementId Order increment ID.

Returns

string|boolean
Packing slip PDF binary for the selected order when successful, false in every other condition.
public boolean
# isDataSent( string $incrementId )

Determines whether Order shipment data has been successfully sent to the remote carrier server.

Determines whether Order shipment data has been successfully sent to the remote carrier server.

Parameters

$incrementId
string
$incrementId Order increment ID.

Returns

boolean
true, if the data has been successfully sent to the server. False, if the data has not been sent successfully to the server. NULL if automatic data sending is not enabled or not applicable for the Order selected carrier.
public boolean
# canSendData( Mage_Sales_Model_Order $order, type & $shippingMethodModel = null )

Returns true if all of the following are true

  • Carrier supports automatic data sending
  • Automatic data sending is allowed
  • Order is fully paid or payment method is COD
  • Order is not canceled and contains physical goods

Returns true if all of the following are true

  • Carrier supports automatic data sending
  • Automatic data sending is allowed
  • Order is fully paid or payment method is COD
  • Order is not canceled and contains physical goods

Parameters

$order
Mage_Sales_Model_Order
$order
$shippingMethodModel
type
$shippingMethodModel

Returns

boolean
public array
# getDataFromOrder( Mage_Sales_Model_Order $order, string $prefix )

Attempts to fetch data from order that is stored by carriers extending Eabi_Postoffice_Model_Carrier_Abstract

Data is stored in not visible on front order comment base64 encoded form and starting with specified prefix.

If matching comment is found, it is decoded and returned as assoc array

Attempts to fetch data from order that is stored by carriers extending Eabi_Postoffice_Model_Carrier_Abstract

Data is stored in not visible on front order comment base64 encoded form and starting with specified prefix.

If matching comment is found, it is decoded and returned as assoc array

Parameters

$order
Mage_Sales_Model_Order
$order Magento order instance to look up the data for
$prefix
string
$prefix unique string prefix order comment should start with.

Returns

array
public array
# setDataToOrder( Mage_Sales_Model_Order $order, array $data, string $prefix )

Stores extra data for specified order in single order comment, which will start with specified prefix.

If no matching order comment is found, then it is created automatically, otherwise old one is updated.

Order comment is stored using following procedure:

  • If old data is found, then it is merged with new data
  • Data is json encoded and after that gzcompressed
  • Now it is base64 encoded and divided into 40 char long lines and prefixed with $prefix
  • Result is stored to one of the comments contained within the order.

Stores extra data for specified order in single order comment, which will start with specified prefix.

If no matching order comment is found, then it is created automatically, otherwise old one is updated.

Order comment is stored using following procedure:

  • If old data is found, then it is merged with new data
  • Data is json encoded and after that gzcompressed
  • Now it is base64 encoded and divided into 40 char long lines and prefixed with $prefix
  • Result is stored to one of the comments contained within the order.

Parameters

$order
Mage_Sales_Model_Order
$order Magento order instance to set up the data for
$data
array
$data
$prefix
string
$prefix

Returns

array
public integer
# getTimeDiff( )

Returns Magento timestamp and time() difference in seconds

Returns Magento timestamp and time() difference in seconds

Returns

integer
protected
# _getCommentFromData( mixed $data, mixed $prefix )
protected
# _getFromComment( mixed $comment, mixed $prefix )
protected
# _commentContainsValidData( mixed $comment, mixed $prefix )
public integer
# getNumberOfPackagesFromItemWeights( array $itemWeights, integer $maximumWeight )

Takes in array of parcel weights and returns number of packages calculated by maximum allowed weight per package

Uses better methology to find number of packages than regular cart weight divided by maximum package weight

For example, if maximum package weight is 31kg, ang we have 3x 20kg packages, then number of packages would be 3 (not 2)

If maximum package weight is not defined, then it returns 1

If single item in <span class="php-var">$itemWeights</span> exceeds <span class="php-var">$maximumWeight</span> then this function returns false

Takes in array of parcel weights and returns number of packages calculated by maximum allowed weight per package

Uses better methology to find number of packages than regular cart weight divided by maximum package weight

For example, if maximum package weight is 31kg, ang we have 3x 20kg packages, then number of packages would be 3 (not 2)

If maximum package weight is not defined, then it returns 1

If single item in <span class="php-var">$itemWeights</span> exceeds <span class="php-var">$maximumWeight</span> then this function returns false

Parameters

$itemWeights
array
$itemWeights array of item weights
$maximumWeight
integer
$maximumWeight maximum allowed weight of one package

Returns

integer
public boolean
# isMobilePhone( string & $number, Mage_Customer_Model_Address $address )

Parameters

$number
string
$number
$address
Mage_Customer_Model_Address
$address

Returns

boolean
public
# setCarrierLicense( mixed $carrierCode, array $data )
public
# getCarrierLicense( mixed $carrierCode )
protected Eabi_Postoffice_Model_Carriermodule
# _getCarrierModule( mixed $carrierCode )

Returns

Eabi_Postoffice_Model_Carriermodule
protected Eabi_Postoffice_Model_Carriermodule
# _getCarrierModuleModel( )

Returns

Eabi_Postoffice_Model_Carriermodule
protected Eabi_Postoffice_Helper_Countrycode
# _getCountryCodeHelper( )

Returns

Eabi_Postoffice_Helper_Countrycode
DPD Eesti - Pakivedu.ee Shipping module for Magento API documentation generated by ApiGen 2.8.0