ramin Posted August 11, 2013 Share Posted August 11, 2013 I want to move gift wrapping option in checkout steps from carrier step to cart summary. I make a form in cart summary page (shopping-cart.tpl) to send status of checked box to ordercontroler.php . <form method="post" action="{$link->getPageLink('order.php', true)}"> <input type="hidden" value="1" name="step"> <input type="hidden" name="gift" id="gift" value="1"> <input type="submit" value="next" name="submit" class="exclusive"> </form> And in ordercontroller.php in method "_assignAddress" I add code blow to get value of input: protected function _assignAddress() { parent::_assignAddress(); self::$smarty->assign('cart', self::$cart); self::$cart->gift = (int)(Tools::getValue('gift')); // I added This code } But it doesn't effect on total price in order-payment step. When I manualy assign value "1" to $cart->gift it works: self::$cart->gift = 1; Please help why the form data can't be get by getValue function. Link to comment Share on other sites More sharing options...
ramin Posted August 12, 2013 Author Share Posted August 12, 2013 Problem solved. Fot those who have this problem they should assign gift value into a cookie key. then get cookie in function _processcarrie in parentOrderController.php and assign to self::$cart->gift . Link to comment Share on other sites More sharing options...
aggelon Posted July 7, 2014 Share Posted July 7, 2014 Hi ramin, I'm very new in php and i don't know how to implement your solution. My form is OK in the .tpl, but I don't know how and where to set the cookie, and how to get the cookie value to save it in parentorderController.php... Thank you for your help Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now