Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Apr 2010
    Posts
    125
    Plugin Contributions
    0

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

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Shipping Loophole?

    I have a solution... give me a mo and I'll find it for you...
    20 years a Zencart User

  3. #3
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default 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:
    Code:
        $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:

    Code:
        $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
    20 years a Zencart User

  4. #4
    Join Date
    Apr 2010
    Posts
    125
    Plugin Contributions
    0

    Default 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.

  5. #5
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Shipping Loophole?

    Goodness... that's a difficult one... I really don't know.
    20 years a Zencart User

  6. #6
    Join Date
    Apr 2010
    Posts
    125
    Plugin Contributions
    0

    Default 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

  7. #7
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: Shipping Loophole?

    Quote Originally Posted by Ambitions View Post
    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...
    20 years a Zencart User

 

 

Similar Threads

  1. v151 Force shipping - If zc cant calculate shipping, it doesnt charge for shipping
    By Laidlawgifts in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 13 Apr 2014, 09:11 PM
  2. Replies: 22
    Last Post: 26 Jul 2012, 11:35 PM
  3. FREE SHIPPING! Loophole?
    By sublime19 in forum Built-in Shipping and Payment Modules
    Replies: 8
    Last Post: 30 Mar 2010, 01:32 AM
  4. Replies: 9
    Last Post: 13 Dec 2007, 04:45 PM
  5. security loophole??
    By styledata in forum General Questions
    Replies: 1
    Last Post: 7 Aug 2006, 09:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg