SHARE
TWEET

Untitled

a guest Dec 12th, 2018 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <a_onestepcheckout>
  2.     <reference name="choose-shipping-method">
  3.         <action method="setTemplate">
  4.             <template>a/l/onestepcheckout/shipping_method.phtml</template>
  5.         </action>
  6.     </reference>
  7. </a_onestepcheckout>
  8.  
  9. <b_onestepcheckout>
  10.     <reference name="choose-shipping-method">
  11.         <action method="setTemplate">
  12.             <template>b/l/onestepcheckout/shipping_method.phtml</template>
  13.         </action>
  14.     </reference>
  15. </b_onestepcheckout>
  16.  
  17. // either a_onestepcheckout or b_onestepcheckout depending on condition
  18. <onestepcheckout_index_index>
  19.     <update handle="a_onestepcheckout" /> or <update handle="b_onestepcheckout" />
  20. </onestepcheckout_index_index>
  21.    
  22. public function addSomeHandle($observer) {
  23.     $action = $observer->getEvent()->getAction();
  24.     $actionName = $action->getFullActionName();
  25.     if ($actionName == 'onestepcheckout_index_index') { //if on your desired page
  26.          $layout = $observer->getEvent()->getLayout();
  27.          if (CONDITION GOES HERE) {
  28.              $layout->getUpdate()->addHandle('a_onestepcheckout');
  29.          }
  30.          else {
  31.              $layout->getUpdate()->addHandle('b_onestepcheckout');
  32.          }
  33.     }
  34. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top