Results 1 to 10 of 11

Hybrid View

  1. #1
    Join Date
    May 2011
    Location
    US
    Posts
    7
    Plugin Contributions
    0

    Default 2 different shipping amounts and a maximum per order for shipping

    I hope someone can point me in the right direction. I've been searching and searching and cannot find this exact problem. I'm only slightly versed in coding, but cannot write my own code. (I can copy and paste though).

    I have several small items in my shop. Most can ship for $2.00 and I've been using a flat rate shipping of $2.00 per order. If someone orders a 2nd or 3rd item, the shipping rate only changes a few pennies and I'd rather make it simple. Well now I've complicated things because I'm adding 2 items which should only have $1.00 shipping fee if purchased inidivudally, original items should charge $2.00 if shipping individually, but I don't want to charge more than $2.00 total shipping even if they order a larger quantity or a mix of items. Can anyone help me figure out how to do this?

    Thanks in advance!

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

    Default Re: 2 different shipping amounts and a maximum per order for shipping

    You could customize the Flat Rate flat shipping module ...

    Code:
        function quote($method = '') {
          global $order;
    
    // bof: custom Flat rates
    global $cart;
    // check how many cart contains of products_id 6
    $chk_item1 = 0;
    $chk_item1 += $_SESSION['cart']->in_cart_check('products_id','6');
    
    // check how many cart contains of products_id 18
    $chk_item2 = 0;
    $chk_item2 += $_SESSION['cart']->in_cart_check('products_id','18');
    
    // check total count
    $chk_cart_count = $_SESSION['cart']->count_contents();
    
    // set rate based on total items in cart vs products_id 6, products_id 18 vs all products
    switch (true) {
      case ($chk_item1 == $chk_cart_count):
      // only Item1 is in the cart
        $flat_charge = 1.00;
        break;
      case ($chk_item2 == $chk_cart_count):
      // only Item2 is in the cart
        $flat_charge = 1.00;
        break;
      default:
      // mixed cart
        $flat_charge = MODULE_SHIPPING_FLAT_COST;
        break;
    }
    
          $this->quotes = array('id' => $this->code,
                                'module' => MODULE_SHIPPING_FLAT_TEXT_TITLE,
                                'methods' => array(array('id' => $this->code,
                                                         'title' => MODULE_SHIPPING_FLAT_TEXT_WAY,
                                                         'cost' => $flat_charge)));
    // eof: custom Flat rates
    
          if ($this->tax_class > 0) {
            $this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
          }
    NOTE: Set the Flat Rate Fee to 2.00 on the module ...
    Last edited by Ajeh; 28 May 2011 at 07:14 PM.
    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!

  3. #3
    Join Date
    May 2011
    Location
    US
    Posts
    7
    Plugin Contributions
    0

    Default Re: 2 different shipping amounts and a maximum per order for shipping

    The only thing I don't think this will let me do is have some items be $1 if purchased individually and some items be $2 if purchased individually or am I missing something? It's pretty close though if it's the best I can do.

  4. #4
    Join Date
    May 2011
    Location
    US
    Posts
    7
    Plugin Contributions
    0

    Default Re: 2 different shipping amounts and a maximum per order for shipping

    Oh wait, I think I understand, there are 2 product ID's shown. So, I can just add the product ID of each type of item and separate by commas?

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

    Default Re: 2 different shipping amounts and a maximum per order for shipping

    No ... I set this up to test for individual products_id ...

    You would need to follow the pattern of the two examples if you want to add more that are $1.00 shipping products when purchased alone ...
    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!

  6. #6
    Join Date
    May 2011
    Location
    US
    Posts
    7
    Plugin Contributions
    0

    Default Re: 2 different shipping amounts and a maximum per order for shipping

    Hmmmm, in order to not need to add a product id each time I add a new product (frequently as each product is a one of a kind item, handmade) could I do this by catagory? All items in one catagory gets charged $1 shipping, all items in the 2nd catagory gets $2 shipping with a max shipping rate of $2??

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

    Default Re: 2 different shipping amounts and a maximum per order for shipping

    All Products get a $2.00 Flate Rate Charge unless you build a test for them to see how many items are in the cart and if all of them are that item ...
    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: 7
    Last Post: 20 Mar 2013, 02:12 PM
  2. v151 International Per Item Shipping and Domestic Per Order Shipping
    By function in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 15 Mar 2013, 03:44 PM
  3. Different maximum shipping weights for different shipping modules
    By stylenote in forum Basic Configuration
    Replies: 19
    Last Post: 26 Apr 2012, 10:24 PM
  4. In need of shipping help, 3 different amounts for each item, nothing more..
    By Slipstream in forum Built-in Shipping and Payment Modules
    Replies: 6
    Last Post: 20 Apr 2010, 09:47 PM
  5. Different shipping amounts for different items?
    By brucehere in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 26 May 2008, 02:34 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