Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1
    Join Date
    Mar 2009
    Location
    New York
    Posts
    157
    Plugin Contributions
    0

    Default Shipping module setting weight independent of number of items ordered

    Our store sells large size photographs. The weight of the photographs are based on the weight of the tube that are used to ship them. If a customer orders multiple copies of the same photo I do not want to multiply the weight by the number of items ordered.
    For such products I want to set the weight as a negative number and use that as a test to skip the logic for multiplying by the number of units. Of course the weight will be reset to positive equivalent after skiping the weight multiplication. Can somebody please guide me to the file where this calculation is done. Thanks in advance. The shipping module is USPS.

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Shipping module setting weight independent of number of items ordered

    Set the amount for one
    Add a handling fee for the tube
    It will be added only once while the pics will be incremental
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Mar 2009
    Location
    New York
    Posts
    157
    Plugin Contributions
    0

    Default Re: Shipping module setting weight independent of number of items ordered

    We also sell many items which are not photographs. In such a case I am not sure how to set the handling charge for some products only.

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Shipping module setting weight independent of number of items ordered

    We also sell many items which are not photographs. In such a case I am not sure how to set the handling charge for some products only.
    This will require some custom code to make the determination

    Advanced Search here for some pointers from Ajeh to another that needed something similar/special for firearms

    search term shipping firearms - - with by Ajeh as the user name
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Mar 2009
    Location
    New York
    Posts
    157
    Plugin Contributions
    0

    Default Re: Shipping module setting weight independent of number of items ordered

    Thanks Kobra. I found the thread and it is exactly what I am looking for. I would not have found it myself. Thanks again. Donuts for the team.

  6. #6
    Join Date
    Mar 2009
    Location
    New York
    Posts
    157
    Plugin Contributions
    0

    Default Re: Shipping module setting weight independent of number of items ordered

    Our store is at www.arunachala.org/bookstore We sell books,
    photographs, audio and video. We use USPS and most of the shipping weights are correctly calculated by the shopping cart. Large size photographs are shipped in a tube. The weight of the photograph is small compared to the weight of the tube. When a customer orders four copies of the same photograph the store multiplies the weight of each tube by four and bases the shipping cost on that. For photographs we do not want to do this because many photographs can fit into a single tube and customer needs to pay for one tube weight only regardless of how many similar photographs are purchased..
    I had an idea to set the weights for these photographs negative and test for the sign of the weight to skip multiplication with number of items purchased for such photographs. However based on Kobra's reference to thread by Ajeh http://www.zen-cart.com/forum/showthread.php?t=165331
    I wanted to set up a similar handling charge based not on category but products. I need to know if it possible to do it on item by item basis. Also what is the name of the variable to check.

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

    Default Re: Shipping module setting weight independent of number of items ordered

    Do you use any 0 weight for Free Shipping or Always Free Shipping products?

    Have you some products_id of these Products that are shipped by Tube?

    If I order 1 Tube Product how much?

    If I order 3 Tube Products how much?

    If I order 12 Tub Products how much?
    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!

  8. #8
    Join Date
    Mar 2009
    Location
    New York
    Posts
    157
    Plugin Contributions
    0

    Default Re: Shipping module setting weight independent of number of items ordered

    I use 0 or zero weight for magazine subscriptions which are always free shipping. Our volume of sale is usually limited to a max of 3 or 4 copies of the same size. The tube weight is set to say .9 pounds. If a person orders 1 or 3 or 12 identical photogrphs I want the net weight to be 0.9 pounds not .9 times the number purchased. The category ID of one such photo is 5015. There four other items which are shipped this way with different IDs. I am using version 1.3.9f planning to upgrade soon.

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

    Default Re: Shipping module setting weight independent of number of items ordered

    You could customize the FREE SHIPPING freeshipper and Flat Rate flat shipping modules ...

    Let's assume the Tube Products are products_id 193, 194, 195 and 196 ...

    Edit the file:
    /includes/modules/shipping/flat.php

    and add the code in red:
    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);
          }
    
    // bof: show if products_id 193, 194, 195 or 196 are in the cart
          if (!IS_ADMIN_FLAG) {
            global $cart;
    
            $chk_products_in_cart = 0;
            $chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '192');
            $chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '193');
            $chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '194');
            $chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '195');
    
            $full_count = $_SESSION['cart']->count_contents();
    
            if ($chk_products_in_cart > 0 && $full_count == $chk_products_in_cart) {
              $this->enabled = true;
            } else {
              $this->enabled = false;
            }
          }
    // eof: show if products_id 193, 194, 195 or 196 are in the cart
    
          if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLAT_ZONE > 0) ) {
    Then, customize the file:
    /includes/modules/shipping/freeshipper.php

    Code:
          // enable only when entire cart is free shipping
          if (zen_get_shipping_enabled($this->code)) {
            $this->enabled = ((MODULE_SHIPPING_FREESHIPPER_STATUS == 'True') ? true : false);
          }
    
    // bof: do not show if products_id 193, 194, 195 or 196 are in the cart
          if (!IS_ADMIN_FLAG) {
            global $cart;
    
            $chk_products_in_cart = 0;
            $chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '192');
            $chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '193');
            $chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '194');
            $chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '195');
    
            if ($chk_products_in_cart > 0) {
              $this->enabled = false;
            }
          }
    // eof: do not show if products_id 12, 22, 27 or 122 are in the cart
    
          if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FREESHIPPER_ZONE > 0) ) {
    Now set the Flat Rate shipping rate to the cost for the Tube Products ...

    If you want to use USPS so that you have the USPS shipping rate for 0.9 to obtain all of the methods, you could customize that for the file:
    /includes/modules/shipping/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);
        }
    
    // bof: show if products_id 193, 194, 195 or 196 are in the cart
          if (!IS_ADMIN_FLAG) {
            global $cart;
    
            $chk_products_in_cart = 0;
            $chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '192');
            $chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '193');
            $chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '194');
            $chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '195');
    
            if ($chk_products_in_cart > 0) {
              $this->enabled = true;
            }
          }
    // eof: adjust weight if products_id 193, 194, 195 or 196 are in the cart
    
        if ($this->enabled) {
    Then change the code:
    Code:
        // usps doesnt accept zero weight send 1 ounce (0.0625) minimum
        $usps_shipping_weight = ($shipping_weight <= 0.0 ? 0.0625 : $shipping_weight);
    
    // bof: show if products_id 193, 194, 195 or 196 are in the cart
          if (!IS_ADMIN_FLAG) {
            global $cart;
    
            $chk_products_in_cart = 0;
            $chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '192');
            $chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '193');
            $chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '194');
            $chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '195');
    
            if ($chk_products_in_cart > 0) {
              if ($shipping_weight <= 0.0) {
                $usps_shipping_weight = 0.9;
              } else {
                $usps_shipping_weight += 0.9;
              }
            }
          }
    // eof: adjust weight if products_id 193, 194, 195 or 196 are in the cart
    
        $shipping_pounds = floor ($usps_shipping_weight);
    Last edited by Ajeh; 6 Jul 2011 at 05:28 AM. Reason: fixed flat.php code
    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!

  10. #10
    Join Date
    Mar 2009
    Location
    New York
    Posts
    157
    Plugin Contributions
    0

    Default Re: Shipping module setting weight independent of number of items ordered

    Vow I am amazed at the bounty. It will take me time to digest all this. Will report to you after testing it. Thanks a million. Donuts on their way.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v150 Does UPS module calculate by weight & number of items or just weight?
    By coucho in forum Addon Shipping Modules
    Replies: 4
    Last Post: 12 Dec 2012, 04:58 AM
  2. Shipping weight by number of items per box
    By cmrsf1 in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 17 Apr 2012, 06:30 PM
  3. Setting Default Weight for Items
    By JJMan1 in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 28 Jun 2011, 03:17 PM
  4. Shipping multiple items based on total weight, but need weight per box.
    By Nineve in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 2 Aug 2010, 07:42 AM
  5. Setting the number of Items on Index Page
    By field4000 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 28 Oct 2007, 02:16 AM

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