Magento OnePage modification, need to skip a step -


i new magento , using version 1.4 currently. steps on onepage checkout are:

  • checkout method (guest or sign-in)
  • billing information
  • shipping information
  • delivery information
  • payment information
  • order review

i want skip delivery information. have done 2 things: 1. changed (actually extended) core checkout class not include #4 delivery information ('shipping_information'), 2. in controller, call checkout class method saveshippingmethodaction( ) inside of saveshippingaction( ) (since there never submission of shipping method user), data value passed manually.

everything works expected, , step skipped, inside checkout::saveshippingmethodaction( ) there these 2 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 in usage of 'request'=>$this->getrequest(). actual request not shipping_method rather shipping, output (i.e. html form string should passed step #5, payment information) not loaded, , step #5 blank.

my first instict how can simulate request, there "magento way" this. can tell me might be, or how can prep getrequest( ) , maybe getresponse( ) if i'd submitted specific form? thanks!

i understood want didn't understood did.

ok, explain here.if talking magento default onepage checkout thing talking delivery information shipping method.

you asking

mage::dispatchevent('checkout_controller_onepage_save_shipping_method', array('request'=>$this->getrequest(), 'quote'=>$this->getonepage()->getquote())); $this->getresponse()->setbody(mage::helper('core')->jsonencode($result)); 

it don't have code because place insert event, hook.

now real problem , solution.i haven't tried yet should work.

if see

app/code/core/mage/checkout/controllers/onepagecontroller.php

file.you need make changes in file. first override controller own module, preferred way can test in core files too.

now in file see 2 function

public function saveshippingaction()     { //this function saves shipping information of customer     } 

and

public function saveshippingmethodaction()     { //this function saves shipping method      } 

in first function see code this

if (!isset($result['error'])) {                 $result['goto_section'] = 'shipping_method';                 $result['update_section'] = array(                     'name' => 'shipping-method',                     'html' => $this->_getshippingmethodshtml()                 );             } 

this redirects shipping method.if want pass shipping method steps(in case delivery information) replace above code

    if (!isset($result['error'])) {  $result['goto_section'] = 'payment';                 $result['update_section'] = array(                     'name' => 'payment-method',                     'html' => $this->_getpaymentmethodshtml()                 ); } 

this complete redirection part controller side remove block displays shipping method block layout file. , that's it.

hope helps.


Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -