I 开发者_C百科wish to use the UK Initial CityLink courier, as the shipment provider. Does anyone know anything on integrating with their systems, such as an extension or plug-in?
If not, how can we add a new carrier to the list, so we can manually add a tracking number to the order. That the customer can use - to track their order on the CityLink website.
Add a new active/inactive carrier in config
<default>
<carriers>
<your_carrier>
<active>0|1</active>
<model>your_module/your_carrier</model>
<title>Your Carrier</title>
<name>your_carrier</name>
<price>0.00</price>
</your_carrier>
</carriers>
</default>
Then in your model your_module/your_carrier which extends Mage_Shipping_Model_Carrier_Abstract, rewrite the method isTrackingAvailable to return true:
public function isTrackingAvailable()
{
return true;
}
I hope you are in for a shock - most carriers work well to get your business and have backend systems that work well. CityLink are in the era of having bespoke Visual Basic applications running on a 486 PC with a dot-matrix printer. I exaggerate but you get the idea.
We wrote our own CityLink module to work on their zone rates taking volumetric measurements into account and checking that we did not exceed the maximum dimensions.
This requires the rates to be manually entered and does not print labels or anything fancy - the customer gets an accurate quote though.
I think they have tidied up their rates to being sensible enough to use the standard table rates of Magento, you can also enter in the tracking number at delivery time when you 'create delivery'.
Your best bet would be installing Parcelhub software to integrate multiple carriers into your Magento account.
if you are going to modify function getCarriers() as suggested by Rashid, note that this function is repeated in several places:
\app\code\core\Mage\Adminhtml\Block\Sales\Order\Invoice\Create\Tracking.php
\app\code\core\Mage\Adminhtml\Block\Sales\Order\Shipment\Create\Tracking.php
\app\code\core\Mage\Adminhtml\Block\Sales\Order\Shipment\View\Tracking.php
\app\code\core\Mage\Sales\Model\Order\Shipment\Api.php
To add new carrier in the listSimply edit the tracking.php file from directory app/code/core/Mage/Adminhtml/Block/Sales/Order/Shipment/Create/
find the code
public function getCarriers()
{
$carriers = array();
$carrierInstances = Mage::getSingleton('shipping/config')->getAllCarriers(
$this->getShipment()->getStoreId()
);
$carriers['custom'] = Mage::helper('sales')->__('CustomValue');
and then make copy of the last line i.e
$carriers['custom'] = Mage::helper('sales')->__('CustomValue');
Now chage 'custom' with your 'customvalue' and 'CustomValue' with your own Custom Label e.g
$carriers['firstflight'] = Mage::helper('sales')->__('First Flight Courier');
Hope it will help you!!
精彩评论