I’m writing a new shipping method for a customer; I’ve got the shipping calculations going great, and they appear in the ‘shipping method’ step – however, I want to:
a) Force the ‘Shipping Information’ tab to open after the user hits the billing.save() triggered by the continue button in the first (billing) tab, even if they select ship to billing address; and
b) Add options for ‘receipted delivery’, ‘transport assurance’ and ‘tail-truck pickup’ in the shipping information tab – which will be taken in to account when re-calculating the shipping quote.
In part b) I assume I override the shipping.phtml template with an xml config file in /layout, and then look for those added post fields in the collectRates() method.
Thanks in advance!
As for part a) you will need to overwrite the controller
Mage_Checkout_OnepageController. To do so create your own module (I assume you know how to do this) and in the app/code/local/YourModule/etc/config.xml you should have this part:then in app/code/local/YourModule/controllers/OnepageController.php you want to overwrite the behavior, so when you click the save billing button, you will always land on the shipping page.
Then for part b) you have two options. Either as you pointed out you use the XML layout system to set a different template for the shipping.phtml:
or even easier, you overwritte the shipping.phtml template using your custom design folder.
To evaluate your custom data, the model
Mage_Checkout_Model_Type_Onepageprocesses the data in thesaveShipping()method, so I guess this would be a good point to look for implementing your custom logic.