Results 1 to 10 of 11

Hybrid View

  1. #1
    Join Date
    May 2010
    Posts
    8
    Plugin Contributions
    0

    Default Only showing shipping method based on per item or weight amount

    I would like the flat rate or table to only show in shipping options if the item is 5lbs or less. Flat rate is there always but if it's more then 5lbs I don't want them selecting that option. It's basically the same for table but I can show them the rate upto 5lbs and if it's over that then it show a rate of 0.00

    Basically I need a if this weight or less then this amount otherwise don't show it.



    Is this possible???

    Thank you!

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Only showing shipping method based on per item or weight amount

    You can customize the flat.php shipping module with:
    // disable only when entire cart is free shipping
    if (zen_get_shipping_enabled($this->code)) {
    $this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);
    }

    // bof: turn off for more than 5 lbs
    global $cart;
    $chk_item_weight = $_SESSION['cart']->show_weight();
    if ($chk_item_weight > 5) {
    $this->enabled = false;
    }
    // eof: turn off for more than 5 lbs

    if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLAT_ZONE > 0) ) {
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    May 2010
    Posts
    8
    Plugin Contributions
    0

    Default Re: Only showing shipping method based on per item or weight amount

    Ok let me rephrase this post as this is more of what I am trying to do and makes a little more sense so maybe someone can help me.

    Is there a way to only show the flat rate shipping method if a customer has <=5 products ordered? If it's >5 products I don't want the flat rate shipping method option to show.

    Thanks Again!!

  4. #4
    Join Date
    May 2010
    Posts
    8
    Plugin Contributions
    0

    Default Re: Only showing shipping method based on per item or weight amount

    Thanks Ajeh.... how can I code it for product instead of weight.

    I really appreciate your help.

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Only showing shipping method based on per item or weight amount

    Use another function from the shopping_cart.php class file for:
    count_contents()

    instead of the:
    show_weight()

    See if that helps ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  6. #6
    Join Date
    May 2010
    Posts
    8
    Plugin Contributions
    0

    Default Re: Only showing shipping method based on per item or weight amount

    Hi Ajeh

    I used the code you provided with the weight and everything works fine on the cart side, and seemed fine yesterday in admin but today in admin under shipping it won't come up and I get this error

    Fatal error: Call to a member function show_weight() on a non-object in includes/modules/shipping/flat.php

    Hope you can help.
    Thank you!!

  7. #7
    Join Date
    May 2010
    Posts
    8
    Plugin Contributions
    0

    Default Re: Only showing shipping method based on per item or weight amount

    Thanks..... but I figured it out on my own.
    Once again thanks for all your help here....as well as on reading previous threads!!!

  8. #8
    Join Date
    Nov 2008
    Posts
    164
    Plugin Contributions
    0

    Default Re: Only showing shipping method based on per item or weight amount

    Quote Originally Posted by chinook View Post
    Hi Ajeh

    I used the code you provided with the weight and everything works fine on the cart side, and seemed fine yesterday in admin but today in admin under shipping it won't come up and I get this error

    Fatal error: Call to a member function show_weight() on a non-object in includes/modules/shipping/flat.php

    Hope you can help.
    Thank you!!
    It would help if you posted your solution, I'm having this problem as well (mind you, I didn't modify any code).

 

 

Similar Threads

  1. Replies: 0
    Last Post: 21 May 2012, 03:07 AM
  2. Different shipping per item (not based on weight)
    By stevelucky in forum General Questions
    Replies: 4
    Last Post: 29 Aug 2010, 04:40 PM
  3. Shipping multiple items based on total weight, but need weight per box.
    By Nineve in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 2 Aug 2010, 07:42 AM
  4. Zone Shipping Cost based on Individual item weight, not total order weight
    By pohnean in forum Built-in Shipping and Payment Modules
    Replies: 15
    Last Post: 16 Sep 2009, 09:02 AM
  5. Group pricing (per item) showing incorrect amount on cart subtotal
    By jase_31 in forum All Other Contributions/Addons
    Replies: 5
    Last Post: 22 Jan 2008, 04:43 AM

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