Class Eabi_Postoffice_Model_Carrier_Abstract
Base class for carriers, which ask customer to pick parcel terminal of choice from dropdown list.
Offers following business functions:
- Chosen parcel terminal is forwarded to the Merchant
- Monitors if shipment parcel data is sent to remote server
- Offers PDF packing slip printing function, if subclasses implement actual fetch procedure.
- Offers auto update functionality for parcel terminals if subclasses implement actual parcel terminal fetch procedure
- Offers cash on delivery functionality with help of extra plugins.
- Offers clickable tracking url or iframe functionality from Magento
- Mage_Shipping_Model_Carrier_Abstract
- Eabi_Postoffice_Model_Carrier_Abstract
Direct known subclasses
Eabi_DpdEE_Model_PostIndirect known subclasses
Eabi_DpdEE_Model_Flat
abstract public
array
|
#
getOfficeList( )
This method should be implemented in subclasses of this carrier. Purpose of this method is to return array of Postoffices/Parcel terminals associated to this carrier. This method is called automatically by Magento's cron and the update
frequency is regulated by the carriers configuration data of
Usually the carriers are fetched from some remote location and sometimes the fetching may fail, in this case this method should return boolean false in order to avoid Postoffice list being empty. |
public
integer
|
#
getGroupSort( string $group_name )
If you would like to display certain counties or cities before the others, then you can overwrite this function. This function should return positive integer. The greater the number returned means this county/city is more important than the others and should be displayed before the others. In general postoffices will be displayed according to the following rules:
This function is called only when getOfficeList function does not supply group_sort parameter |
protected
boolean
|
#
_isAvailable( Mage_Shipping_Model_Rate_Request $request )
This function is called right after:
If this function returns false, then this carrier is not available. |
public
boolean
|
|
public
boolean|string
|
|
public
boolean
|
#
getTrackingInIframe( )
When set to true and $_tracking_url is provided, then instead of clickable link iframe is displayed instead. |
public
Varien_Object|null
|
#
getTrackingInfo( string $number )
Attempts to display tracking link or tracking iframe if tracking is supported by the carrier and tracking url is available. |
protected
boolean
|
#
_isMultishipping( Mage_Shipping_Model_Rate_Request $request )
Returns true if this Mage_Shipping_Model_Rate_Request is multishipping. |
final public
boolean|
|
#
collectRates( Mage_Shipping_Model_Rate_Request $request )
use use |
public
boolean
|
#
isCodEnabled( Mage_Customer_Model_Address $address )
Returns true if cash on delivery is specified for target address |
protected
float|integer
|
#
_applyPriceFromCod( Mage_Shipping_Model_Rate_Request $request )
Applies extra price from Cash on Delivery, which is added on top of shipping price |
final public
boolean
|
#
isAjaxInsertAllowed( integer $addressId )
Security related, used to prevent customer to enter arbitrary data as their shipping carrier. |
protected
float
|
#
_calculateAdditionalShippingPrice( Mage_Shipping_Model_Rate_Request $request, float $price )
This function is called right after the initial price calculation by the </code>collectRates</code> has been called. Overwrite this function if you want to apply more complicated price calculation rules, than </code>collectRates</code> function offers. |
protected
array
|
#
getOfficesFromAddress( Mage_Shipping_Model_Rate_Request $request )
Overwrite this function in your subclass if you would like to offer automatic postoffice selection based on the user entered address. |
public
boolean|array
|
#
getGroups( integer $addressId = null )
Returns distinct group_name,group_id,group_sort as Eabi_Postoffice_Model_Mysql4_Office_Collection of 'eabi_postoffice/office' models Result of this function is used to render the first select menu (county/city) for this carrier. If no groups can be found, then this function returns boolean false. |
public
|
|
public
|
#
getTerminal( integer $placeId )
Returns the selected postoffice by it's place id. If no postoffice found, then returns boolean false. |
public
string
|
#
getTerminalTitle(
Determines how name of each postoffice in the second select menu should be rendered. |
public
string
|
#
getGroupTitle(
Determines how name of each county/city in the first select menu should be rendered. |
final public
boolean|string
|
#
getTerminalComment(
Should return extra comment for the selected postoffice. For example shipping time. Extra comment is displayed next to select menu just before price display Returning boolean false causes comment to be hidden |
protected
boolean|integer
|
#
_getDeliveryTime(
Returns calculated delivery time for the specified office If no delivery time calculation is available, then boolean FALSE is returned |
protected
boolean|string
|
#
_getDisabledComment(
Should return string text, when specified pickup-point is disabled. If specified pickup-point should not be disabled then this method returns boolean FALSE |
protected
|
|
public
string
|
#
getAdminTerminalTitle(
Determines how name of customer selected postoffice should be rendered and this is also how merchant sees the selected postoffice. |
final protected
boolean
|
|
final public
|
#
setOfficeToSession( integer $addressId,
Initially this carrier does not set up all the shipping methods for this carrier in the 'sales/quote_address_rate' database table. since storing too many methods in there is not the smartest thing to do So once the user selects the actual office, an AJAX callback is performed and this one inserts the selected office to the database and also to the session, in order the customer would easily reach latest selected offices and the order itself could be placed, since user selected postoffices have to exist in the 'sales/quote_address_rate' database table. This one results in less entries in 'sales/quote_address_rate' database table. |
final public
|
|
public
|
#
setConfigData( string $key, mixed $value )
Sets Magento store config for current carrier specified by key |
public
boolean
|
#
isAutoSendAvailable( )
Should return true, when this carrier can automatically send shipment data to third party carrier server. |
public
boolean|string
|
#
getBarcode( Mage_Sales_Model_Order $order )
Should return the actual generated barcode by the third party carrier server. Overwrite this method in the subclass. This function is available to the merchant, if he/she wants to print the packing slip in the order view. |
public
boolean
|
#
getBarcodePdf( Mage_Sales_Model_Order $order )
Should return the actual Pdf binary which should be packing slip for this order and false in every other case. This function is available to the merchant, if he/she wants to print the packing slip in the order view. |
public
boolean
|
#
isDataSent( Mage_Sales_Model_Order $order )
Returns true, if data has been sent Returns false, if data has not been sent Returns null, if data sending is not available. |
public
boolean
|
|
public
boolean|array
|
#
autoSendData( Mage_Sales_Model_Order $order, type $selectedOfficeId )
If automatic data sending is available, then this function should be overwritten and the actual data sending should be performed in here. Also Configuration value of If automatic sending is not applicable, then this function should return boolean false. If automatic data sending is successful, then the result will be added to the
order comments using |
public
Mage_Shipping_Model_Rate_Result_Error
|
#
checkAvailableShipCountries( Mage_Shipping_Model_Rate_Request $request )
Wrapper function for the parent class, simply for security and session management. For example, when user first selects country, where the carrier is available and then switches country and the carrier is not available any more, then the session has to be cleared a bit, in order to avoid the user entering arbitrary data for the previously available carrier. |
public
null|boolean
|
#
isPickedUpByCourier( Mage_Sales_Model_Order $order )
Indicates if specified order has been picked up by courier. Should return the following
|
protected
type
|
#
getAddressId( Mage_Shipping_Model_Rate_Request $request )
Gets the address_id, which will be used in the 'sales/quote_address_rate' database table, in order to handle user selection of postoffice related to this carrier. |
protected
boolean
|
#
_compareAddressToRequest( Mage_Shipping_Model_Rate_Request $request, Mage_Sales_Model_Quote_Address $address )
In multishipping scenarios shipping addresses may not be saved and thus lacking correct id. In such scenario they need to be compared manually to detect the correct chosen parcel terminal |
protected
integer
|
#
_getSeconds( array $input )
Converts array input of three elements into seconds First element in array should represent hours Second element in array should represent minutes Third element in array should represent seconds |
public
string
|
|
protected
Mage_Sales_Model_Quote_Address
|
|
protected
Mage_Catalog_Model_Product
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
|
protected
Mage_Checkout_Model_Session
|
|
protected
Mage_Sales_Model_Quote
|
protected
boolean|string
|
$_tracking_url | false |
#
Actual URL can be entered here, where %s in the url would be replaced with supplied tracking number. When tracking number is entered, then user is provided with link to track the status of package on remote server. |
protected
boolean
|
$_track_iframe | false |
#
When set to true and $_tracking_url is provided, then instead of clickable link iframe is displayed instead. |
protected
Mage_Sales_Model_Quote
|
$_quote | false |