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

    Default Cod fee calculated as integer

    Hi, I have a Cod fee of 4%, and on the paying process it shows correctly the purchase amount + cod fee = total amount, but on total amount the Cod fee is added as integer.
    Subtotal 88.10, Cod fee 3.52, total 92.10 (when it should be 91.62)
    If the Cod fee is less than 0.50, lets say 3.48 it adds 3, total 88.10 + 3 total 91.10.

    The cod fee is shown correctly, with their 2 decimal digits, but is added as an integer.

    Where can I change this to add the real amount?

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

    Default Re: Cod fee calculated as integer

    Be careful when configuring the COD Fee ot_cod_fee as there are multiple settings for multiple shipping modules ...

    What shipping module are you using?

    What setting are you using for it in the COD Fee ot_cod_fee 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!

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

    Default Re: Cod fee calculated as integer

    Hi,
    I am using zonetable shipping module
    On the ot_cod_fee module I have it as follows:
    ES:4% on:
    Cod fee for flat
    Cod fee for free shipping by default
    Cod fee for table
    Cod fee for zones

    The other fields are left as default

    Tax class: none

    But here I do not see any option for total to catch the real amount with 2 decimals. In fact it shows the correct amount as cod fee, but on total adds an integer.

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

    Default Re: Cod fee calculated as integer

    If you mean on ot_cod_fee.php I don't recall there being an option for a percentage ...
    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. #5
    Join Date
    Dec 2008
    Posts
    26
    Plugin Contributions
    0

    Default Re: Cod fee calculated as integer

    Hi, my ot_cod_fee.php (configured from the Admin, Modules, Order total modules, Cod fee (ot_cod_fee) allows me a percentage.
    This is the configuration I have on the admin
    COD Fee

    Display COD
    true

    Sort Order
    950

    COD Fee for FLAT
    ES:4%

    COD Fee for Free Shipping by default
    ES:4%

    COD Fee for Free Shipping Module - (freeshipper)
    CA:4.50,US:3.00,00:9.99

    COD Fee for Free-Options Shipping Module - (freeoptions)
    CA:4.50,US:3.00,00:9.99

    COD Fee for Per Weight Unit Shipping Module - (perweightunit)
    CA:4.50,US:3.00,00:9.99

    COD Fee for ITEM
    AT:3.00,DE:3.58,00:9.99

    COD Fee for TABLE
    ES:4%

    COD Fee for UPS
    CA:4.50,US:3.00,00:9.99

    COD Fee for USPS
    CA:4.50,US:3.00,00:9.99

    COD Fee for ZONES
    ES:4%

    COD Fee for Austrian Post
    AT:3.63,00:9.99

    COD Fee for German Post
    DE:3.58,00:9.99

    COD Fee for Servicepakke
    NO:69

    COD Fee for FedEx
    US:3.00

    Tax Class
    --none--

    I have to say, that I did not created my shop, there where a company who created the web, but they did not finish the job as expected, so we do not trust them anymore.
    I think the ot_cod_fee.php was slightly modified by them, as it charges a minimum or 3 euros if the cod fee is less than this, and the correct value if it is more than 3 euros.
    I do not know how COD works on USA. Here in Spain, almost all companies charge a minimum of 3 euros, and a percentage of the value 3-4 or 5%. If the x% is less than 3 euros, they charge you 3 euros. If it is more, then the % amount.

    The thing is that on the paying process it shows the cod fee correctly (calculating the % of the total products purchased) with thir 2 decimals, but on total it adds the cod fee integer instead of the real amount.

    Maybe this failiure is on the order total amount instead of the cod fee?
    Why the total is adding all subtotals with 2 decimals except of the Cod fee?

    Also I would like to know if there some option for maximum COD amount. I mean, the COD paying option only appear if the total purchase is less than lets say 150 euros. If it is more the COD paying option do not appear, just to avoid the risk of sending a lot of goods that are returned later, with the consequent transport costs. Also some couriers do not accept COD on parcels of more than x value.

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

    Default Re: Cod fee calculated as integer

    Unless you customized the code, COD Fee ot_cod_fee does NOT work with a percentage and it will take the number and change it to a dollar value so 10% will become $10.00 ...

    Did you customize the code to work with a percentage?
    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. #7
    Join Date
    Dec 2008
    Posts
    26
    Plugin Contributions
    0

    Default Re: Cod fee calculated as integer

    Hi again, and happy new year.
    I have been comparing my ot_cod_fee.php with the original ZenCart file, and I found the following difference:
    // var_dump($_SESSION['cart']);exit;
    if (strstr($cod_cost,'%')) {
    $cod_cost = $_SESSION['cart']->total * ( (int)$cod_cost/100);
    if ($cod_cost < 3) {
    $cod_cost = 3;
    }
    }
    I think this code allows the percentage and a minimum 3 euros charged on COD fee.

    Does the (int) shown on the code something to do with integer?

    I have another question.
    Now my COD fee is calculated from a percentage of the value of the goods, but then the courier calculates this percentage from the total amount including the shipping cost, so my total does not match with the amount the courier charges to the customer, with the consequent confusion of the customer who has ready the money at their home.

    i.eg. Value of the goods: 123
    Shipping cost: 6
    COD Fee: 4.92
    Total: 133.00 (123+6+5 (integer of 4.92)

    This amount is not correct because:
    Cod Fee is 4.92 and it adds 5.00
    Cod Fee should be 5.16, the 4% of 123+6 (129), and not 4.92, the 4% of 123

    So the 3 questions I have now is:
    1- Can the COD Fee be added to the toal as 4.92 instead of 5?
    2- Can the COD Fee calculate the percentage using the subtotal of Value of goods + Shipping cost?
    3- Can I state a maximum amount for COD, so the COD option does not appear as paying method if the total purchase is more than x?

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

    Default Re: Cod fee calculated as integer

    If you change the code:
    Code:
    $cod_cost = $_SESSION['cart']->total * ( (int)$cod_cost/100);
    to read:
    Code:
    $cod_cost = $_SESSION['cart']->total * ($cod_cost/100);
    do you find it works better for you?
    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. #9
    Join Date
    Dec 2008
    Posts
    26
    Plugin Contributions
    0

    Default Re: Cod fee calculated as integer

    No, it still calculates an integer.
    some idea?

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

    Default Re: Cod fee calculated as integer

    I am not sure what is wrong with your module without seeing the whole thing as I am getting:

    Sub-Total: $123.00
    Flat Rate (Best Way): $5.00
    COD Fee: $4.92
    Total: $132.92
    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 1 of 2 12 LastLast

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