Zen Cart Logo
Forums / General Questions / Shipping Loophole?

Shipping Loophole?

Locked

Views: 745

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
9 Jun 2010, 4:12 PM
#1
ambitions avatar

ambitions

Zen Follower

Join Date:
Apr 2010
Posts:
125
Plugin Contributions:
0

Shipping Loophole?

Hello, basically i have two table rates set up for 1st and 2nd class. Everything works fine except we only post 2nd class up to a certain weight, but through checkout instead of Zen Cart removing the 2nd class option its kept there as £0.

Obviously this is a huge problem as customers will inclined to choose free shipping when this is not intended.

How can i remove the 2nd class option when the weight limit has been exceeded for it?

9 Jun 2010, 4:17 PM
#2
schoolboy avatar

schoolboy

Totally Zenned

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

Re: Shipping Loophole?

I have a solution... give me a mo and I'll find it for you...

9 Jun 2010, 4:32 PM
#3
schoolboy avatar

schoolboy

Totally Zenned

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

Re: Shipping Loophole?

includes/modules/shipping/table.php ...

(FTP a copy to your local drive as a backup).

around LINE 50 in the ORIGINAL file:

    $this->code = 'table';
    $this->title = MODULE_SHIPPING_TABLE_TEXT_TITLE;
    $this->description = MODULE_SHIPPING_TABLE_TEXT_DESCRIPTION;
    $this->sort_order = MODULE_SHIPPING_TABLE_SORT_ORDER;
    $this->icon = '';
    $this->tax_class = MODULE_SHIPPING_TABLE_TAX_CLASS;
    $this->tax_basis = MODULE_SHIPPING_TABLE_TAX_BASIS;
    // disable only when entire cart is free shipping
    if (zen_get_shipping_enabled($this->code)) {
      $this->enabled = ((MODULE_SHIPPING_TABLE_STATUS == 'True') ? true : false);
    }

    if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_TABLE_ZONE > 0) ) {
      $check_flag = false;

Insert the bit in RED:

    $this->code = 'table';
    $this->title = MODULE_SHIPPING_TABLE_TEXT_TITLE;
    $this->description = MODULE_SHIPPING_TABLE_TEXT_DESCRIPTION;
    $this->sort_order = MODULE_SHIPPING_TABLE_SORT_ORDER;
    $this->icon = '';
    $this->tax_class = MODULE_SHIPPING_TABLE_TAX_CLASS;
    $this->tax_basis = MODULE_SHIPPING_TABLE_TAX_BASIS;
    // disable only when entire cart is free shipping
    if (zen_get_shipping_enabled($this->code)) {
      $this->enabled = ((MODULE_SHIPPING_TABLE_STATUS == 'True') ? true : false);
    }
// final check for display of Table Options for WEIGHT conditions
if (IS_ADMIN_FLAG == false && $_SESSION['cart']->show_weight() > 2) {
  $this->enabled = false;
} else {
  $this->enabled = true;
} 
    if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_TABLE_ZONE > 0) ) {
      $check_flag = false;

The Line: $_SESSION['cart']->show_weight() > 2) { basically says:

"If the cart weight is greater than 2"

Then enabling this module is FALSE.

Of course, you can make the module inactive for LESS THAN as well...

$_SESSION['cart']->show_weight() < 2) {

However... using an exact Integer causes an interesting situation when the cart is EXACTLY = 2, so give it a few decimals...

$_SESSION['cart']->show_weight() > 2.0001) {

$_SESSION['cart']->show_weight() < 1.9999) {


PS: No override file system here... make sure you keep a note of what you've done

9 Jun 2010, 4:48 PM
#4
ambitions avatar

ambitions

Zen Follower

Join Date:
Apr 2010
Posts:
125
Plugin Contributions:
0

Re: Shipping Loophole?

You are amazing Schoolboy Thank you so much. I wonder if i could ask one other question.

My checkout options display like this:
Royal Mail 1st Class (Recorded) (1 x 1,664.00 grams)
Royal Mail 2nd Class (Recorded) (1 x 1,664.00 grams)

How would i remove the part ive coloured red? as i find it unnecessary.

9 Jun 2010, 5:09 PM
#5
schoolboy avatar

schoolboy

Totally Zenned

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

Re: Shipping Loophole?

Goodness... that's a difficult one... I really don't know. :huh:

9 Jun 2010, 5:09 PM
#6
ambitions avatar

ambitions

Zen Follower

Join Date:
Apr 2010
Posts:
125
Plugin Contributions:
0

Re: Shipping Loophole?

No worries ive found it.
For anyone that might like to know..

Configuration > Shipping/Packaging > Display Number of Boxes and Weight Status = 0

9 Jun 2010, 5:14 PM
#7
schoolboy avatar

schoolboy

Totally Zenned

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

Re: Shipping Loophole?

Ambitions:

No worries ive found it.
For anyone that might like to know..

Configuration > Shipping/Packaging > Display Number of Boxes and Weight Status = 0

yeah... I was ABOUT to post that (I was kidding about the "difficulty").

Now... I'm not absolutely sure about this, but my solution to the WEIGHT issue may be influenced by the TARE settings in admin >>> shipping / packaging... You may need to set these all to zero, because I seem to remember that TARE is added later.

Check your product weights and then see what is reflected in the cart, and the shipping estimator.

As I say, if TARE is being factored in later, this may affect the result, because my solution is looking at the CART weight... not the final CONSIGNMENT weight.

I seem to remember that I had to set the tare values to zero, and compensated for packaging weight by adding a few extra grams to each product...

9 Jun 2010, 5:45 PM
#8
ambitions avatar

ambitions

Zen Follower

Join Date:
Apr 2010
Posts:
125
Plugin Contributions:
0

Re: Shipping Loophole?

Of course, already done. My site is for dropshipping anyway so i dont deal with TARE, its what i paid for when signing up with my supplier.