Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 31
  1. #21
    Join Date
    Apr 2010
    Posts
    282
    Plugin Contributions
    1

    Default Re: perweightunit issue

    Quote Originally Posted by Ajeh View Post
    NOTE: the global $cart; needs the $cart and not cart in both places ...
    that fixed it. i applied that code to both usps, and the per item as a test, and both options are still available for all categories, except for the free shipping items.here's what i have in the usps.php:
    Code:
      // disable only when entire cart is free shipping
        if (zen_get_shipping_enabled($this->code)) {
          $this->enabled = ((MODULE_SHIPPING_USPS_STATUS == 'True') ? true : false);
        }
    if (!IS_ADMIN_FLAG) {
      global $cart;
      $chk_cat_1 = $_SESSION['cart']->in_cart_check('master_categories_id','1');
      if ($chk_cat_1 == $_SESSION['cart']->count_contents()) {
        $this->enabled = false;
      } 
    }
        if ($this->enabled) {
          // check MODULE_SHIPPING_USPS_HANDLING_METHOD is in
          $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_USPS_HANDLING_METHOD'");
          if ($check_query->EOF) {
            $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Handling Per Order or Per Box', 'MODULE_SHIPPING_USPS_HANDLING_METHOD', 'Box', 'Do you want to charge Handling Fee Per Order or Per Box?', '6', '0', 'zen_cfg_select_option(array(\'Order\', \'Box\'), ', now())");
          }
        }

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

    Default Re: perweightunit issue

    So this means all is working correctly now for everything?
    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. #23
    Join Date
    Apr 2010
    Posts
    282
    Plugin Contributions
    1

    Default Re: perweightunit issue

    Quote Originally Posted by Ajeh View Post
    So this means all is working correctly now for everything?
    i implemented the code, and usps shows up for category 1, and 5, so it's not working correctly.

    if you want to test it:
    www.redsautorehab.com
    according to the categories\products tab in admin, the allison cooler hose sets, are top category 1, and the individual cooler hoses are category 5

    i only have three categories, so i don't understand why one of them is #5

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

    Default Re: perweightunit issue

    The test I gave you is for the master_categories_id of the Product ... your categories_id 1 is a Top Level Category ...

    If you mean to test for the subcategories you need to test for the subcategories categories_id ...

    Look at the Product and see what its master_categories_id is ...
    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!

  5. #25
    Join Date
    Apr 2010
    Posts
    282
    Plugin Contributions
    1

    Default Re: perweightunit issue

    thank you very much. i'm such a newbie.

    if i wanted to add more categories to that code, do i just duplicate it, or is there a simpler way?


    also, what books would you recommend for learning php coding?

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

    Default Re: perweightunit issue

    Say I wanted to do categories_id 1, 2 and 5 because those are the master_categories_id for my Products in the products table ...

    Code:
      $chk_cat_1 = $_SESSION['cart']->in_cart_check('master_categories_id','1');
      $chk_cat_2 = $_SESSION['cart']->in_cart_check('master_categories_id','2');
      $chk_cat_5 = $_SESSION['cart']->in_cart_check('master_categories_id','5');
    
    $chk_cats_all = $chk_cat_1 + $chk_cat2 + $chk_cat_5;
    Then in the IF statement I would use:
    $chk_cats_all

    instead of $chk_cat_1

    I can call these variables anything I want, it just made sense to match them to the categories_id I want to check for ...
    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!

  7. #27
    Join Date
    Apr 2010
    Posts
    282
    Plugin Contributions
    1

    Default Re: perweightunit issue

    thank you so much. that's basically what i was looking for originally.

    i modified it to say true, and used the category number that i want to offer the flat rate for, and placed it in the item.php then, in the admin control panel, i set item shipping to false, and it only shows up when these categories are in the cart.

    with a mixed cart, my flat option disapeers, so the only options are ups, and usps. which is exactly what i wanted.


    i really need to buy the team coffee and donuts soon.

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

    Default Re: perweightunit issue

    You really do not want to use this backwards by setting a shipping module to false then enabling it in another manner ...

    While in theory it should work ... it is not designed to work in that manner and it is better to set a module to true and then "hide" it based on testing for another condition ...

    You can do it which ever way you want, but be aware that is not how the modules are designed to work and hard to predict if there would be issues because of it ...
    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!

  9. #29
    Join Date
    Apr 2010
    Posts
    282
    Plugin Contributions
    1

    Default Re: perweightunit issue

    Quote Originally Posted by Ajeh View Post
    You really do not want to use this backwards by setting a shipping module to false then enabling it in another manner ...

    While in theory it should work ... it is not designed to work in that manner and it is better to set a module to true and then "hide" it based on testing for another condition ...

    You can do it which ever way you want, but be aware that is not how the modules are designed to work and hard to predict if there would be issues because of it ...
    should i just set it to false for all of the categories that i don't want it to use?
    Last edited by vanhorn_s; 12 May 2010 at 05:27 AM.

  10. #30
    Join Date
    Apr 2010
    Posts
    282
    Plugin Contributions
    1

    Default Re: perweightunit issue

    Quote Originally Posted by vanhorn_s View Post
    should i just set it to false for all of the categories that i don't want it to use?
    i just tested that, and it allows this shipping method with a mixed cart.

 

 
Page 3 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. perweightunit shipping
    By codrakon in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 10 Jun 2010, 02:47 PM
  2. perweightunit questions
    By design4dotcom in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 7 Jul 2009, 11:38 PM
  3. perweightunit ISSUES!!!
    By ImCuteiThink in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 1 May 2008, 06:39 AM
  4. perweightunit question
    By GraniteMan44 in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 12 Apr 2008, 07:00 PM
  5. perweightunit module
    By CheekyCockney in forum Built-in Shipping and Payment Modules
    Replies: 9
    Last Post: 9 Aug 2006, 08:54 PM

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