Question

I have a custom shipping carrier that allows customers to specify a delivery date. Its config.xml defines method name as

<default>
        <carriers>
          <deliverybydate>
               <active>0</active>
               <model>deliverybydate/carrier_deliverybydate</model>
               <title>Delivery date of your choice</title>
               <name>Delivery By Date</name>
               <deliveridatenote>Delivery on date of your choice</deliveridatenote>
               <deliverydate>1</deliverydate>
               <deliverytime>0</deliverytime>
               <deliverydatetoday>0</deliverydatetoday>
               <deliverydaterange>7</deliverydaterange>
               <deliverytimerange>08.00-09.00 AM,</deliverytimerange>
               <price>10.00</price>
               <specificerrmsg>This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.</specificerrmsg>
            </deliverybydate>
         </carriers>
    </default>

How can we change the <name>Delivery By Date</name> dynamically. I searched for a while, but didnt got any solution.

Was it helpful?

Solution

The codes you have posted is from config.xml there should be a system.xml which will help you create a configuration for the admin to change the data. Please see This Wiki Page for that.

If the shipping module is working then you need to change the title of the shipping method by taking the configuration value as done Same page just scroll up.

The both links I've suggested is for developing a custom shipping method, I think that page should be very helpful for you.

OTHER TIPS

You can dynamically change the method title in your custom shipping carrier's collectRates() function. When looping through available shipping methods, this code is used:

$method = Mage::getModel('shipping/rate_result_method');
...
$method->setMethodTitle('Custom title here');

An example of this is on line 121 of Mage_Shipping_Model_Carrier_Tablerate

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top