Payment section not being skipped in Eshop


  • Default avatar
    david29    
     8 years ago
    0

    Hi Seyi,

    A few months ago you helped sort out a problem on my site, where Step 5 (Payment Step) was not being skipped when cart value was at 0 (normally Step 5 should be skipped when cart value at 0). Your fix was to add the following to the file: components/com_eshop/models/checkout.php

    $this->total = round($total,4); # seyi_code


    I have downloaded the latest eshop version and am having same issue, even though your fix on decimal places remains in place. Would you mind taking a look at my development site if I send you the login details via email? That would be greatly appreicated.


    BR
  • Your avatar
    seyi    
     8 years ago
    0

    Hello,

    Thanks for the access. Just ran a test and it worked fine for me, skipping the payment section.

    Cart:
    WiMmagnolia €18.49
    Shipping: €9.95
    Vat: €3.51
    Total Discount: -€31.95
    Total: 0

    Skipped payment method and went straight to confirmation
  • Default avatar
    david29    
     8 years ago
    0

    Hi Seyi,

    Many thanks for looking.
    This is strange as the shop transaction I did with a higher value did not work. If you do not mind, I will send you by email the transation details I made so you can repeat the error I found.

  • Default avatar
    david29    
     8 years ago
    0

    Hi Seyi,

    I'm sure you're pretty busy, but wondering if you can look at the email I sent to you before this weekend? I sent you a specific shop transaction to try so you can replicate the issue.

    BR
  • Your avatar
    seyi    
     8 years ago
    0

    Hello,

    Had a look. The order total after applying the coupon and getting the free shipping is 0.00098999999999982.

    The code I gave you rounds to 4 decimal places, which then brings the total to 0.001. This is still above 0.

    So I would suggest to round it to 2 decimal places, since this is what a customer would pay for anyway:

    <?php
    $this
    ->total        round($total,2); # seyi_code
    ?>


    That skips the payment eethod fine. One last note, I did test another coupon than the one you gave me, without making any code changes and it worked just fine. So it must be a very special case that is causing this.
  • Default avatar
    david29    
     8 years ago
    0

    Hi Seyi,

    It's great you had a look. Thanks again for that.
    In the backend of Eshop I have to use 3 decimal places for my shop product prices. Eshop is pretty backward with mathematics, and does not allow you to enter whole numbers for prices including VAT.

    So for example, a product in backend will have the price 16.807 EUR (+19% = 20EUR). If you enter just 16,81 EUR for net price, then the final price is 19,99555555 (which causes problems!). The only way around this silly system is to enter 3 decimal places for Net prices.

    So my question is, in your code can I enter 2 decimal places instead of 4, or should I use 3 decimal places? I am not sure how the decimal palce in the checkout coding effects the front end for product prices.

    Thanks in advance

  • Your avatar
    seyi    
     8 years ago
    0

    Hi David,

    Ok, I understand. No I do not think it will have an effect in the front end, changing to 2 decimal places. The customer does not pay for 3 digits, they pay in the end 2 digits. So I believe it is fine to round the final total to 2 digits.
  • Default avatar
    david29    
     8 years ago
    0

    Hi Seyi,

    Ok that is great. I stay at 2 decimal places and will do some testing. Thanks again for your fast support.