Page 36 of 53 FirstFirst ... 26343536373846 ... LastLast
Results 351 to 360 of 522
  1. #351
    Join Date
    Apr 2011
    Location
    Colonial Beach Virginia
    Posts
    8
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    I am trying to configure the USPS options so that Media Mail will only be given as an option when the products are books, CD or DVD but not on other products. If this is posted elsewhere I cant find it.

    I can put these into a single "Media" master category if needed.

    This is a new install
    No add ons
    And I am very green here

    If this is already covered somewhere else I would appreciate if someone can point me there.

  2. #352
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,713
    Plugin Contributions
    6

    Default Re: Different shipping methods for different categories

    Let's say all Products that allow the Media are in Categories 10, 12 and 15 ...

    You can customize the shipping module:
    /includes/modules/shipping/usps.php

    You could do a test and see when Media should show, something like:
    Code:
              $cost = preg_replace('/[^0-9.]/', '',  $cost);
    $chk_media = 0;
    $chk_media += $_SESSION['cart']->in_cart_check('master_categories_id','10');
    $chk_media += $_SESSION['cart']->in_cart_check('master_categories_id','12');
    $chk_media += $_SESSION['cart']->in_cart_check('master_categories_id','15');
    
    if ($chk_media == $_SESSION['cart']->count_contents()) {
      // all media content
      $chk_media_only = true;
    } else {
      $chk_media_only = false;
    }
    if ($type != 'MEDIA' || ($type == 'MEDIA' && $chk_media_only)) {
    //  echo 'YES USPS ' . $type . ' count: ' . $chk_media . ' vs ' . $_SESSION['cart']->count_contents() . '<br>';
              $methods[] = array('id' => $type,
                                 'title' => $title,
                                 'cost' => ($cost * $shipping_num_boxes) + (MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_USPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_USPS_HANDLING) );
    } else {
    //  echo 'NO USPS ' . $type . ' count: ' . $chk_media . ' vs ' . $_SESSION['cart']->count_contents() . '<br>';
      // do not show
    }
            }
    
            $this->quotes['methods'] = $methods;
    
    Now, MEDIA will only show if the total contents of the cart comes from master_categories_id 10, 12 and 15 ...

    NOTE: be sure you are using the current USPS January 2, 2011 C version of usps.php from post #26:
    http://www.zen-cart.com/forum/showth...S+January+2011
    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 ...

  3. #353
    Join Date
    Jan 2005
    Posts
    3
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    Hi all.
    sorry I can't bring myself to read thru all 33 pages of this thread to see if my needs are answered somewhere.

    client site is here: www.allaboutthewish.com/store in demo/test mode.

    the bottles all ship by UPS. fine good. works great.
    the bottles come with a start up set of papers and stuff that are included in the box. weight is adjusted for that. still all good.

    owner wants to have just the custom engraved brass plates that are ordered separate from bottles, ship at flat rate of $2.50 (via USPS) as she has to send out to have those done separately, then she just drops in the mail when they come back to her.

    I could use the code from the very first solution in the thread for the accessories category, but there are the chocolates (which is another whole issue..get to that in a sec.) obviously I could create a category just for the nameplates...but she's picky about all the accessories be in accessories...

    here's what I figured out so far. I enabled the Free Shipping module and just assigned it to the brass plates. and assigned a handling charge of $2.50 in the edit box for Free Shipping in the admin. this does the job, but its odd to see Free Shipping $2.50 on the checkout screen. so I could find the lang file def. (if that's where it is) and change it to something else.
    or I could just add $2.50 to the price and put 0 in as the shipping/handling fee.

    but the issue is, what if the client or someone else with no clue how to use the admin, needs to add another product, that ships at a different flat rate?

    is there a module or an add on or something that lets you put in the individual items' unique shipping charges, or select a shipping method for that product only, on the product details page?
    could this be something that is built into future versions?????

    I shudder to think how long it would take me to find all the proper files to edit the code to make it happen, and how many things I could break in the process, being a completely self taught trial and error PHP duffer...

    any other ideas are welcome...

    oh the chocolates, she wants an option for them to request an ice pack in warm weather which would add a cost and weight and up shipping charge accordingly. only thing I can think of is to add the ice pack as a product. then try to figure a way to ask customer on checkout if they'd like to add one to their cart (only if they order the chocolates) before final checkout?

    thanks.
    Stan

  4. #354
    Join Date
    Apr 2011
    Location
    Colonial Beach Virginia
    Posts
    8
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    Quote Originally Posted by Ajeh View Post
    Let's say all Products that allow the Media are in Categories 10, 12 and 15 ...

    You can customize the shipping module:
    /includes/modules/shipping/usps.php

    You could do a test and see when Media should show, something like:


    Now, MEDIA will only show if the total contents of the cart comes from master_categories_id 10, 12 and 15 ...

    NOTE: be sure you are using the current USPS January 2, 2011 C version of usps.php from post #26:
    http://www.zen-cart.com/forum/showth...S+January+2011
    Thank You! That Works Great!!! I Do have to add each subcategory as well. It will not allow off category items. Even with free shipping. But that is something I can live with. People love cheap shipping and this should greatly enhance book and media sales I am almost there! http://www.lenandmarcys.com/cart/

  5. #355
    Join Date
    Apr 2011
    Posts
    3
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    I've read the entire thread, believe it or not. It seems true that is impossible for Zencart to cater for everybody's specific shipping needs as standard.

    My UK-based store has four product types in four categories.

    As I ship internationally, I need to have a separate pricing for each of the 'zones' : UK, Europe and Row and currently use the Zone Rates shipping.

    Currently, I have assigned each product with a weight according to its category.

    Problem: The total shipping cost is given according to the weight: price as defined rather than calculating the shipping cost of products from category A's shipping PLUS products from category B's shipping.

    To overcome this, I ran a script that generates all the possible combination of products from the different categories up to a quantity of 10 and inserted the generated rules in to the Zone Rates Shipping Table. Crude, yes I know and its limitations are obvious but it does work.

    However, I have never been happy with this clumsy solution and have been wondering if there is a better alternative:

    Maybe cloning a shipping module for each of the UK,European and RoW destinations and changing the code to detect which country the order is being shipped to and then be disabled/enable appropriately?

    I came across this code to allow for the total shipping cost to be the sum of each of the cart's products' categories:
    Code:
    / class methods
    function quote($method = '') {
    global $order, $total_count;
    
    // i ignore free shipping items.. all items are priced not matter what.
    //$total_count = $total_count - $_SESSION['cart']->free_shipping_items();
    
    // each array item is another array consisting of the product name, it's base shipping cost,
    // the price of each extra unit shipped, and the IDs of each product in that price category.
    $product_chart = array(
    'smallmatted' => array(
    'base' => 6,
    'extra' => 1,
    'ids' => array(1106, 1108, 1110, 1131, 1133, 1127, 1129)
    ),
    'largematted' => array(
    'base' => 7,
    'extra' => 1,
    'ids' => array(1107, 1109, 1111, 1128, 1132, 1134, 1130)
    ),
    'canvasrolled' => array(
    'base' => 8,
    'extra' => 1,
    'ids' => array(1135, 1137, 1140, 1142, 1143, 1146, 1148, 1150, 1152)
    ),
    'smallframed' => array(
    'base' => 24,
    'extra' => 4,
    'ids' => array(191, 192, 193, 194, 195, 196, 197, 198, 188, 189, 190, 1151, 1147)
    ),
    'mediumframed' => array(
    'base' => 45,
    'extra' => 5,
    'ids' => array(1136, 1141, 1147)
    ),
    'largeframed' => array(
    'base' => 75,
    'extra' => 10,
    'ids' => array(1138, 1139, 1144, 1145, 1149)
    );
    
    $cost = 0;
    
    // calculate the cost based on quantity
    foreach ($order->products as $product) {
    $product_id = explode(':', $product['id']);
    $product_id = $product_id[0];
    
    foreach ($product_chart as $product_type => $product_details) {
    if (in_array($product['id'], $product_details['ids'])) {
    $qty = $product['qty'];
    $cost += $product_details['base'] + $product_details['extra'] * ($qty - 1);
    }
    }
    }
    
    $this->quotes = array(
    'id' => $this->code,
    'module' => 'Shipping',
    'methods' => array(
    array(
    'id' => $this->code,
    'title' => MODULE_SHIPPING_MINE_TEXT_WAY,
    'cost' => $cost
    )
    )
    );
    This accommodates a lot of my needs, but does not offer the ability to have different prices according to the final destination.

    Which variables or constants do I need to reference to detect the destination country and compare to a list of countries?

    Each category needs a base shipping price and a price for additional products. (e.g. 1 item from category A costs £2.50 to ship, each additional item a further 0.50p) and these costs need to differ according to the destination.

    Am I over-complicating this? Any advice/solutions would be much appreciated.

  6. #356
    Join Date
    Apr 2011
    Posts
    3
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    I came up with a solution -

    I had to strip out the cloned shipping module and create a new code that:

    Defined base and additional prices for each category depending upon shipping destination.

    Found the product in cart with highest base price.

    Upon that base price, added only the 'additional * qty' prices for every other item in the cart.

    It is behaving how I wanted, the only draw-back being that the shipping module config in zencart admin has no effect as the new shipping module has been effectively hard coded.

    Thanks

  7. #357
    Join Date
    Apr 2008
    Posts
    184
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    I was able to solve one of my problems so I'm sharing the code I came up with here in case someone is having the same problem I'm having.

    I'm using the USPS module and the Insurance Optional module. In one of my stores I offer free shipping over $65 up to $200 (at $200 the insurance optional kicks in as that's where minimum wholesale orders start). The problem is for whatever reason ot_insurance.php calculates and charges shipping regardless of the my selection of not charging insurance on free shipping and Amount Exempt From Fee. Quite annoying if you ask, having to explain my clients why am I charging insurance if I'm offering free shipping, makes no sense. Since I wasn't able to figure out how to solve the insurance optional mode I edited instead the USPS module. So my solution was to add an if statement to add insurance up to $200 directly on the usps.php module so any shipping charges will reflect the insurance cost already calculated based on the shopping cart subtotal.

    locate
    HTML Code:
              $cost = preg_replace('/[^0-9.]/', '',  $cost);
              $methods[] = array('id' => $type,
                                 'title' => $title,
                                 'cost' => ($cost * $shipping_num_boxes) + (MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_USPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_USPS_HANDLING) );
    
            }
    and change for
    HTML Code:
              $cost = preg_replace('/[^0-9.]/', '',  $cost);
    //MANUELA added to charge insurance up to 200 due to the problem with insurance optional module
                if ($order->info['subtotal'] <= 50) {
                $insurance_charge = 1.80; 
                } elseif (50.01 - 100) {
                $insurance_charge = 0.50;
                } elseif (100.01 - 200) {
                $insurance_charge = 0.55;
                }
              $methods[] = array('id' => $type,
                                 'title' => $title,
                                 'cost' => ($cost * $shipping_num_boxes) + $insurance_charge + (MODULE_SHIPPING_USPS_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_USPS_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_USPS_HANDLING) );
    
            }
    I don't know much of PHP, but it works for what I need.

    This change charges $1.80 insurance fee for orders subtotaling $50 or less, $0.50 for orders subtotaling 50.01 - 100, which makes the current $2.30 mark for insurance and $0.55 more for orders subtotaling 100.01 - 200, for the $2.85 mark up to $200. After $200 the insurance optional module kicks in and does the rest.

    For now it works, until I find a better solution for my predicament.

    If anyone can improve the code, please do so and post the changes so we can all benefit.

    Hope this helps someone else!
    M.Valenti
    Contemporary Artist - Entrepreneur
    http://www.manuelavalenti.com - http://www.byvalenti.com

  8. #358
    Join Date
    May 2009
    Posts
    7
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    Hi,
    I have been reading this lengthy thread for 2 days now but can't find what I need. Can someone help?

    In my store I have:

    1. Tickets that can be purchased to an event
    There is a $5 booking fee for these regardless of how many tickets are added to the cart. Tickets are all in the category "Tickets" (cat #20) within sub categories: cat #21, 22, 23. The $5 is to be applied when any of the products from cat #21 and/or 22 and/or 23 are in the cart. (ie. a flat $5 per order, not $5 per ticket).

    2. DVD's
    These must be posted and postage cost is $7 per DVD. DVD's are all in the category "DVDs" (cat #30) within sub categories (#31, 32, & 33).

    3. Downloads
    These are downloadable so do not incur a shipping fee. Downloads are all in the category "Downloads" (cat #40) within sub categories (cat #41,42)

    So, for example, if a customer adds to their cart:

    • 2 x tickets (1 from cat #21 and 1 from cat #22)
    • 1 x DVD (from cat #32)
    • 2 x downloads (1 from cat #41 and 1 from cat #42)

    Then the total "shipping" cost will be $5 (ticket booking fee) and $7 (DVD postage) = $12.

    Or - if a customer adds to their cart:

    • 1 x DVD (from cat #32)
    • 2 x downloads (1 from cat #41 and 1 from cat #42)

    Then the "shipping" cost will be $7 (DVD postage) only.

    I have enabled the "Flat Rate" module for the booking fee but need to know how to limit this to apply ONLY when tickets are added to the cart.

    I'm assuming that I can use the "Per Item" module for the DVD's and Downloads but need to know how to apply this only when products from those categories are in the cart.

    Any help VERY MUCH APPRCIATED!!!!

  9. #359
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,713
    Plugin Contributions
    6

    Default Re: Different shipping methods for different categories

    If you only have DVDs and Tickets to calculate the charge on, you could customize the code in Flat Rate flat with:
    Code:
        function quote($method = '') {
          global $order;
    
    global $cart;
    $chk_dvd = 0;
    $chk_dvd += $_SESSION['cart']->in_cart_check('master_categories_id','31');
    $chk_dvd += $_SESSION['cart']->in_cart_check('master_categories_id','32');
    $chk_dvd += $_SESSION['cart']->in_cart_check('master_categories_id','33');
    $chk_dvd = $chk_dvd * 7.00;
    
    $chk_tickets = 0;
    $chk_tickets += $_SESSION['cart']->in_cart_check('master_categories_id','21');
    $chk_tickets += $_SESSION['cart']->in_cart_check('master_categories_id','22');
    $chk_tickets += $_SESSION['cart']->in_cart_check('master_categories_id','23');
    $chk_tickets = ($chk_tickets > 0 ? 5.00 : 0.00);
    
    
    $cost = $chk_dvd + $chk_tickets;
          $this->quotes = array('id' => $this->code,
                                'module' => MODULE_SHIPPING_FLAT_TEXT_TITLE,
                                'methods' => array(array('id' => $this->code,
                                                         'title' => MODULE_SHIPPING_FLAT_TEXT_WAY,
                                                         'cost' => MODULE_SHIPPING_FLAT_COST)));
    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 ...

  10. #360
    Join Date
    May 2009
    Posts
    7
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    Thanks Linda, your help is appreciated.

    My only problem is that, with your suggested code, if I ever enter another product into the DVD category, or if my DVD's have different postage costs (ie: boxed sets) then I would have to hardcode each postage value and category into flat.php, although I thank you for the suggestion - this won't work for me.

    I guess what I'm after is a means of saying:

    1. If any tickets are present in the cart then add a flat $5.00 booking fee.
    2. If anything else is present in the cart then apply the postage cost for the individual product


    I'm assuming that I can use the "flat" shipping module to cover the tickets and the "per item" shipping module to cover everything else. Just need to know how to apply one or both depending on what's present in the cart. I'll keep working on it!

    Thanks

 

 
Page 36 of 53 FirstFirst ... 26343536373846 ... 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
  •