Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20
  1. #11
    Join Date
    Dec 2008
    Posts
    26
    Plugin Contributions
    0

    Default Re: Cod fee calculated as integer

    I checked and changed the 4% by a fix amont, 4.25 euros. Then it shows 4.25 euros on cod fee and adds it correctly to the total amount during shipping process, including the 2 decimals.
    If I change it to the 4% it shows the cod fee correctly with 2 decimals, but the total amount still adds the integer of the 4%

    This has no sense for me.

    If you have some idea, please let me know. The problem is that here in Spain the couriers charge a % and not a fix amount (that obviously is easier).

    What about my other 2 questions? Is it possible to have maximum amont over is not shown the COD shipping option?
    Is Zen Cart able to do this?

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

    Default Re: Cod fee calculated as integer

    If you ever figure out why your calculation isn't working, you can just add a test on the value and set a limit to it ...
    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!

  3. #13
    Join Date
    Dec 2008
    Posts
    26
    Plugin Contributions
    0

    Default Re: Cod fee calculated as integer

    Hi, I do not understand quite well what you mean. How can I set a limit to the amount so the COD is not shown if the amout is higher than this?

    Also I have been checking, and the COD Fee is adding to the total strange numbers. Shipping and subtotals are added to the total correctly, including 2 decimals, except for Cod Fee.
    When it is a % it adds the integer. But I realized that when the % is less than 3, it was minimum 3.00 (remember the rule) and it shows correctly 3, but adds 4. This is a nonsense.

    The thing is that the Cod Fee is shown correctly on Payment Method and Confirm Order pages, also on the admin on the invoice etc, but the total amount is what is wrong.
    If the data of Cod Fee is shown correctly on the screen, that means that the added code to allow % is working fine, as it calculates ok the amount, but it is just on Total where it adds the amount wrong.
    Where is the file which tells the total which quantities have to pick up to make the calculation? Just to have a look at this to see if there is something wrong, and compare with the original ZenCart file to check if something has been modified.

    At the beginning, on those screens there were something odd, the tax was calculated twice, so finally they managed to fix this, but maybe they touch something else that is making the COD Fee working in a strange way.

    Thanks for your efforts.

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

    Default Re: Cod fee calculated as integer

    I am not sure why you are getting incorrect values on your charges ...

    When I order $100.00 and have a Flat Rate of $5.00 and the 4.25% on the Cod Fee $4.25 I get $109.25 ...

    Make sure that you are not using the (int) on the $cod_cost ... as that will drop the decimals ...
    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. #15
    Join Date
    Dec 2008
    Posts
    26
    Plugin Contributions
    0

    Default Re: Cod fee calculated as integer

    Hi again,

    I have been testing, as I was amazed that for rule of minimum 3 euros it as adding also 4. This is not the integer of 3, so I realized that it is adding always 4, despite the amount of the COD Fee.

    On payment pages, invoice etc it shows correctly the quantity of the x% I put on Cod Fee module, but then it adds x as a quantity and is not adding the % to the total.

    On the example attached, I put 5% for Cod Fee.
    On Cod Fee line, it shows correctly 9.28 (the 5% of the value of the purchase), but on total it is adding 5 (5 as integer instead of 5%).

    Why it is calculating and showing it correctly in one line, but it can not add it to the total correctly?
    Is there somewhere we can tell to the total to pick the correct quantity?
    Attached Images Attached Images  

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

    Default Re: Cod fee calculated as integer

    Humor me ... and post your code for this 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!

  7. #17
    Join Date
    Dec 2008
    Posts
    26
    Plugin Contributions
    0

    Default Re: Cod fee calculated as integer

    Hi,
    Here you are the code. I can not upload the php, so I zipped it.

    I did not test this but I was thinking a while ago. If the cod fee is showing correctly, but not being added to the total correctly (the total is still adding the number I put on the percentage value, maybe I should put the code allowing the % before? I mean now this extra code is on line 91, maybe it should be on previous lines? I was thinking that if the total is not taking into consideration the % maybe is because the code which deals for the total is read before the code of the percentage, and then the subtotal of the cod fee, that is why the cod fee shows well calculating the % and the total not?
    I do not know if I am being clear, but maybe you catch the idea?
    Attached Files Attached Files

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

    Default Re: Cod fee calculated as integer

    Could you move your custom code:
    Code:
    //				var_dump($_SESSION['cart']);exit;
    				if (strstr($cod_cost,'%')) {
    					$cod_cost = $_SESSION['cart']->total * ($cod_cost/100);
    					if ($cod_cost < 3) {
    						$cod_cost = 3;
    					}
    				}
    Above the line that reads:
    Code:
            if ($cod_country) {
    You have it too low in the 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!

  9. #19
    Join Date
    Dec 2008
    Posts
    26
    Plugin Contributions
    0

    Default Re: Cod fee calculated as integer

    Hi, Yes it works well now.
    See attachment. I am testing now with a COD Fee of 5%
    Thank you very much for your help.

    As commented before, here in Spain couriers calculate de COD Fee as a percentage of the purchase cost + shipping cost.
    Now my shop calculates the COD Fee from the purchase cost, but not including the shipping cost, that makes a slightly difference on the total from what I am advising them and what the courier is going to charge them, that may cause some confusion or maybe a return, as customers usually have the exact money ready for the courier.

    Can I add on the code the shipping cost somewhere so the COD Fee calculates the x% from (Purchase cost + shipping cost)?
    Attached Images Attached Images  

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

    Default Re: Cod fee calculated as integer

    You can write the code to make any calculation that you want ...

    Just add on the additional code in the same area to use the total plus the shipping in the calculation ...
    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 2 of 2 FirstFirst 12

Similar Threads

  1. v150 Need some Help in COD. COD fee depending on order price
    By bratsangels in forum Built-in Shipping and Payment Modules
    Replies: 20
    Last Post: 16 Sep 2012, 12:53 PM
  2. COD Fee
    By fotofx in forum Addon Payment Modules
    Replies: 3
    Last Post: 18 Jun 2009, 08:10 PM
  3. COD fee
    By nomadrw in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 22 Oct 2007, 08:27 PM
  4. COD Fee
    By Svanis in forum Basic Configuration
    Replies: 4
    Last Post: 23 Jun 2006, 02:31 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