Jump to content

4 Step Checkout, No Shipping but with Gift wrap option


Haegendoorn

Recommended Posts

I have a small webshop which offers free shipping, with one carrier available. I though it would be nice to clean up the checkout process from five steps to four steps (1. Summary, 2. Login, 3.Address, 4.Payment) I managed to get to this part by modifying the OrderController.php and some other files. (I'll post the complete code/change when this is issue is fixed)
 
I would like to have a gift wrap option, plus personalized message option on the first step (Summary).

I added this to the shopping-cart.tpl:

<h2 class="gift_title" style="color: #9B4C3B;">{l s='Gift'}</h2>
	<p class="checkbox" style="padding-bottom: 0px;">
		<input type="checkbox" name="gift" id="gift" value="1" {if $cart->gift == 1}checked="checked"{/if} autocomplete="off"/>
		<label for="gift">Gift wrap my order...</label>
		<br />
		     
		{if $gift_wrapping_price > 0}
			({l s='Additional cost of'}
			<span class="price" id="gift-price">
				{if $priceDisplay == 1}{convertPrice price=$total_wrapping_tax_exc_cost}{else}{convertPrice price=$total_wrapping_cost}{/if}
			</span>
			{if $use_taxes}{if $priceDisplay == 1} {l s='(tax excl.)'}{else} {l s='(tax incl.)'}{/if}{/if})
		{/if}
	</p>
	<p id="gift_div" class="textarea">
		<label for="gift_message">{l s='If you\'d like, you can add a note to the gift:'}</label>
		<textarea rows="5" cols="35" id="gift_message" name="gift_message">{$cart->gift_message|escape:'htmlall':'UTF-8'}</textarea>
	</p>

and a little bit of JS to add to the link of the next button the &gift=1&gift_msg=

 

After this step, the Next button on Address is a Post submit, so I used hidden inputs for the two variables (gift & gift_msg). I have added two variables to my order-payment.tpl to check whether the 2 vars got to this part, and they show as expected.

 

I added the 2 vars to the cart object like this: [inside _assignPayment of OrderController.php]

if ($_POST["gift"] == "1") 
				$this->context->cart->gift = 1;
$this->context->cart->gift_message = strip_tags($_POST['gift_msg']);

The problem arises when I select the bankwire payment option. I can place the order, it appears inside the backoffice, but the gift wrap option and the gift message option are always the default no.

 

Any help is greatly appreciated,

I 'll post the complete code in a tutorial once this is solved,

 

Alex

 

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...