I am completely new to Magento and we are using version 1.4 currently. The steps on the OnePage checkout are:
- Checkout Method (Guest or sign-in)
- Billing Information
- Shipping Information
- Delivery Information
- Payment Information
- Order Review
I want to skip Delivery Information. To do this I have done two things:
1. Changed (actually extended) the core Checkout class to not include #4 Delivery Information ('shipping_information'),
2. in the Controller, call the Checkout class method saveShippingMethodAction( ) inside of saveShippingAction( ) (since there is never a submission of shipping method by user), with a data value passed manually.
Everything works as expected, and the step is skipped, however inside Checkout::saveShippingMethodAction( ) there are these two lines:
Mage::dispatchEvent('checkout_controller_onepage_save_shipping_method', array('request'=>$this->getRequest(), 'quote'=>$this->getOnepage()->getQuote()));
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
The problem is in the usage of 'request'=>$this->getRequest(). The actual request is not shipping_method but rather shipping, so the output (i.e. the HTML form string that should be passed to step #5, Payment information) is not loaded, and so step #5 is blank.
My first instict is how can I simulate a request, but there is probably a "Magento Way" to do this. Can anyone tell me what that might be, or how I can prep getRequest( ) and maybe getResponse( ) as if I'd submitted that specific form? Thanks!