Page 1 of 3 123 LastLast
Results 1 to 10 of 22
  1. #1
    Join Date
    Oct 2012
    Posts
    7
    Plugin Contributions
    0

    Default Extra Order Fee not apply to certain products?

    Hi,

    I was asked by a client to add an additional fee for any orders going to a certain state (Western Australia) due to quarantine fees.

    They sell seeds, but they also have a couple of books they also sell which don't need the additional fee added and would like to remove the fee only from those products.

    Is this possible? Please note that my PHP skills are very limited, so if there's PHP editting involved, please specify exactly which file name and where to find it.

    I should also note they are running v1.3.9h.

    Thanks in advance,

    Lee

  2. #2
    Join Date
    Oct 2012
    Posts
    7
    Plugin Contributions
    0

    Default Re: Extra Order Fee not apply to certain products?

    Okay, I just had a thought... since there's only about 3 - 4 products that don't need the fee applied, would it be possible to edit the code in ot_extraorderfee.php to ignore those few product ID's?

    I've been staring at the file for half hour now and my PHP/SQL skills are far too limited to work out how to do this. Can anyone open up their copy of the file and see if they can see a way to do it? It would be greatly appreciated.

    Lee

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

    Default Re: Extra Order Fee not apply to certain products?

    What happens on a mixed cart that has those 3-4 Products and 3-4 other Products that do need to have the fee?
    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. #4
    Join Date
    Oct 2012
    Posts
    7
    Plugin Contributions
    0

    Default Re: Extra Order Fee not apply to certain products?

    The fee will still be applied. Basically, the company sells grass seeds. As long as there are grass seeds in the order, there needs to be a flat charge of $27 applied to the total order, no matter how many items are entered.

    Eg. 1 x 1kg bag of grass seed = $27 fee applied to total order
    1 x book = no fee applied
    1 x 1kg bag of grass seed + book = $27 fee applied to total order
    3 x 1kg bag of seed + 2 x 5kg bag of seed + 2 books + bottle of herbicide = $27 fee applied to total order

    If you get what I mean.

    I'm thinking the easiest way to do this would be to stop the fee applying to any categories apart from the 2 that contain grass seed products. Ie. There's only 4 active categories total and only 2 contain products that require the extra fee. As long as the fee is still applied even when a non-fee item is in the cart, that would work fine. I'm just not sure how to write it.

  5. #5
    Join Date
    Oct 2012
    Posts
    7
    Plugin Contributions
    0

    Default Re: Extra Order Fee not apply to certain products?

    Haha, I only just realized that you are the person who wrote this module! Luck is on my side if I have the modules creator helping me out!

    I'm thinking this query...

    Code:
    $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_ORDER_TOTAL_EXTRAORDERFEE_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
    ... could be edited to exclude a category id with something like "categories_id from categories". But seeing as that query is just selecting a zone, I'm not sure if it's possible to have it ignore a category or a product. That may have to be some kind of check that occurs just before the extra order fee is applied, for example (in pseudo-code) "if the category id from table category is equal to 1 or 3 then extra order fee equals null". Is this possible?

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

    Default Re: Extra Order Fee not apply to certain products?

    This can be done by checking the master_categories_id of the Products in the categories that should not have the fee (usually the categories_id) by customizing the code with the code in RED:
    Code:
    // eof: check zone and add extra fee
    
    // bof: add extra control
        // check the count of a specific field
        // if only products from master_categories_id 10 and 12 are in the cart then do not show
        $chk_cat = 0;
        // check how many Products are in the cart for master_categories_id 10 and 12
        $chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','10');
        $chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','12');
        // if these are the only Products then turn off the extra fee module
        if ($chk_cat > 0 && $_SESSION['cart']->count_contents() == $chk_cat) {
          $pass = false;
        }
    // eof: add extra control
    
            if ($pass == true) {
    NOTE: before using this new code, do you use this module with a Zone added to it for the extra order fee?
    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. #7
    Join Date
    Oct 2012
    Posts
    7
    Plugin Contributions
    0

    Default Re: Extra Order Fee not apply to certain products?

    Hi Ajeh,

    Thanks so much for your help. As it is set up currently, I have 2 zones defined. One for all of Australia (as they do not ship internationally) and another just for Western Australia (which the module is attached to). Will the above code still work in this situation or is there a workaround if not?

    Thanks again!

    Lee

  8. #8
    Join Date
    Oct 2012
    Posts
    7
    Plugin Contributions
    0

    Default Re: Extra Order Fee not apply to certain products?

    Whoo! It seems to work great, just had to replace the category ID's in your code with the ones I needed it to ignore in the clients site. Now all I need to do is find where to change the text for 'extra order fee' which I imagine is defined in languages somewhere. Thanks so much, I hope this helps others in the future too!

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

    Default Re: Extra Order Fee not apply to certain products?

    Thanks to you I have found a ... er ... umm ... bug in my code ...

    When you do not use a Zone ... the code breaks ...

    I kinda, sorta, forgot to check what happens when there isn't a Zone set and never made allowances for it ...

    Hate when I do that ... back to the drawing board and hope to get some new code posted soon to fix that ...
    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. #10
    Join Date
    Oct 2012
    Posts
    7
    Plugin Contributions
    0

    Default Re: Extra Order Fee not apply to certain products?

    Haha, well, glad I could help?

    When you fix it up, let me know, I wouldn't mind seeing what changes have been made. The client I'm using the plug in for will never have that problem though, so this still works perfectly for what they need. Thanks for the help by the way, I just paid them a visit and got today's pay from them

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. v151 Extra order email when order contains certain products
    By Dave224 in forum Managing Customers and Orders
    Replies: 1
    Last Post: 28 Apr 2013, 03:33 PM
  2. Can I apply a discount after a certain number of products are purchased?
    By bparker in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 3
    Last Post: 8 Aug 2011, 10:59 AM
  3. Apply Low Order Fee for only the difference missing
    By dimsumgurl in forum Managing Customers and Orders
    Replies: 2
    Last Post: 3 Sep 2010, 04:54 AM
  4. Eliminating low-order fee for certain products
    By bblinn in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 6
    Last Post: 14 Nov 2008, 02:42 PM
  5. Replies: 2
    Last Post: 9 Dec 2007, 02:14 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