Thread: Shipping Rate

Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2009
    Posts
    41
    Plugin Contributions
    1

    Default Shipping Rate

    When checking out, or doing shipping estimate, can I add a function to flat.php to disable flat rate shipping if say, more than 3 items are in cart, if so, help a little please.
    On another note, I have 10 heavy items that I gave the same manufacturers name, could I also disable flat shipping if any of those items are in the cart, thanks for any help in adavance.
    Dennis

  2. #2
    Join Date
    Aug 2009
    Posts
    41
    Plugin Contributions
    1

    Default Re: Shipping Rate

    just a hint where I'm going with this, in flat.php I've added, but can't figure where to get the product id to feed the function

    // disable if has manufacturer
    if (zen_not_null(zen_get_products_manufac(PRODUCT)))
    {
    $this->enabled = false;
    }


    /* in general.php I created a function */
    function zen_get_products_manufac($product_id,$language_id)
    {
    global $db;
    $product = $db->Execute("select manufacturers_id
    from " . TABLE_PRODUCTS_DESCRIPTION . "
    where products_id = '" . (int)$product_id . "'
    and language_id = '" . (int)$language_id . "'");

    return $product->fields['manufacturers_id'];
    }

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

    Default Re: Shipping Rate

    Changing the code from:
    Code:
          // disable only when entire cart is free shipping
          if (zen_get_shipping_enabled($this->code)) {
            $this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);
          }
    to read:
    Code:
          // disable only when entire cart is free shipping
          if (zen_get_shipping_enabled($this->code)) {
            $this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);
          }
        global $cart;
        // disable when manufacturers_id = 3 is in cart for 1 or more products or number of items > 3
        if (IS_ADMIN_FLAG == false && ($_SESSION['cart']->in_cart_check('manufacturers_id','3') > 0 || $_SESSION['cart']->count_contents() > 3) ) {
          $this->enabled = false;
        }
    will disable Flat Rate flat when 1 or more Products are in the cart using manufacturers_id = 3 ... or the item count > 3 ...
    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: v1.5.5]
    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!

  4. #4
    Join Date
    Aug 2009
    Posts
    41
    Plugin Contributions
    1

    Default Re: Shipping Rate

    I bow to you Ajeh, just perfect, thank you.

    Where could I set only one item in the cart from the same manufacturer, thanks again.

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

    Default Re: Shipping Rate

    Could you be a bit more specific on what you are asking for?

    Are you trying to do this for just 1 Product that happens to be from this manufacturer? Or are you trying to do something else?

    If just 1 Product, then you could just check for that products_id for the Product ...
    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: v1.5.5]
    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!

 

 

Similar Threads

  1. Replies: 2
    Last Post: 12 Feb 2013, 01:23 AM
  2. Rate Table Shipping plus Flat Rate Shipping
    By JRayfield in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 28 Dec 2008, 12:23 AM
  3. Flat Rate shipping challenge - need a separate rate for a few heavier items
    By Nigel Lew in forum Built-in Shipping and Payment Modules
    Replies: 9
    Last Post: 27 Jun 2008, 10:07 PM
  4. Flat rate shipping-one rate euro, one rate international
    By schwimwastaken in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 11 Oct 2006, 04:59 AM
  5. Shipping with table rate & % rate
    By BlakeW in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 10 May 2006, 07:08 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR