Jump to content

Move gift wrapping to cart summary


ramin

Recommended Posts

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

  • 10 months later...

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...