Page 53 of 56 FirstFirst ... 3435152535455 ... LastLast
Results 521 to 530 of 552
  1. #521
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Different shipping methods for different categories

    Quote Originally Posted by Mack32 View Post
    Anyone!
    The solution to your problem is in the examples already provided in this thread. You basically need to adapt the instructions to suit your own particular needs. There is (and cannot) be a set of instructions that will suit everyone because no two stores are alike.

    The important thing to remember is that you'll need to make changes to each of your shipping modules, and then add your own tests/checks to set/unset the $this->enabled variables depending on the outcomes of the tests.

    If you can't follow the examples given in this thread, there are many other threads with similar (but different) examples.

    Cheers
    Rod

  2. #522

    Default Re: Different shipping methods for different categories

    Quote Originally Posted by RodG View Post
    The solution to your problem is in the examples already provided in this thread. You basically need to adapt the instructions to suit your own particular needs. There is (and cannot) be a set of instructions that will suit everyone because no two stores are alike.

    The important thing to remember is that you'll need to make changes to each of your shipping modules, and then add your own tests/checks to set/unset the $this->enabled variables depending on the outcomes of the tests.

    If you can't follow the examples given in this thread, there are many other threads with similar (but different) examples.

    Cheers
    Rod
    Thanks anyway. Figured it out.

    Mack

  3. #523
    Join Date
    Apr 2008
    Posts
    446
    Plugin Contributions
    1

    Default Re: Different shipping methods for different categories

    Hello everyone.
    I'm having a problem with the new USPS module.

    This is what we used to have that doesn't work anymore.

    We ship, priority all our products throughout the US, Canada and International, but one of our products (perfumes) due to restrictions is shipped only within the US via Parcel (standard).

    The way we had it set up with rules gathered from this thread, we were able to turn on or off the shipping options depending on the product ID. Now with the new usps.php file the changes didn't work any longer, so we decided to clone the usps.php file (uspsperfumes.php), but of course we have problems.

    We've been trying to add the statements to turn on or off if certain products ID's are in the shopping cart, and that part works as long as the customers has a US shipping address. The moment an international customer comes along, the customer only sees the select a shipping method message and no shipping options are provided. The way it worked before, it would show an international customer a message telling them to remove the perfume from the shopping cart because perfumes are not shipped internationally. No matter what we don't get the same results and we haven't been able to figure out what's going on, so if anyone could help us visualize the problem that would be great.

    I tried posting the entire uspsperfume.php file, but I get an error that my post is too long.


    This is the code we added to the usps.php file
    PHP Code:
          // CUSTOMIZED CONDITIONS GO HERE
          // Optionally add additional code here to change $this->enabled to false based on whatever custom rules you require.
          // -----
            
    if (IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('products_id','116') > 0) {
              
    $this->enabled false;
            }
            if (
    IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('products_id','114') > 0) {
              
    $this->enabled false;
            }
          
    // -----
          // eof: optional additional code 

    This below is the code we added to the cloned usps file uspsperfume.php
    PHP Code:
          // CUSTOMIZED CONDITIONS GO HERE
          // Optionally add additional code here to change $this->enabled to false based on whatever custom rules you require.
          // -----
            
    if (IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('products_id','114') > 0) {
              
    $this->enabled true;
            }
            if (
    IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('products_id','116') > 0) {
              
    $this->enabled true;
            } else {
              
    $this->enabled false;
            }
          
    // -----
          // eof: optional additional code 
    It is possible we might have not cloned the usps.php file the right way, but I can't figure out where the damage might be.

    Thanks for the help.

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

    Default Re: Different shipping methods for different categories

    Your first IF is saying IF category 14 is in the cart set to true ...

    Your second IF is saying IF category 16 is in the cart set to true else set to false so that it overrules the results of the first IF for category 14 when category 16 is not in the cart ...

    More or less between the two IFs you have to have both category 14 and category 16 in the cart at the same time to get true or at least category 16 in the cart to get true ...

    You need to test for both conditions and based on the combined results of both conditions then determine if it should be true or false ...

    Something like:
    Code:
      $chk_cats = 0;
      $chk_cats = $_SESSION['cart']->in_cart_check('products_id','114');
      $chk_cats += $_SESSION['cart']->in_cart_check('products_id','116');
      if ($chk_cats > 0) {
        $this->enabled = true;
      } else {
        $this->enabled = false;
      }
    NOTE: you should not need to test for IS_ADMIN_FLAG as that is tested already for you a few lines above ...
    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. #525
    Join Date
    Apr 2008
    Posts
    446
    Plugin Contributions
    1

    Default Re: Different shipping methods for different categories

    Thank you Ajeh for the quick reply!!!!

    I made the changes.

    This on the usps file
    PHP Code:
    $chk_cats 0;
      
    $chk_cats $_SESSION['cart']->in_cart_check('products_id','114');
      
    $chk_cats += $_SESSION['cart']->in_cart_check('products_id','116');
      if (
    $chk_cats 0) {
        
    $this->enabled false;
      } 
    this on the usps clone file (uspsperfume)
    PHP Code:
            $chk_cats 0;
              
    $chk_cats $_SESSION['cart']->in_cart_check('products_id','114');
              
    $chk_cats += $_SESSION['cart']->in_cart_check('products_id','116');
              if (
    $chk_cats 0) {
                
    $this->enabled true;
              } else {
                
    $this->enabled false;
              } 
    Still not working as it should.
    Local customers now see 2 shipping options although only 1 should display. P
    I have not selected to show standard post on usps.php but yes on uspsperfume.php and yet it's displaying that option on the shopping cart for both (?)

    International customers still don't see the error message asking them remove perfume from the cart, but the select a shipping method and no shipping method shows.

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

    Default Re: Different shipping methods for different categories

    Could you Zip your files for:
    usps.php
    uspsperfume.php

    and attache them here?
    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. #527
    Join Date
    Apr 2008
    Posts
    446
    Plugin Contributions
    1

    Default Re: Different shipping methods for different categories

    I hope I did it right.
    usps.zip
    M.Valenti
    Contemporary Artist - Entrepreneur
    http://www.manuelavalenti.com - http://www.byvalenti.com

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

    Default Re: Different shipping methods for different categories

    Which shipping module do you want to run if:
    $chk_cats = 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!]
    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. #529
    Join Date
    Apr 2008
    Posts
    446
    Plugin Contributions
    1

    Default Re: Different shipping methods for different categories

    If those two product IDs are not in the cart usps.php should run for both national and international and uspsperfume.php should not run.
    If those two product IDs are in the cart for US customers, usps.php should stop running and only uspsperfume.php should run.
    If those two product IDs are in the cart for international customers, uspsperfume.php should not run, and usps.php should launch TEXT_NO_SHIPPING_AVAILABLE message, which we have set up with the remove perfume from shopping cart so the shipping can be selected if, and only if, no perfumes are in the cart.

    That's the logic we used to have, that's not working.

    I'm wondering if we might need to clone usps.php for international as well??

    Thanks for looking into it.

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

    Default Re: Different shipping methods for different categories

    What setting differences are you using on:
    usps

    verses the settings on:
    uspsperfume

    Do you have any Zone Settings on either module?
    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!

 

 
Page 53 of 56 FirstFirst ... 3435152535455 ... LastLast

Similar Threads

  1. Re: Different shipping methods for different categories
    By kaddie in forum Built-in Shipping and Payment Modules
    Replies: 14
    Last Post: 19 Nov 2010, 04:37 AM
  2. Replies: 2
    Last Post: 27 Oct 2010, 01:45 PM
  3. Different shipping methods for different categories and mixed categories
    By neit in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 10 Aug 2010, 12:20 AM
  4. Separate Shipping Methods for Different Categories
    By MortalWombat in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 28 Jul 2010, 08:57 AM
  5. Different shipping methods for different product types?
    By talisman-studios in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 17 Sep 2008, 04:59 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