0

I am trying to run an observer directly after the user has clicked 'submit' on the 'Billing Information' and also on "Shipping Information" on the onepage checkout in Magento.

Here is the code

<events>
<controller_action_predispatch_checkout_onepage_saveBilling>
  <observers>
      <test_orderlog_price_observer>
          <type>singleton</type>
          <class>Test_Orderlog_Model_Price_Observer</class>
          <method>afterBillingMethod</method>
      </test_orderlog_price_observer>
  </observers>
</controller_action_predispatch_checkout_onepage_saveBilling>
</events>

<events>
<controller_action_predispatch_checkout_onepage_saveShipping>
  <observers>
      <test_orderlog_price_observer>
          <type>singleton</type>
          <class>Test_Orderlog_Model_Price_Observer</class>
          <method>afterShippingMethod</method>
      </test_orderlog_price_observer>
  </observers>
</controller_action_predispatch_checkout_onepage_saveShipping>
</events>

Earlier this event was working fine,but currently it has stopped working..

but when i changed the saveBilling to savebilling and saveShipping to saveshipping,then now its working,its very Strange. Now why its working ?

Current working code..

<events>
<controller_action_predispatch_checkout_onepage_savebilling>
  <observers>
      <test_orderlog_price_observer>
          <type>singleton</type>
          <class>Test_Orderlog_Model_Price_Observer</class>
          <method>afterBillingMethod</method>
      </test_orderlog_price_observer>
  </observers>
</controller_action_predispatch_checkout_onepage_savebilling>
</events>

<events>
<controller_action_predispatch_checkout_onepage_saveshipping>
  <observers>
      <test_orderlog_price_observer>
          <type>singleton</type>
          <class>Test_Orderlog_Model_Price_Observer</class>
          <method>afterShippingMethod</method>
      </test_orderlog_price_observer>
  </observers>
</controller_action_predispatch_checkout_onepage_saveshipping>
</events>
  • Currently have you changed sever or upload you code on server now? – Kul Oct 27 '16 at 6:32
  • no,server is same..nothing changed in this module – Rahul Singh Oct 27 '16 at 6:34
2

I tried to search the same event in the magento core files,and found app/code/core/Mage/Captcha/etc/config.xml file also using the same event name with small 'b' in 'saveBilling' i.e. "controller_action_predispatch_checkout_onepage_savebilling"

SUPEE-7405-EE-1-13-0-2 has updated this core file,because of that event controller_action_predispatch_checkout_onepage_saveBilling not fired

<events>
<controller_action_predispatch_checkout_onepage_savebilling>
  <observers>
      <test_orderlog_price_observer>
          <type>singleton</type>
          <class>Test_Orderlog_Model_Price_Observer</class>
          <method>afterBillingMethod</method>
      </test_orderlog_price_observer>
  </observers>
</controller_action_predispatch_checkout_onepage_savebilling>
</events>

<events>
<controller_action_predispatch_checkout_onepage_saveshipping>
  <observers>
      <test_orderlog_price_observer>
          <type>singleton</type>
          <class>Test_Orderlog_Model_Price_Observer</class>
          <method>afterShippingMethod</method>
      </test_orderlog_price_observer>
  </observers>
</controller_action_predispatch_checkout_onepage_saveshipping>
</events>

now its working..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.