Zen Cart Logo

Always Free Shipping

Locked

Views: 2,301

Results 1 to 15 of 15
This thread is locked. New replies are disabled.
6 Jan 2009, 4:29 PM
#1
yd29999 avatar

yd29999

Zen Follower

Join Date:
Jan 2006
Posts:
120
Plugin Contributions:
0

Always Free Shipping

Hello,
I'm using 1.3.8a. Is there a way to make the "Always Free Shipping" option restricted to USA addresses only?

6 Jan 2009, 4:54 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Always Free Shipping

You would need to do quite a bit of customizing and testing as this is not how this feature was designed ...

The good news is ... anything can be customized ... have you got your coding hat on? :smartalec:

7 Jan 2009, 2:25 PM
#3
yd29999 avatar

yd29999

Zen Follower

Join Date:
Jan 2006
Posts:
120
Plugin Contributions:
0

Re: Always Free Shipping

OR you can change the zone to the United States.

7 Jan 2009, 3:01 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Always Free Shipping

No, that too is managed by Always Free Shipping being for everyone and other shipping modules do not show when displayed ...

The Zone information is in there for advance coders who know how to utilize alternative coding methods for easier placement in the code to follow the standard pattern of the shipping modules ...

7 Jan 2009, 3:10 PM
#5
yd29999 avatar

yd29999

Zen Follower

Join Date:
Jan 2006
Posts:
120
Plugin Contributions:
0

Re: Always Free Shipping

The question was

"Is there a way to make the "Always Free Shipping" option restricted to USA addresses only?"

7 Jan 2009, 3:19 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Always Free Shipping

And the answer was ... No, not by default ...

You would need to do quite a bit of customizing and testing as this is not how this feature was designed ...

Always Free Shipping YES is designed to reduce the Item Count, Shipping Weight and Total Price for all shipping calculations ... and it is designed to only allow Free Shipping freeshipper shipping module to run when all Products compute to 0 on these calculation ...

You would need to reverse everything related to this so that it is not done that way ... and only do that when the address is not the US ...

8 Jan 2009, 12:06 AM
#7
bobdog avatar

bobdog

Totally Zenned

Join Date:
Mar 2006
Location:
Fresno, California
Posts:
590
Plugin Contributions:
0

Re: Always Free Shipping

Well, perhaps you are not asking the right question.

It looks like you want free shipping in the USA, all other countries are charged shipping.

http://www.zen-cart.com/forum/showthread.php?t=114396

I think it gets easier in 1.3.8 the instructions in my link are old. Set up zones in shipping. One zone is US, the other zone is defined as 00 (zero zero) it includes all other countries except US and give it a value $

** be sure to set all products as "normal shipping rules" ** not free shipping to all.

8 Jan 2009, 2:08 AM
#8
yd29999 avatar

yd29999

Zen Follower

Join Date:
Jan 2006
Posts:
120
Plugin Contributions:
0

Re: Always Free Shipping

I'm sorry, but I thought "USA addresses only" was rather clear.
Anyways that was before. Unfortunately, that seems to be the only way to get the "Free Shipping" gif to appear in the product listings and product info pages.

So, now I must decide, stay with the always free shipping with a statement "Not for International Customers" and have a second item, priced a bit lower, because the shipping won't be included and let the free shipping option controll that one.

The Free Shipping option seems to work well once the "or" was changed to "and". Tomorrow I'll see about adding a free shipping gift.

BTW zone rate won't work for me because of the range of prices and weights.

8 Jan 2009, 5:05 AM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Always Free Shipping

You could also customize the code to test for the shipping address to determine it is the US or not and alter the way the field:
product_is_always_free_shipping

is used in the shopping_cart class ...

This would change the product_is_always_free_shipping from being applied to everyone to only being applied when the shipping address is from the US ...

Yes, it would take some work to do this ... but then you would have this working the way you want it to ... :cool:

You could also add a condition to the display of the Free Shipping icon based on product_is_always_free_shipping or ... just change the Free Shipping icon to look like a cute little american flag with Free Shipping ... or base that on displaying for logged in customers ... or make folks login to shop ...

Note: be sure you keep in mind that the goal is the Shipping Address, and not just the Customer Address ...

Grandma might like in the UK for her customer and billing address, but be shipping little Tiny Tim his Christmas presents in New York ... :smile:

20 Jan 2009, 12:23 AM
#10
arthurdent avatar

arthurdent

New Zenner

Join Date:
Nov 2005
Posts:
38
Plugin Contributions:
0

Re: Always Free Shipping

Hi Linda,

Just read this thread after trying to give free delivery to the UK only for certain products, but still charge to other Zones using the usual Zone rates.

I don't really have the expertise to start hacking around with classes. Don't suppose there's any chance this could be added to v2.0? I'd buy you a coffee... :)

Thanks

20 Jan 2009, 5:02 AM
#11
arthurdent avatar

arthurdent

New Zenner

Join Date:
Nov 2005
Posts:
38
Plugin Contributions:
0

Re: Always Free Shipping

Also, I've just noticed something when FREE SHIPPING is limited to a particular Zone.

If a customer with a delivery address in a different Zone (i.e. not entitled to Free Shipping) has a Free Shipping product in their cart, they get the TITLE / TEXT_NO_SHIPPING_AVAILABLE message - so I can at least tell them they have to contact the store to buy the item.

However if they also have a non-free shipping product in their basket, the free shipping bar on their Zone is ignored, and the the Zone Rate amount for the second product only is displayed / charged. So they'd be ordering 2 items, but paying shipping for only one of them.

Am I missing something, or is it a wee bug? I'm on v1.3.7.

20 Jan 2009, 3:40 PM
#12
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Always Free Shipping

Free Shipping freeshipper is not really designed for Zones ...
as a matter of fact, as is, it will not work ...

The Zone code is in the module for coders who might need it for customization purposes ...

On trying to make products Free Shipping for a particular Zone or Zones, you would need to really customize the code to manage this ...

Always Free Shipping is for Free Shipping for everyone ... and cannot, at this time, be used for a given Zone ...

27 Jan 2009, 12:45 AM
#13
mickyelta avatar

mickyelta

New Zenner

Join Date:
Nov 2006
Posts:
67
Plugin Contributions:
0

Re: Always Free Shipping

I too was confronted by this very same issue, so put my coding hat on and heres what i came up with. My example applies to Australia but seems to work for any country it will make products marked free shipping only available to the country the store is in and use any of the other shipping mods if being shipped out of the country of origin.

Step 1
if you haven't already created a zone for you country do it now
eg create zone australia with all states included.

Step 2
in admin goto modules>shipping>freeshipper and set the zone to the zone you have just created.

now if you place an order to an overseas address with all freeshipping items in cart you should get a message that you are current not shipping to this region and locally freeshipping should show (this is good this shows you have zones set correctly.

Step 3
the file editing
edit /includes/classes/shopping_cart.php

find on around line 591

function calculate() { 
    global $db;

add $order to the globals eg

function calculate() { 
    global $db, $order;

around line 619 find

// adjusted count for free shipping 
        if ($product->fields['product_is_always_free_shipping'] != 1 and $product->fields['products_virtual'] != 1) { 
          $products_weight = $product->fields['products_weight']; 
        }else{
    $product_weight=0;
    }

directly after this add

if ($product->fields['product_is_always_free_shipping'] = 1 && $order->delivery['country']['id']!= STORE_COUNTRY) { 
         $products_weight = $product->fields['products_weight'];
}

around line 658 find

// shipping adjustments 
        if (($product->fields['product_is_always_free_shipping'] == 1) or ($product->fields['products_virtual'] == 1) or (ereg('^GIFT', addslashes($product->fields['products_model'])))) {

replace it with

if (($product->fields['product_is_always_free_shipping'] == 1 && $order->delivery['country']['id']== STORE_COUNTRY) or ($product->fields['products_virtual'] == 1) or (ereg('^GIFT', addslashes($product->fields['products_model'])))) {

on line 1031 find

 if ($product->fields['product_is_always_free_shipping'] != 1) { 
          $new_attributes_weight = $attribute_weight_info->fields['products_attributes_weight']; 
        } else { 
          $new_attributes_weight = 0; 
        }

directly after it add

if ($product->fields['product_is_always_free_shipping'] = 1 && $order->delivery['country']['id']!= STORE_COUNTRY) { 
         $new_attributes_weight = $attribute_weight_info->fields['products_attributes_weight'];
}

save file

now edit /includes/functions/functions_general.php
find around line 1203

// Always free shipping only true - disable everyone 
      case (($check_cart_free == $check_cart_cnt) and $shipping_module != 'freeshipper'): 
        return false; 
        break;

replace it with

// Always free shipping only true - disable everyone 
      case (($check_cart_free == $check_cart_cnt && $order->delivery['country']['id']== STORE_COUNTRY)  and $shipping_module != 'freeshipper'):
    return false; 
        break;

save file and it sould work.
the last but not least thing to change is the free shipping icon
/includes/templates/template_default/images/always-free-shipping.gif make a new one to reflect where you are offering free shipping eg free shipping australia only.
As always no guarantees test test test then retest in your own enviroment. if anyone has anything to add or finds bugs in the system please let me know

4 Aug 2009, 8:18 PM
#14
cheezey avatar

cheezey

New Zenner

Join Date:
Apr 2009
Posts:
3
Plugin Contributions:
0

Re: Always Free Shipping

Mickyelta:

I too was confronted by this very same issue, so put my coding hat on and heres what i came up with.

Thanks for this :smile:

I've just implemented what you've done for a site and so far all seems to be working very nicely.

30 Sep 2009, 9:56 PM
#15
numinix avatar

numinix

Totally Zenned

Join Date:
Apr 2007
Location:
Vancouver, Canada
Posts:
1,566
Plugin Contributions:
58

Re: Always Free Shipping

A simpler way to have shipping modules display with freeshipper is to change the following lines in functions_general.php:

Find:

case (ORDER_WEIGHT_ZERO_STATUS == '1' and ($check_cart_weight == 0 and $shipping_module != 'freeshipper')):
        return false;
```Replace with:
```php
case (ORDER_WEIGHT_ZERO_STATUS == '1' and ($check_cart_weight == 0 and $shipping_module != 'freeshipper')):
        return true;
```Find:
```php
case (($_SESSION['cart']->free_shipping_items() == $check_cart_cnt) and $shipping_module != 'freeshipper'):
        return false;
```Replace with:
```php
case (($_SESSION['cart']->free_shipping_items() == $check_cart_cnt) and $shipping_module != 'freeshipper'):
        return true;
```Find:
```php
case (($check_cart_free == $check_cart_cnt) and $shipping_module != 'freeshipper'):
        return false;
```Replace with:
```php
case (($check_cart_free == $check_cart_cnt) and $shipping_module != 'freeshipper'):
        return true;