Page 4 of 7 FirstFirst ... 23456 ... LastLast
Results 31 to 40 of 70
  1. #31
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories

    Let's pretend I am not understanding the ultimate goal here ...

    If I have other Products that are not an Alchemy product, then USPS is correct, right?

    If I have 1 or more Alchemy products then it should be a Flat $10.00, correct?

    What happens when I have 1 or more Alchemy products and other non-Alchemy products in the cart? Should it just add $10.00 to the USPS charge?
    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!

  2. #32
    Join Date
    Apr 2010
    Location
    Albuquerque, NM
    Posts
    198
    Plugin Contributions
    0

    Default Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories

    Yes, what you said is exactly what I want, though the alchemy flat $10 charge doesn't HAVE to be under usps since the manufacturer actually Fed Ex's them, but had come to the point that this way seemed the easiest.

    Originally you had told me to set up flat.php to run if there were ONLY alchemy products, and if there were mixed products to have the usps ADD the "dropship" charge. Once I understood that a dropship charge could be added in this way, I thought I could just go the route of configuring usps.php. But now that it seems to want to add a base usps shipping price even if the weight is 0 (maybe just the nature of usps, which maybe can't be altered?), then I'm stuck again. But at least I'm closer than I was last week!

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

    Default Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories

    If you could tell me for sure if there should be a $10.00 charge added to the USPS rates when there are 1 or more Alchemy products in the cart and other products at the same time ...

    and if there are only Alchemy products in the cart that the USPS module should be turned off and just the Flat Rate of $10.00 should be charged ... there are ways to make the modules turn on and off ...

    1 Alchemy product - Flat Rate flat shows for $10.00 and USPS is turned off

    2 Alchemy products - Flat Rate flat shows for $10.00 and USPS is turned off

    1 Alchemy product and 1 or more other non-Alchemy products in cart - USPS shows with $10.00 added to quotes and Flat Rate flat is turned off

    0 Alchemy products and other non-Alchemy products in the cart shows regular USPS quotes only and Flat Rate flat is turned off
    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. #34
    Join Date
    Apr 2010
    Location
    Albuquerque, NM
    Posts
    198
    Plugin Contributions
    0

    Default Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories

    Yes, all the scenarios you layed out are exactly true.

    It sounds to me from what you're saying that I DO need the flat rate for the times that there are only alchemy products, so I'll work with that, I think that with all I've learned I'll be able to work it out, I'll post when I'm stuck or when it works.....

    Thank you!

  5. #35
    Join Date
    Apr 2010
    Location
    Albuquerque, NM
    Posts
    198
    Plugin Contributions
    0

    Default Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories

    OK, I've installed and modified flat.php, and also added some more code to usps.php, but something isn't right somewhere because the shipping options don't show up in the cart, and when I go to checkout an HTTP 500 error happens. Here's the two code changes:

    In usps.php, to disable the module if only alchemy products are in the cart, which will be tested by the total cart equaling 0:

    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);
        }
    
    global $cart;
    
    // check total weight
    if (IS_ADMIN_FLAG == false) {
              $chk_weight = $_SESSION['cart']->in_cart_check('products-weight','0');
          }
    
    // disable if product weight is more than zero
    if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('products-weight') > 0)) {
              // show USPS
              $this->enabled = true;
          } else {
              // hide USPS
              $this->enabled = false;
          } 
    In flat.php, my goal is for it to check if the manufacturer Alchemy is in the cart AND if the total cart weight is 0, in which case I want it to be enabled. If the weight is more than zero and alchemy is not in the cart, it should be disabled:

    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;
    
    // check total weight and manufacturer id
    if (IS_ADMIN_FLAG == false) {
              $chk_weight = $_SESSION['cart']->in_cart_check('products-weight','0');
              $chk_manufacturer = $_SESSION['cart']->in_cart_check('manufacturers_id','1');
          }
    
    // disable if product weight is more than zero
    if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('products-weight','0')) {
              // show FLAT
              $this->enabled = true;
          } else {
              // hide FLAT
              $this->enabled = false;
          }
    
    // disable if no alchemy products in cart
          
          if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('manufacturers_id','1') = 0)) {
              // hide FLAT
              $this->enabled = false;
          }
    Any ideas?

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

    Default Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories

    Try using this to test the cart for weight:
    Code:
    global $cart;
    // disable if product weight is more than zero in cart
    if (IS_ADMIN_FLAG == false && $_SESSION['cart']->show_weight() > 0) {
      $this->enabled = false;
    } else {
      $this->enabled = true;
    }
    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!

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

    Default Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories

    On testing how many are in the cart for your manufacturer ...
    Code:
    // disable if no alchemy products in cart
          
          if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('manufacturers_id','1') == 0)) {
              // hide FLAT
              $this->enabled = false;
          }
    you missed an equal sign ...
    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!

  8. #38
    Join Date
    Apr 2010
    Location
    Albuquerque, NM
    Posts
    198
    Plugin Contributions
    0

    Default Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories

    Ok, thank you, I changed flat.php the way you suggested.

    Now I'm not getting the internal error when I check out, but in the shopping cart and when I click checkout, I get this error:

    1054 Unknown column 'products' in 'field list'
    in:
    [select products-weight as check_it from products where products_id='2' limit 1]


    And depending on which product I have in the cart, the number after products_id is different.

    Does this have anything to do with the shipping modules??

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

    Default Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories

    I need to see your code ... this is not a valid field: products-weight
    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!

  10. #40
    Join Date
    Apr 2010
    Location
    Albuquerque, NM
    Posts
    198
    Plugin Contributions
    0

    Default Re: Can I apply Flat Rate to one Category & Zone, Per Weight for all other Categories

    Oops again!! I looked back, and realized I had products-weight instead of products_weight, so I changed three instances of it. Now the flat rate is working and showing the flat $10 charge if there are 1+ alchemy products in the cart, but if there are other products with or without any alchemy products, the USPS is not coming up at all.

    The following red is ALL the custom code I've added to USPS (I've got global $cart; in there twice, is that bad?):

    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);
        }
    
    global $cart;
    
    // check total weight
    if (IS_ADMIN_FLAG == false) {
              $chk_weight = $_SESSION['cart']->in_cart_check('products_weight','0');
          }
    
    // disable if product weight is more than zero
    if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('products_weight') > 0)) {
              // show USPS
              $this->enabled = true;
          } else {
              // hide USPS
              $this->enabled = false;
          } 
    
    //(LEAVING OUT A WHOLE SECTION OF CODE HERE TO SAVE SPACE)
    // BOF: UPS USPS
            $this->quotes = array('id' => $this->code,
            'module' => $this->title . $show_box_weight);
            // EOF: UPS USPS
    
        global $cart;
    
        //check if manufacturer alchemy is in cart 
          if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('manufacturers_id','1') > 0)); {
            $manufacturer_alchemy = $_SESSION['cart']->in_cart_check('manufacturers_id','1');
      
            $drop_ship_extra_charge = $manufacturer_alchemy;
          }  
       // charge dropship fee for alchemy 
          if ($drop_ship_extra_charge > 0) { 
            $cat_extra_charge = 10; 
            echo 'An additional $10 shipping fee for Alchemy items has been applied.';
          } else {
            $cat_extra_charge = 0;
          } 
    
            $methods = array();
            $size = sizeof($uspsQuote);
            for ($i=0; $i<$size; $i++) {
              list($type, $cost) = each($uspsQuote[$i]);
    
              // BOF: UPS USPS
              $title = ((isset($this->types[$type])) ? $this->types[$type] : $type);
              if(in_array('Display transit time', explode(', ', MODULE_SHIPPING_USPS_OPTIONS)))    $title .= $transittime[$type];
              /*
              $methods[] = array('id' => $type,
              'title' => ((isset($this->types[$type])) ? $this->types[$type] : $type),
              'cost' => ($cost + MODULE_SHIPPING_USPS_HANDLING) * $shipping_num_boxes);
              */
              $cost = preg_replace('/[^0-9.]/', '',  $cost);
              $methods[] = array('id' => $type,
                                 'title' => $title,
                                 'cost' => $cat_extra_charge + ($cost * $shipping_num_boxes) + (MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_USPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_USPS_HANDLING) );
    
            }

 

 
Page 4 of 7 FirstFirst ... 23456 ... LastLast

Similar Threads

  1. How do I use FLAT RATE for one item - and UPS Ship by weight for the other 8 items?
    By MarleneF in forum Built-in Shipping and Payment Modules
    Replies: 36
    Last Post: 31 Aug 2011, 04:15 PM
  2. Flat rate for 1 category, Per Item for all others
    By Znak in forum Built-in Shipping and Payment Modules
    Replies: 19
    Last Post: 18 Aug 2011, 03:09 PM
  3. Multiple zone/flat rate and added cost per pound?
    By AmyCapolupo in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 14 Jul 2011, 09:21 AM
  4. How Can I Set a Flat Rate for shipping on 1 item and rest by weight ?
    By vividbreeze in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 1 Jan 2010, 05:26 AM
  5. Flat Rate for some products, ship by weight for other products
    By caspar in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 28 Mar 2007, 01:12 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR