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
|
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
|
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
|
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
|
|
public
|
|
protected
Eabi_Postoffice_Model_Carriermodule
|
|
protected
Eabi_Postoffice_Model_Carriermodule
|
|
protected
Eabi_Postoffice_Helper_Countrycode
|
|