Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter dotmatrix

    (@dotmatrix)

    Hi @faheem96dev

    Thanks again for sending me the updated WooCommerce build. I have now tested the full flow further and have a few useful findings.

    The good news is that I have the WooCommerce checkout flow working correctly now.

    The main issues I found were the following.

    1. WooCommerce checkout fails with pretty permalinks

    With permalinks set to Plain, WooCommerce checkout worked.

    With permalinks set to Post name, the WooCommerce handoff returned:

    WooCommerce checkout is unavailable right now. Please try another payment method.

    I traced this to the WooCommerce cart not being initialised during the Booktics REST order request.

    The current handoff checks:

    function_exists( 'WC' ) && WC()->cart instanceof \WC_Cart

    but under /wp-json/booktics/v1/orders, WooCommerce does not automatically initialise the normal frontend cart.

    I patched this locally by explicitly initialising the WooCommerce session/cart before the handoff check, which resolved the issue.

    2. Google OAuth callback requires pretty permalinks

    The Google OAuth callback uses:

    /booktics-integration/google-auth

    With WordPress permalinks set to Plain, this callback returned a 404.

    Changing permalinks to Post name allowed the OAuth flow to complete correctly.

    This creates a conflict with the WooCommerce issue above, because the Google connection requires pretty permalinks while the current Woo handoff fails under them.

    It may be worth either registering the OAuth callback route more explicitly, or displaying an admin notice if the site is using an incompatible permalink structure.

    3. PHP warnings around payment_intent

    During the WooCommerce flow I also saw:

    Undefined array key "payment_intent"

    in:

    core/order/controllers/order-controller.php

    around lines 658 and 667.

    This looks like the code is accessing payment_intent without first checking whether it exists.

    A simple isset() or null coalescing check should remove those warnings.

    4. Existing WooCommerce cart is emptied during booking

    The current handoff calls:

    WC()->cart->empty_cart();

    so any existing WooCommerce products are removed when a booking is passed to checkout.

    This is not necessarily a problem for the core use case, and I can adjust it myself where needed, but it may be worth considering for stores that sell both bookings and standard WooCommerce products and want to support mixed carts.

    Overall, the updated WooCommerce integration is working well now that the REST/cart initialisation issue has been addressed.

    I am happy to continue testing future builds and send through anything else I find.

    Thanks again for being so responsive with the development.

    Thread Starter dotmatrix

    (@dotmatrix)

    Hi @faheem96dev

    Thanks for the quick response and for updating the listing. I appreciate you taking the feedback seriously. I’ve updated my review to reflect this, and I look forward to trying the WooCommerce integration once it’s released.

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