Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Oct 2012
    Posts
    282
    Plugin Contributions
    0

    Default Trying to add a one-time per order $25 HazMat fee, what files calculates the sub-tota

    I'm trying to add a One-Time Per Order $25 HazMat fee to the shopping cart sub-total. First i tried to add to $cartShowTotal in tpl_shopping_cart_default, but couldn't of course because i did a var_dump and see that it is a string. and the var name itself it hints it is for display purposes only(?).

    i know that this is a heady question, but where would i find the heart of the shopping cart calculator? or, the file that performs the shopping cart sub-total as it gets put onto the tpl_shopping_cart_default page?

    i did look in ...
    modules/pages/shopping_cart/header_php.php

    and see $cartShowTotal equals show_total().

    i know i'm in over my head but i have to do this ;-)

    big thanks,

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Trying to add a one-time per order $25 HazMat fee, what files calculates the sub-

    Why not clone an existing order-total module and rename it to HazMat Fee, and have it fire only when your custom field 'hazmat' is flipped on?

    Perhaps something like the "Delivery Area Surcharge" mod http://www.zen-cart.com/downloads.php?do=file&id=52
    or one of the credit-card-surcharge mods http://www.zen-cart.com/downloads.php?do=file&id=755 or http://www.zen-cart.com/downloads.php?do=file&id=552
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Oct 2012
    Posts
    282
    Plugin Contributions
    0

    Default Re: Trying to add a one-time per order $25 HazMat fee, what files calculates the sub-

    okay i'll look into but the HazMat isn't as simple as stated. there are 2 varieties, a $25 and a $49. and if the order is $300 or over it gets ixneh'd. etc. etc.

    then there is a pyro-agreement and shipping considerations....!

    i really need a Global $HazMat var for several reasons. if i could get that to happen on the shopping cart sub-total page i'd be half-way there, knowwhatahmean?

    thanks

  4. #4
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,622
    Plugin Contributions
    123

    Default Re: Trying to add a one-time per order $25 HazMat fee, what files calculates the sub-

    Instead, try starting with the low order fee module in includes/modules/order_total.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Trying to add a one-time per order $25 HazMat fee, what files calculates the sub-

    doh! I meant to suggest that one too.

    But it too doesn't show the "fee" on the shopping-cart page. That's a whole different beast than just building an OT module.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Oct 2012
    Posts
    282
    Plugin Contributions
    0

    Default Re: Trying to add a one-time per order $25 HazMat fee, what files calculates the sub-

    if you all think of anything else, please let me know. i'm a little stumped at the moment.

    i wanted the Global Var, a $HazMatStat of either 1 of 2, so i could then show a pyro agreement,
    and also, i really need to show the amount on the subtotal,

    thanks a lot

  7. #7
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Trying to add a one-time per order $25 HazMat fee, what files calculates the sub-

    Are you still using attribute-based selections like you were discussing in this other thread? http://www.zen-cart.com/showthread.p...-added-to-cart
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

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

    Default Re: Trying to add a one-time per order $25 HazMat fee, what files calculates the sub-

    No it didn't work for the HazMat. though we're using attributes for all kinds of other things.

    if you buy 2 six inch electric matches it works but if then buy a 12-inch electric match it applies the one-time charge twice. the charge needs to be one per cart order.

    additionally, HazMat2 ($49) needs to cancel out HazMat1($25) and if the order is $300 or above,
    they both get dropped.

    thanks for your help.

  9. #9
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Trying to add a one-time per order $25 HazMat fee, what files calculates the sub-

    Quote Originally Posted by tcarden View Post
    if you buy 2 six inch electric matches it works but if then buy a 12-inch electric match it applies the one-time charge twice. the charge needs to be one per cart order.

    additionally, HazMat2 ($49) needs to cancel out HazMat1($25) and if the order is $300 or above,
    they both get dropped.
    - Any other specs this "feature" needs to accomplish?
    - And is it a "must" that it appear on the shopping-cart page? or is it acceptable to show in the order-totals area on checkout-payment and checkout-confirmation and order-history?
    - How are you currently specifying that a product requires one fee or the other? Just a single additional product field?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #10
    Join Date
    Oct 2012
    Posts
    282
    Plugin Contributions
    0

    Default Re: Trying to add a one-time per order $25 HazMat fee, what files calculates the sub-

    yes, a single additional column in the products table. hazmat_status. it's either 1, 2 or Null.

    i'm not the site owner but it probably okay it were just to appear at the order's total area and not sub-totals page.

    there is one requirement though, which is partly a front-end thing, but i need something to trigger a pyro-agreement div w/ checkbox and was planning on trying to create a Global Var to do so. like...
    if ($HazMat == true) { echo '<div id="pyro-agreement".....} something like that.

    and then if they didn't check the box, some JS would disable the checkout button, or entire form. something like that. or it would be even better to capture the checkbox if checked and put into the orders table, if there is such a thing, .. record it somehow.

    thanks again Dr. Byte

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Need to add per item fee (based on category) to the ups module
    By timhersh in forum Built-in Shipping and Payment Modules
    Replies: 21
    Last Post: 2 Dec 2016, 07:36 PM
  2. My hazmat one-time fee is not being factored into price when added to cart
    By tcarden in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 31 Jan 2013, 07:21 PM
  3. one time fee per specific # ordered. how?
    By CheapStairParts in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 16 Oct 2007, 05:21 PM
  4. Charge a one-time shipping and handling fee per order
    By dharma in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 30 Apr 2007, 03:36 PM
  5. Added charge, one-time deposit/fee, minimum order
    By Pozitech in forum Managing Customers and Orders
    Replies: 2
    Last Post: 7 Nov 2006, 03:40 PM

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