Page 1 of 1

Show 'Free shipping' option when using coupon in checkout

Posted: Sat Apr 13, 2013 10:33 pm
by JedAronson
This is a pretty tiny bug, but it took me a while to find it, so I thought I'd share in case anyone else ran into this.

When you make a coupon for your site, you have the option of it including free shipping. However, during the checkout process, if the order total is less than what is normally required to qualify for free shipping, "free shipping" is not presented as an option under "shipping method". In the end (the "confirm" part), the customer does see that yes, they have been given free shipping, but it's a little confusing, and it turns out it's an easy fix.

in catalog->model->shipping->free.php, at line 16 it says:

Code: Select all

if ($this->cart->getSubTotal() < $this->config->get('free_total')) {
			$status = false;
		}
change the if statement to:

Code: Select all

if (($this->cart->getSubTotal() < $this->config->get('free_total')) && !(isset($this->session->data['coupon']) && $this->session->data['coupon']['shipping']))
Here is the vqmod operation I used:

Code: Select all

<file name="catalog/model/shipping/free.php">
        <operation>
    		<search position="replace"><![CDATA[$this->cart->getSubTotal() < $this->config->get('free_total')]]></search>
    		<add><![CDATA[($this->cart->getSubTotal() < $this->config->get('free_total')) && !(isset($this->session->data['coupon']) && $this->session->data['coupon']['shipping'])]]></add>
		</operation>    		
    </file> 

Re: Show 'Free shipping' option when using coupon in checkou

Posted: Tue Oct 29, 2013 1:28 am
by Designheroes
Hallo

Great with small bug - but one quick question where and how do you place the vqmod code ?
because I have the exact problem with free shipping and coupon

Cheers Morten

Re: Show 'Free shipping' option when using coupon in checkou

Posted: Mon Jan 27, 2014 6:42 pm
by cytutchi
This change doesn't seem to work properly.

I followed the instructions and edited: catalog->model->shipping->free.php appropriately

and now for any item it gives the option of free shipping before i even use a voucher code for free shipping, or even if it is bellow the limit i have set for free shipping eligibility.

Anyone else any clue?!

Re: Show 'Free shipping' option when using coupon in checkou

Posted: Thu Jan 30, 2014 2:47 am
by Renato56
tested on 1.5.6.1 and got some problems.
This is the fixed version:

<modification>
<id>Fix coupon free shipping</id>
<version>1.0.0</version>
<vqmver>2.1.5</vqmver>
<author>JedAronson & Amber.it</author>

<file name="catalog/model/shipping/free.php">
<operation>
<search position="replace"><![CDATA[
$this->cart->getSubTotal() < $this->config->get('free_total')
]]></search>
<add><![CDATA[
$this->cart->getSubTotal() < $this->config->get('free_total') && !(isset($this->session->data['coupon']) && $this->session->data['coupon_shipping'])
]]></add>
</operation>
</file>

<file name="catalog/controller/checkout/cart.php">
<operation>
<search position="after" index="1"><![CDATA[
if (!$this->error) {
]]></search>
<add><![CDATA[
$this->session->data['coupon_shipping'] = $coupon_info['shipping'];
]]></add>
</operation>
</file>
</modification>

Re: Show 'Free shipping' option when using coupon in checkou

Posted: Sat Oct 18, 2014 2:51 pm
by SushiCat
Hey guys,

I'm a bit new so I apologize in advance. I tried the fixed version posed by Renato56 but when I go to check out I'm getting an error message citing an unexpected variable in the free.php file.

This is what mine looks like now after making the changes..


$this->cart->getSubTotal() < $this->config->get('free_total') && !(isset($this->session->data['coupon']) &&
$this->session->data['coupon_shipping'])
$status = false;

Did I make a mistake?

Re: Show 'Free shipping' option when using coupon in checkou

Posted: Thu Nov 06, 2014 2:36 am
by nyunyu
Thanks, worked on 1.5.6.

***DO NOT edit the free.php file directly, just upload the vqmod xml file and that should do it.

Code: Select all

<modification>
	<id>Free Shipping in Checkout</id>
	<version>1.5.6</version>
	<vqmver>2.2.2</vqmver>
	<author>JedAronson</author>
	<!-- Additional languages -->​​
<file name="catalog/model/shipping/free.php">
        <operation>
          <search position="replace"><![CDATA[$this->cart->getSubTotal() < $this->config->get('free_total')]]></search>
          <add><![CDATA[($this->cart->getSubTotal() < $this->config->get('free_total')) && !(isset($this->session->data['coupon']) && $this->session->data['coupon']['shipping'])]]></add>
      </operation>          
    </file> 
</modification>

Re: Show 'Free shipping' option when using coupon in checkou

Posted: Tue Jul 14, 2015 3:54 pm
by brianrudie
This worked but when I check out it is still asking to go to paypal and charging the original ammount?