Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter Ferhat1986

    (@ferhat1986)

    It seems like there is a bigger issue with setting the decimals to 0 in WooCommerce and the problem isn’t really in the Mollie plugin but rather in the way WooCommerce handles decimals with this setting.

    Instead of using the WooCommerce setting “Number of decimals” and setting it to 0, i used a WooCommerce filter to trim the zeros:

    add_filter( 'woocommerce_price_trim_zeros', '__return_true' );

    This way the user will only see decimals in VAT, shipping costs and at the total order price. In my case “Cart” & “Checkout” pages.

    Thread Starter Ferhat1986

    (@ferhat1986)

    Some extra information

    I have set the decimals to 0
    I have a product which is priced on 350,00 exactly including 21% taxes

    So the price is as following:
    Product price excluding taxes (21%): €289,26
    Tax (21%): €60,74
    Product price including taxes (21%): €350

    When trying to pay this order (€350 incl €61 taxes) the error log says the same:

    2025-08-13T08:43:44+00:00 Foutopsporing {
        "amount": {
            "currency": "EUR",
            "value": "350.00"
        },
        "description": "Bestelling ",
        "redirectUrl": "https://xxxx.com/betalen/order-received/xxxx/?key=xxxx&order_id=xxxx&filter_flag=onMollieReturn",
        "webhookUrl": "https://xxxx.com/wc-api/mollie_wc_gateway_ideal?order_id=xxxx&key=xxxx&filter_flag",
        "method": "ideal",
        "issuer": "",
        "locale": "nl_NL",
        "dueDate": "",
        "metadata": {
            "order_id": xxxx
        }
    }
    2025-08-13T08:43:45+00:00 Foutopsporing [2025-08-13T08:43:45+0000] Error executing API call (422: Unprocessable Entity): Line item 1 is invalid. The 'vatAmount' field is off. Expected to be €60.79 (€350.26 × (21.00 / 121.00)), got €61.00. Documentation: https://docs.mollie.com/reference/handling-errors. Request body: {"status":422,"title":"Unprocessable Entity","detail":"Line item 1 is invalid. The 'vatAmount' field is off. Expected to be €60.79 (€350.26 × (21.00 / 121.00)), got €61.00","field":"lines.1.vatAmount","_links":{"documentation":{"href":"https://docs.mollie.com/reference/handling-errors","type":"text/html"}}}. Field: lines.1.vatAmount
    2025-08-13T08:43:45+00:00 Foutopsporing ideal: Failed to create Mollie payment object for order xxxx: [2025-08-13T08:43:45+0000] Error executing API call (422: Unprocessable Entity): Line item 1 is invalid. The 'vatAmount' field is off. Expected to be €60.79 (€350.26 × (21.00 / 121.00)), got €61.00. Documentation: https://docs.mollie.com/reference/handling-errors. Request body: {"status":422,"title":"Unprocessable Entity","detail":"Line item 1 is invalid. The 'vatAmount' field is off. Expected to be €60.79 (€350.26 × (21.00 / 121.00)), got €61.00","field":"lines.1.vatAmount","_links":{"documentation":{"href":"https://docs.mollie.com/reference/handling-errors","type":"text/html"}}}. Field: lines.1.vatAmount

    As you can see, somehow €350 gets converted to €350,26. I’ve repeated this step in a clean WordPress and WooCommerce environment and got the same problem.

    Thread Starter Ferhat1986

    (@ferhat1986)

    Hi Femi,

    This option is what is causing the problem. We purposely set the decimals to 0. We don’t want to show decimals in our webshop.

    Isn’t there a way to make the plugin work with decimals set to 0?

    Greetings,
    Ferhat

    Thread Starter Ferhat1986

    (@ferhat1986)

    Hi Femy,

    Thnx for the reply. We still get the same error:

    2025-08-05T12:11:41+00:00 Debug [2025-08-05T12:11:41+0000] Error executing API call (422: Unprocessable Entity): Line item 1 is invalid. The 'vatAmount' field is off. Expected to be €137.09 (€789.89 × (21.00 / 121.00)), got €137.00. Documentation: https://docs.mollie.com/reference/handling-errors. Request body: {"status":422,"title":"Unprocessable Entity","detail":"Line item 1 is invalid. The 'vatAmount' field is off. Expected to be €137.09 (€789.89 × (21.00 / 121.00)), got €137.00","field":"lines.1.vatAmount","_links":{"documentation":{"href":"https://docs.mollie.com/reference/handling-errors","type":"text/html"}}}. Field: lines.1.vatAmount
    2025-08-05T12:11:41+00:00 Debug ideal: Failed to create Mollie payment object for order 296295: [2025-08-05T12:11:41+0000] Error executing API call (422: Unprocessable Entity): Line item 1 is invalid. The 'vatAmount' field is off. Expected to be €137.09 (€789.89 × (21.00 / 121.00)), got €137.00. Documentation: https://docs.mollie.com/reference/handling-errors. Request body: {"status":422,"title":"Unprocessable Entity","detail":"Line item 1 is invalid. The 'vatAmount' field is off. Expected to be €137.09 (€789.89 × (21.00 / 121.00)), got €137.00","field":"lines.1.vatAmount","_links":{"documentation":{"href":"https://docs.mollie.com/reference/handling-errors","type":"text/html"}}}. Field: lines.1.vatAmount

    Strange thing is that the VAT is also getting rounded. The product price should be 790 incl VAT
    VAT should be 137,11 but also gets rounded to 137

    Thread Starter Ferhat1986

    (@ferhat1986)

    @wpfy thnx for the reply and putting effort to replicate the situation. Could you please duplicate the pages untill you have 2 pages with menu items and check the second page? In my 2nd screenshot (Page 2) you can see there are a lot of “Page 1” and “Page 2” pages without a parent. Eventhough they have a parent as you can see in my 3th screenshot.

    I’m curious what you’ll see on the 2nd page.

    Thread Starter Ferhat1986

    (@ferhat1986)

    I’ve done some more experimenting and installed a fresh WordPress environment and randomly added pages with parents. This seems to be a bigger issue than I thought. See attached screenshot.

    I’ve added a couple pages and added sub pages. I’ve duplicated these posts with Yoast Duplicate Post. The problem also exists in this newly installed WordPress environment. In this environment I only get the bug on page 2

    Menu
    Page 1: https://imgur.com/a/gLOtEto
    Page 2: https://imgur.com/a/pWyJrTQ

    All pages:

    View post on imgur.com

    Thread Starter Ferhat1986

    (@ferhat1986)

    Thnx for the reply. This is exactly what i was looking for. Will buy the pro if necessary!

    Thread Starter Ferhat1986

    (@ferhat1986)

    Problem solved. After looking into other topics I’ve found out the option I needed was “modify query”. Sorry for the post.

Viewing 9 replies - 1 through 9 (of 9 total)