Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / Weight not being calculated properly for freeshippng items going overseas

Weight not being calculated properly for freeshippng items going overseas

Locked

Views: 2,717

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
24 Oct 2006, 12:07 PM
#1
firehorse avatar

firehorse

Zen Follower

Join Date:
Oct 2004
Posts:
98
Plugin Contributions:
0

Weight not being calculated properly for freeshippng items going overseas

Hi,

This is a continuation from here http://www.zen-cart.com/forum/showpost.php?p=281250&postcount=143

I'm based in the UK
I want to give free shipping to items going to the UK
I want to charge postage to items going overseas.
I've installed the UKtemplates and big_royalmail_v2.0-beta-2

When the item is set to no free shipping, the weight calculates properly. 0.4kg with the correct postage.

I set item to be freeshipping all the time. Weight 0.4kg. Within the UK the weight is 0kg. Fine.
I set the freeshipper module zone to UK (I've tried both UKVAT and UKZR: Zone 1 Mainland UK)
When I try to deliver to the US the other correct postage options available but the weight of the item is 0kg so the cost is wrong.

Have I setup things wrongly or is there a 'bug' in the freeshipper module in not considering the zone UK?
Do I need to use the special/combination shipping option to get this to work?

Thanks
Alan

27 Oct 2006, 12:30 AM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Weight not being calculated properly for freeshippng items going overseas

If you look at the /includes/modules/shipping/item.php and look for the usage of:

$_SESSION['cart']->free_shipping_items()

You will see how that adjusts the item count ...

Note: for price adjustment this is done with:

$_SESSION['cart']->free_shipping_prices()

Note: weight is adjust automatically when calculated

WARNING: Shipping Modules that do not come with the current Zen Cart may or may not be up to date on the proper methods of calculating: price, item and weight

27 Oct 2006, 3:29 PM
#3
firehorse avatar

firehorse

Zen Follower

Join Date:
Oct 2004
Posts:
98
Plugin Contributions:
0

Re: Weight not being calculated properly for freeshippng items going overseas

Hi,> Ajeh:

WARNING: Shipping Modules that do not come with the current Zen Cart may or may not be up to date on the proper methods of calculating: price, item and weightI tried using "Per Unit" shipping module.

If the item is not free shipping, the correct weight comes up.

If the item is free shipping, and the zone is correct then the free shipping option appears.

If the item is free shipping, but delivery address is not correct then

  1. the free shipping does not appear
  2. BUT neither does the "Per Unit" shipping!
  3. The weight is also set to 0 kg.

This is using zencart modules which should be calculating the weight correctly for an invalid free shipping zone, but it is not.

Alan

27 Oct 2006, 3:39 PM
#4
firehorse avatar

firehorse

Zen Follower

Join Date:
Oct 2004
Posts:
98
Plugin Contributions:
0

Re: Weight not being calculated properly for freeshippng items going overseas

Replace
"If the item is free shipping, but delivery address is not correct then"
with
"If the item is free shipping, but the delivery address is in an invalid free shipping zone then "

27 Oct 2006, 3:57 PM
#5
firehorse avatar

firehorse

Zen Follower

Join Date:
Oct 2004
Posts:
98
Plugin Contributions:
0

Re: Weight not being calculated properly for freeshippng items going overseas

Hi Ajeh,

Thanks for the pointer, I followed

$_SESSION['cart']->free_shipping_items()

"free_shipping_items()" is in /includes/classes/shoppingcart.php

function free_shipping_items() {
    $this->calculate();
    return $this->free_shipping_item;
  }

So I tracked down calculate and found this piece of code inside

        // 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'])))) {
          $this->free_shipping_item += $qty;
          $this->free_shipping_price += zen_add_tax($products_price, $products_tax) * $qty;
          $this->free_shipping_weight += ($qty * $products_weight);
        }
```I think this bit

"($product->fields['product_is_always_free_shipping'] == 1)"

needs to be changed to 

"($product->fields['product_is_always_free_shipping'] == 1 AND (check it is in valid free shipping zone or the free shipping zone is 'none') )"

Does this qualify as a bug :P  or is there another way to configure zencart to do this?

Thanks
Alan
28 Oct 2006, 2:58 AM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Weight not being calculated properly for freeshippng items going overseas

All the little quirks as far as I know are fixed and in v1.3.6 ...

I may even have had all the free_somethings fixed in v1.3.5 ... but I am tired and have not looked to see which version got them all ...

There are more features on shipping modules fixed in v1.3.6 that were quirks more or less but a bother when they happened ...

And upgrade is always a good idea ... :smile:

28 Oct 2006, 9:52 AM
#7
firehorse avatar

firehorse

Zen Follower

Join Date:
Oct 2004
Posts:
98
Plugin Contributions:
0

Re: Weight not being calculated properly for freeshippng items going overseas

Hi,> Ajeh:

And upgrade is always a good idea ... :smile:Thanks for all your hard work. :thumbsup: I've upgraded to 1.3.6 but the error is still there. :(

/includes/classes/shoppingcart.php

Line 655

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

I believe the part

"($product->fields['product_is_always_free_shipping'] == 1)"

should be changed to

"($product->fields['product_is_always_free_shipping'] == 1 AND (check it is in valid free shipping zone or the free shipping zone is 'none') )"

Many thanks
Alan

28 Oct 2006, 4:10 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: Weight not being calculated properly for freeshippng items going overseas

There isn't a relationship to the free_shipping_something functions and zones ...

If you mark something Always Free Shipping or 0 weight and 0 weight is Free Shipping then those products are Free Shipping regardless of Zone ...

28 Oct 2006, 4:44 PM
#9
firehorse avatar

firehorse

Zen Follower

Join Date:
Oct 2004
Posts:
98
Plugin Contributions:
0

Re: Weight not being calculated properly for freeshippng items going overseas

Thanks for the reply

Alan