Post by JedAronson » Sat Apr 13, 2013 10:33 pm

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> 

Newbie

Posts

Joined
Thu Feb 21, 2013 10:23 am

Post by Designheroes » Tue Oct 29, 2013 1:28 am

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

Newbie

Posts

Joined
Fri May 25, 2012 6:40 am

Post by cytutchi » Mon Jan 27, 2014 6:42 pm

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?!

Newbie

Posts

Joined
Tue Jan 14, 2014 7:54 pm

Post by Renato56 » Thu Jan 30, 2014 2:47 am

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>

Newbie

Posts

Joined
Thu Jan 30, 2014 2:42 am

Post by SushiCat » Sat Oct 18, 2014 2:51 pm

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?

Newbie

Posts

Joined
Thu Aug 28, 2014 9:06 am

Post by nyunyu » Thu Nov 06, 2014 2:36 am

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>

Attachments

upload this xml into vqmod/xml folder.


Newbie

Posts

Joined
Sat Oct 25, 2014 2:39 am

Post by brianrudie » Tue Jul 14, 2015 3:54 pm

This worked but when I check out it is still asking to go to paypal and charging the original ammount?

Newbie

Posts

Joined
Tue Feb 25, 2014 8:16 am
Who is online

Users browsing this forum: No registered users and 2 guests