Zen Cart Logo
Forums / Addon Shipping Modules / Carrier delivery mod?

Carrier delivery mod?

Locked

Views: 2,183

Results 1 to 12 of 12
This thread is locked. New replies are disabled.
9 Mar 2009, 11:27 AM
#1
skyraven avatar

skyraven

New Zenner

Join Date:
Jan 2009
Location:
VIC, Australia
Posts:
4
Plugin Contributions:
0

Carrier delivery mod?

Hi,

I have successfully added the Australia Post module to my checkout.

But some of my items are 2 large for post and require a carrier delivery.

Is there way to add carrier on checkout say if the total weight was over 10kg's. i am new to zen cart, still unsure what to do..
:huh:
i need to be able to set pricing which relies on weight of product.

My website is http://www.skyraven.com.au/

Cheers

9 Mar 2009, 12:31 PM
#2
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Carrier delivery mod?

This sounds like a good candidate for table rate, or (better still) zonetables shipping module.

  1. For the shipping module that you are currently using, you will need to add a small PHP edit to the module's code. This PHP edit basically tells the module that if the total weight of the consignment exceeds a certain value (in your case, 10kg), then the module is rendered "inactive".

  2. Related to 1 above, is the simple fact that if a consignment DOES exceed 10kg, then ANOTHER shipping option (eg: zonetables module) must be presented to the customer. In the case of THIS module, the PHP edit you will do does the "opposite" of what happens in "1" above... In other words, the PHP edit tells the module to become active ONLY WHEN the consignment weight EXCEEDS 10kg. All the while the customer's total cart weight is less than 10kg, this module is "inactive".

Having these TWO shipping modules thus gives you the option to configure each shipping option differently.

I'll need to look at the Auspost code to advise further, but hang in there... I'll be back!

9 Mar 2009, 12:52 PM
#3
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Carrier delivery mod?

Just had a look at Auspost mod...

I notice that Auspost will take parcels up to 20kg... why is 10kg your limit?

10 Mar 2009, 11:43 AM
#4
skyraven avatar

skyraven

New Zenner

Join Date:
Jan 2009
Location:
VIC, Australia
Posts:
4
Plugin Contributions:
0

Re: Carrier delivery mod?

10kg was just a number i choose, it will be 20kg, i would like to use this mod when AUSTPOST is unable to send.

Cheers:smile:
https://www.skyraven.com.au

10 Mar 2009, 1:01 PM
#5
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Carrier delivery mod?

What CURRENTLY happens with Auspost Module when a shopper's cart exceeds 20kg?

10 Mar 2009, 1:32 PM
#6
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Carrier delivery mod?

OK, I see what happened... I filled a cart on your site then clicked shipping estimator.

You can try this:

(Backup all files relating to Auspost first).

  1. Get the **zonetables module **in the Free Software Addons.

  2. Unzip it on your local drive.

  3. Open the following file in that module for editing in a PLAIN TEXT EDITOR (or PHP editor): includes/modules/shipping/zonetable.php

Find this code (around line 74)

    // disable only when entire cart is free shipping
    if (zen_get_shipping_enabled($this->code)) {
      $this->enabled = ((MODULE_SHIPPING_ZONETABLE_STATUS == 'True') ? true : false);
    }

DIRECTLY BENEATH IT, add the following:

// Check for Weight and display module if weight exceeds stated value
if (IS_ADMIN_FLAG == false && $_SESSION['cart']->show_weight() < 20) {
  $this->enabled = false;
} else {
  $this->enabled = true;
}

So it now looks like:

    // disable only when entire cart is free shipping
    if (zen_get_shipping_enabled($this->code)) {
      $this->enabled = ((MODULE_SHIPPING_ZONETABLE_STATUS == 'True') ? true : false);
    }

// Check for Weight and display module if weight exceeds stated value
if (IS_ADMIN_FLAG == false && $_SESSION['cart']->show_weight() < 20) {
  $this->enabled = false;
} else {
  $this->enabled = true;
}

What this is saying is that if the cart weight value is LESS THAN (<) 20, then DO NOT enable the module.

*You can see the conditional being applied to the value of 20 by this line:- *if (IS_ADMIN_FLAG == false && $_SESSION['cart']->show_weight() < 20) {

Now, this 20 value assumes your selected UNIT of weight in your store is KG. If it is GRAMS, then the value will be 20000. Apply the necessary value as per your store's weight unit.

  1. SAVE the file on your local machine.

  2. Check and edit the associated LANGUAGE files of both Auspost and Zonetables modules to display appropriate module labelling and messaging to your customers.

  3. FTP the fully edited zonetables module to the appropriate locations on your server.

  4. In your admin panel, ENABLE and CONFIGURE the zonetables module to suit your shipping zone and pricing policies.

  5. TEST various order combinations (weights and regions), and adjust your language labels and messages accordingly, so that when Auspost "Over 20kg" message appears, customers are told to either contact you (Auspost default), or select the other module if they want to.

11 Mar 2009, 3:04 AM
#7
skyraven avatar

skyraven

New Zenner

Join Date:
Jan 2009
Location:
VIC, Australia
Posts:
4
Plugin Contributions:
0

Re: Carrier delivery mod?

With the AustPost mod, it will not allow checkout, i have now edited the Free shipping mod to display a message to contact site to arrange postage.

Brodie:smile:
https://www.skyraven.com.au

11 Mar 2009, 6:19 PM
#8
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Carrier delivery mod?

OK... but why not try what I suggest?

In that way, Auspost wont be presented as an option, but if the weight exceeds 20kg then zonetables will.

Either way, your shopper will be given an option:
*
Sorry, Auspost is unavailable to you because your cart weight exceeds 20kg, so you can:

  1. Either contact us to discuss, or
  2. Select the shipping option below...*

... and by selecting an alternative - (priced appropriately by you) - checkout can then proceed.

1 Jun 2009, 2:34 AM
#9
vandiermen avatar

vandiermen

Totally Zenned

Join Date:
Feb 2007
Posts:
518
Plugin Contributions:
1

Re: Carrier delivery mod?

I have the same problem with aust post module, it wont do orders over 20KG's

I tried the zonetables module and edited it before I installed it but got the error

Warning: constant(): Couldn't find constant MODULE_SHIPPING_ZONETABLE_ZONE_1 in /home/content/v/a/n/vandiermen2/html/geewiztoys.com.au/includes/modules/shipping/zonetable.php on line 91

Warning: Cannot modify header information - headers already sent by (output started at /home/content/v/a/n/vandiermen2/html/geewiztoys.com.au/includes/modules/shipping/zonetable.php:91) in /home/content/v/a/n/vandiermen2/html/geewiztoys.com.au/admin/includes/functions/general.php on line 21

As this mod was made for 1.3.7, I then tried to add the same code to the zones.php (normal zone rates mod) as I thought I could also use this

// Check for Weight and display module if weight exceeds stated value 
if (IS_ADMIN_FLAG == false && $_SESSION['cart']->show_weight() < 20) { 
  $this->enabled = false; 
} else { 
  $this->enabled = true; 
}  

in the right place

Then got the error on the original zone rates

Parse error: parse error, unexpected T_IF, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/content/v/a/n/vandiermen2/html/geewiztoys.com.au/includes/modules/shipping/zones.php on line **120

**I really need to have a shipping mod activated only after >20, hope someone knows what I can do to make it work with out errors

1 Jun 2009, 3:10 AM
#10
vandiermen avatar

vandiermen

Totally Zenned

Join Date:
Feb 2007
Posts:
518
Plugin Contributions:
1

Re: Carrier delivery mod?

I accidently added it to the wrong spot in the zone.php

Worked well after I added it here

 
      // disable only when entire cart is free shipping
      if (zen_get_shipping_enabled($this->code)) {
        $this->enabled = ((MODULE_SHIPPING_ZONES_STATUS == 'True') ? true : false);
      }
 
// Check for Weight and display module if weight exceeds stated value 
if (IS_ADMIN_FLAG == false && $_SESSION['cart']->show_weight() < 18) { 
  $this->enabled = false; 
} else { 
  $this->enabled = true; 
}  
 
      // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
      $this->num_zones = 3;
    }
 
 

Seems my aust post module only works under 18KG's

Now the normal zone rates takes over after 18KG's. Thank you schoolboy for the code.

1 Jun 2009, 4:33 AM
#11
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Carrier delivery mod?

vandiermen:

I have the same problem with aust post module, it wont do orders over 20KG's

I'm curious as to why you continue to use this module at all?

vandiermen:

AustPost - improved V1.3 - what a nightmare :censored:
Australia Post Module V3.02 - is so fantastic!!!!!!!!!:clap:

1 Jun 2009, 4:47 AM
#12
vandiermen avatar

vandiermen

Totally Zenned

Join Date:
Feb 2007
Posts:
518
Plugin Contributions:
1

Re: Carrier delivery mod?

I forgot to click the Use cURL button in your version, then I installed the old aust post and realised the problem was that I needed to use cURL, then I was too lazy to put back the new version, but if it helps deal with orders over 18KG's than I may install the new one again.