Page 1 of 3 123 LastLast
Results 1 to 10 of 30
  1. #1
    Join Date
    Mar 2009
    Location
    Serbia
    Posts
    349
    Plugin Contributions
    0

    Default limitlimited shipped methods only with one categories

    Hi, hay to make to some product, category can't bay at the same time, in the same order !?

    1.The carriers is the same.
    2.The customer is the same, product be shipped to the same location.
    3.The product are shipped from different sources.
    Hay to set thet some product can't shipped together?

    I know thet, by controlling the $this->enabled in any of the modules.
    When set to false, the module will not show, when set to true, the module will show .

    I put in table.php code, thet some categories can't sell tugeder (in same order).
    I have master categori 3 end 39, product from thare can't sell tugeder.

    The modul don't work!
    I get blank page.
    Something I mistake, byt I don't know what!!!!!

    CODE of table.php:
    .....................................................................
    if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_TABLE_ZONE > 0) ) {
    $check_flag = false;
    $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_TABLE_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;
    }
    }

    global $cart;
    if ($_SESSION['cart']->in_cart_check('master_categories_id','3') > 0 && $_SESSION['cart']->in_cart_check('master_categories_id','39') {
    $this->enabled = false;
    }

    }
    /**
    * I PUT CODE UP HERE ^
    *
    * @param unknown_type $method
    * @return unknown
    */
    function quote($method = '') {
    global $order, $shipping_weight, $shipping_num_boxes, $total_count;

    // shipping adjustment
    switch (MODULE_SHIPPING_TABLE_MODE) {
    case ('price'):
    $order_total = $_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices() ;
    break;
    case ('weight'):
    $order_total = $shipping_weight;
    break;
    case ('item'):
    $order_total = $total_count - $_SESSION['cart']->free_shipping_items();
    break;
    }
    ....................................................................

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

    Default Re: limitlimited shipped methods only with one categories

    I believe you left out some code in the IF statement:
    Code:
    if ($_SESSION['cart']->in_cart_check('master_categories_id','3') > 0 && $_SESSION['cart']->in_cart_check('master_categories_id','39') > 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: 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
    Mar 2009
    Location
    Serbia
    Posts
    349
    Plugin Contributions
    0

    Default Re: limitlimited shipped methods only with one categories

    Hi, I put the code end I still can bay in same order product from diferent master category (ID3 end ID39)!


    ..............................
    MODULE_SHIPPING_TABLE_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;
    }
    }
    global $cart;
    if ($_SESSION['cart']->in_cart_check('master_categories_id','3') > 0 && $_SESSION['cart']->in_cart_check('master_categories_id','39') > 0) {
    $this->enabled = false;
    }

    }
    /**
    * Enter description here...
    *
    * @param unknown_type $method
    * @return unknown
    */
    function quote($method = '') {
    global $order, $shipping_weight, $shipping_num_boxes, $total_count;
    ..............................................................

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

    Default Re: limitlimited shipped methods only with one categories

    Replace the function table in the table.php file with this new code:
    Code:
      function table() {
        global $order, $db;
    
        $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;
          $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_TABLE_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;
          }
        }
    
        // do not show if products from master_categories_id 3 and 39 are in the cart together
        global $cart;
        if (!IS_ADMIN_FLAG && ($_SESSION['cart']->in_cart_check('master_categories_id','3') > 0 && $_SESSION['cart']->in_cart_check('master_categories_id','39') > 0)) {
          $this->enabled = false;
        }
      }
      /**
    See if that works better for you ...
    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!

  5. #5
    Join Date
    Mar 2009
    Location
    Serbia
    Posts
    349
    Plugin Contributions
    0

    Default Re: limitlimited shipped methods only with one categories

    I send you a tabe.php from: shop/includes/modules/shipping/table.php to see!
    I copy the code end nothing happend, I still can bay from all category in same orded, is likely thet sometimes I not work good!

  6. #6
    Join Date
    Mar 2009
    Location
    Serbia
    Posts
    349
    Plugin Contributions
    0

    Default Re: limitlimited shipped methods only with one categories

    The tabe.php from: shop/includes/modules/shipping/table.php

    Ajeh I copy the code end nothing happend, I still can bay from all category in same orded, is likely thet sometimes I not work good!




    [CODE] function table() {
    global $order, $db;

    $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;
    $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_TABLE_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;
    }
    }

    // do not show if products from master_categories_id 3 and 39 are in the cart together
    global $cart;
    if (!IS_ADMIN_FLAG && ($_SESSION['cart']->in_cart_check('master_categories_id','3') > 0 && $_SESSION['cart']->in_cart_check('master_categories_id','39') > 0)) {
    $this->enabled = false;
    }
    }
    /**
    * Enter description here...
    [/QUOTE]

  7. #7
    Join Date
    Mar 2009
    Location
    Serbia
    Posts
    349
    Plugin Contributions
    0

    Default Re: limitlimited shipped methods only with one categories

    Hi Ajex, I replease code ehd I still can bay all product in same order!
    table.php is from: shop/includes/moduls/shipment/table.php

    I sometimes working wrongly!
    I have only categories 3 end 39, i put code in table/php upload in shop end still can bay product from master categories 3 end 39 in same order.


    Code:
       function table() {
        global $order, $db;
    
        $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;
          $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_TABLE_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;
          }
       }
      
      // do not show if products from master_categories_id 3 and 39 are in the cart together
        global $cart;
        if (!IS_ADMIN_FLAG && ($_SESSION['cart']->in_cart_check('master_categories_id','3') > 0 && $_SESSION['cart']->in_cart_check('master_categories_id','39') > 0)) {
          $this->enabled = false;
        }
      }
      /**
       * Enter description here...

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

    Default Re: limitlimited shipped methods only with one categories

    Get a clean copy of the file:
    /includes/modules/shipping/table.php

    and add the changed function that I posted to it and try this ...
    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!

  9. #9
    Join Date
    Mar 2009
    Location
    Serbia
    Posts
    349
    Plugin Contributions
    0

    Default Re: limitlimited shipped methods only with one categories

    Ajex, I put in new table.php the copy code end nothing.
    A still can order product togeder from master categori ID 3 end 39.
    I send you a picture.
    Attached Images Attached Images  

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

    Default Re: limitlimited shipped methods only with one categories

    Check this post and ensure that you have applied the Known Bug fixes ...
    http://www.zen-cart.com/forum/showthread.php?t=82619

    It would also be a good time to ensure that you have the current Security Fixes and other Patches for your site ...
    http://www.zen-cart.com/forum/showthread.php?t=131115
    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!

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. Restricting payment methods to only certain categories
    By delia in forum General Questions
    Replies: 6
    Last Post: 30 Dec 2014, 06:53 PM
  2. v138a Limitlimited order methods only for certain product or sub-categories
    By kobra8 in forum Managing Customers and Orders
    Replies: 7
    Last Post: 12 Dec 2012, 02:05 AM
  3. limited payment methods only with one categories
    By thenax in forum Built-in Shipping and Payment Modules
    Replies: 15
    Last Post: 17 Oct 2009, 08:01 PM
  4. Ultimate SEO URLs Does Not Work with Categories with Only One Product
    By hossbronco in forum All Other Contributions/Addons
    Replies: 5
    Last Post: 17 Oct 2008, 04:03 AM
  5. Can a product only be shipped by one method?
    By ajcannon in forum General Questions
    Replies: 2
    Last Post: 15 Sep 2006, 02:22 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