Page 14 of 53 FirstFirst ... 4121314151624 ... LastLast
Results 131 to 140 of 522
  1. #131
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,700
    Plugin Contributions
    6

    Default Re: Different shipping methods for different categories

    I think you are using the wrong function ...

    count_contents doesn't make that kind of check ...

    Look at the function in the shopping_cart class for:
    Code:
      function in_cart_check($check_what, $check_value='1') {
    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.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  2. #132
    Join Date
    Apr 2009
    Posts
    18
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    Thanks for staying with me on this. I am trying, I just really don't have much experience...

    Here's what I put in items. I read an old thread of yours and tried to create a variable to count the number of books.

    What does the == mean? Is that equal or not equal? At any rate, when I book one book in the cart, item does not show with this code. Arggghhhh.

    // disable when products_model is not all books this goes in item
    global $db;
    $chk_how_manybooks = $_SESSION['cart']->in_cart_check('products_model','book');
    if ($total_count - $chk_how_manybooks == 0) {
    // show
    $this->enabled = true;
    } else {
    // hide
    $this->enabled = false;
    }

  3. #133
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,700
    Plugin Contributions
    6

    Default Re: Different shipping methods for different categories

    In the IF you want == for the evaluation of the values ...

    Start with the clean item.php and change this function:
    Code:
    // class constructor
        function item() {
          global $order, $db;
    
          $this->code = 'item';
          $this->title = MODULE_SHIPPING_ITEM_TEXT_TITLE;
          $this->description = MODULE_SHIPPING_ITEM_TEXT_DESCRIPTION;
          $this->sort_order = MODULE_SHIPPING_ITEM_SORT_ORDER;
          $this->icon = '';
          $this->tax_class = MODULE_SHIPPING_ITEM_TAX_CLASS;
          $this->tax_basis = MODULE_SHIPPING_ITEM_TAX_BASIS;
    
          // disable only when entire cart is free shipping
          if (zen_get_shipping_enabled($this->code)) {
            $this->enabled = ((MODULE_SHIPPING_ITEM_STATUS == 'True') ? true : false);
          }
    
          if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_ITEM_ZONE > 0) ) {
            $check_flag = false;
            $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_ITEM_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
            while (!$check->EOF) {
              if ($check->fields['zone_id'] < 1) {
                $check_flag = true;
                break;
              } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
                $check_flag = true;
                break;
              }
    		  $check->MoveNext();
            }
    
            if ($check_flag == false) {
              $this->enabled = false;
            }
          }
    // disable when products_model is not all books this goes in item
    global $db;
    if (IS_ADMIN_FLAG == false && ( $_SESSION['cart']->count_contents() - $_SESSION['cart']->in_cart_check('products_model','book') == 0 )) {
    // show
    $this->enabled = true;
    } else {
    // hide
    $this->enabled = false;
    }
        }
    Where this is running you need to use the count_content function and test if in the Admin or not so everything works right ...
    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.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  4. #134
    Join Date
    Apr 2009
    Posts
    18
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    Finally got it all to work. thanks!!! I put the code you gave me in item.php. I wanted zones to NOT appear when the order was all books so I made a few changes and put a slight variation code as shown below. I had trouble with the brackets but finally got it. So I put this code in zones.php.

    // class constructor
    function zones() {
    global $order, $db;
    $this->code = 'zones';
    $this->title = MODULE_SHIPPING_ZONES_TEXT_TITLE;
    $this->description = MODULE_SHIPPING_ZONES_TEXT_DESCRIPTION;
    $this->sort_order = MODULE_SHIPPING_ZONES_SORT_ORDER;
    $this->icon = '';
    $this->tax_class = MODULE_SHIPPING_ZONES_TAX_CLASS;
    $this->tax_basis = MODULE_SHIPPING_ZONES_TAX_BASIS;

    // disable only when entire cart is free shipping
    if (zen_get_shipping_enabled($this->code)) {
    $this->enabled = ((MODULE_SHIPPING_ZONES_STATUS == 'True') ? true : false);
    }

    // disable when products_model is not all books this goes in item
    global $db;
    if (IS_ADMIN_FLAG == false && ( $_SESSION['cart']->count_contents() - $_SESSION['cart']->in_cart_check('products_model','book') == 0 )) {
    // hide
    $this->enabled = false;
    } else {
    // show
    $this->enabled = true;
    }

    // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
    $this->num_zones = 4;
    }

  5. #135
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,700
    Plugin Contributions
    6

    Default Re: Different shipping methods for different categories

    Be sure to really test that code ... I think you need change:
    Code:
    // disable when products_model is not all books this goes in item
    global $db;
    to read:
    Code:
    // disable when products_model is not all books this goes in item
    global $db, $cart;
    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.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  6. #136
    Join Date
    Apr 2009
    Posts
    18
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    thanks for the follow up. I did test it and it worked without the additional coding but I added it and tested it and it still works.
    Also I realized it should say, this goes in zones... not item.

  7. #137
    Join Date
    Aug 2009
    Posts
    110
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    Hi, my general shipping is based on zone rate but I am thinking of adding a category that will need to be priced as per item shipping (that's what the dropshipper for that category uses), which code would I need to edit for that?

    I am using 1.3.8a

    T-I-A!

  8. #138
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,700
    Plugin Contributions
    6

    Default Re: Different shipping methods for different categories

    What happens when you have an order with a mix of Products that use the two different shipping methods?
    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.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  9. #139
    Join Date
    Aug 2009
    Posts
    110
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    Quote Originally Posted by Ajeh View Post
    What happens when you have an order with a mix of Products that use the two different shipping methods?
    I had kinda thought of that but not properly , not sure what to do for the best tbh, my current supplier has a 6.99 charge for upto 30kg, the supplier for the new section has a max charge of £15 (which would be 11 items weighing a total of just over a kg), I'll have to see if I may be able to figure it into my markup per item (or at least some) but don't think that will be viable.....




    .....*goes back to the drawing board*

  10. #140
    Join Date
    Jul 2009
    Posts
    468
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    Quote Originally Posted by Ajeh View Post
    What happens when you have an order with a mix of Products that use the two different shipping methods?
    ajeh, u seem good with this...
    i have aerosols i want to sell.
    but the carriage for aerosols is alot more
    i want to set it so when any order involves aerosols, it changes from flat carriage to "flat carriage - different cost"
    so delivery is £6.95
    but when an aerosol is added, delivery is now £15...
    is this possible :S
    ????
    pleaseee help me
    i may not know how yet, but i soon will....i hope :)

 

 
Page 14 of 53 FirstFirst ... 4121314151624 ... LastLast

Similar Threads

  1. Need Help with Shipping Methods
    By bigcaat in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 17 Jul 2007, 04:35 PM
  2. Selecting Shipping Methods with free shipping
    By pasi in forum Built-in Shipping and Payment Modules
    Replies: 15
    Last Post: 15 Apr 2007, 05:28 PM
  3. Shipping Estimator Sort Shipping Methods
    By sitehatchery in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 15 Apr 2007, 05:34 AM
  4. List shipping methods automatically on Shipping and Return Page
    By gems14k in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 16 Jul 2006, 12:00 AM

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
  •