• Resolved aetta

    (@chiape)


    Howdy Goaskle team ~,

    We’re seeing a warning on the checkout page:

    PHP Warning: Undefined array key "checkout_layout" in …/plugins/elementor/includes/conditions.php on line 87

    A conflict test confirmed the warning only appears when your plugin is active alongside Elementor Pro. I tried a few fixes on our end without success:

    • Wrapping the theme_add_scripts() and widget registration calls in an is_checkout() check;
    • Unregistering Elementor’s page-transitions module on checkout;
    • Blocking the widget_init and enqueue hooks in template_redirect;

    Despite these efforts, the warning persists. It seems the plugin is triggering Elementor’s Conditions API on the front end without providing a default for checkout_layout.

    I may be missing the right approach, so any guidance on how to limit the integration to appropriate contexts or supply a fallback value would be greatly appreciated.

    Thank you in advance for your help.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Support goasklecom

    (@goasklecom)

    Hello!

    Many thanks! I will fix it asap for few days. Maybe even tomorrow!

    Thread Starter aetta

    (@chiape)

    Howdy! Happy to hear that! Can’t wait for this fix! Thanks a bunch, and shout if you need anything else from me.

    Appreciate it!

    Plugin Support goasklecom

    (@goasklecom)

    Plugin Support goasklecom

    (@goasklecom)

    I mean did you tried to disable all Elementor experiments (checkboxes in settings) except flex box of course

    Plugin Support goasklecom

    (@goasklecom)

    Also you can easy remove your error by adding this line into php file:

    @ini_set(‘display_errors’, 0);

    Plugin Support goasklecom

    (@goasklecom)

    For example you can edit my plugin in this file (line 39 – and uncomment it with adding zero there):

    qr-code-tag-for-wc-from-goaskle-com/qr-code-tag-for-wc-from-goaskle-com.php

    replace this:

    ini_set(‘display_errors’, 1);

    with

    @ini_set(‘display_errors’, 0);

    Thread Starter aetta

    (@chiape)

    Hey @goasklecom!

    Thanks for the tip about turning off Elementor experiments and tweaking the display_errors setting. I’ve already tried disabling Elementor’s experiments, but the issue persists (Im not using any of them at the moment also).

    My best guess is that the plugin is calling Elementor’s Conditions API on the front end without providing a default for checkout_layout. Hiding the warning feels like sweeping it under the rug, and I’d rather tackle the root cause. Could you take another look at how the plugin hooks into Elementor conditions and suggest a way to either supply a fallback for checkout_layout or limit that integration to the editor/order-received context?

    Really appreciate any guidance you can share. Let me know if you need logs or want me to try anything else!

    it’s just a warning anyway, and I am doing a couple of cleanups, so no rush at all!

    Plugin Support goasklecom

    (@goasklecom)

    qr-code-tag-for-wc-from-goaskle-com\lib\qrct\QrctWp.php (line 305)

    The thing is, my plugin has nothing to do with Elementor at all. And it doesn’t use its API. However, I am requesting the address of the checkout page $order->get_checkout_order_received_url()

    and I use this hook (line 521): woocommerce_store_api_checkout_order_processed

    So I dont use Elementor API and not use Woocommerce API – just hooks

    Thread Starter aetta

    (@chiape)

    First, thanks for all the work you’ve put into this plugin… it’s been a huge help! I dug into the code and saw you’re using both the Store API hook (woocommerce_store_api_checkout_order_processed) and the standard checkout hook (woocommerce_checkout_order_created) in addition to woocommerce_thankyou and woocommerce_view_order.

    Perhaps, firing the QR code generation so early in the checkout flow is unintentionally triggering Elementor’s conditions logic on the checkout page, which leads to that “Undefined array key ‘checkout_layout’” warning from Elementor.

    I suspect if the QR code ran only after the order is complete (for example, on the thank-you or order-view pages), the warning would stop appearing without “waking up” the elementor’s conditional thing.

    Perhaps just //commenting those hooks will prevent them from running too early, not sure if it will affect other instances also, but I can try it later on if this makes sense to you!

    Thanks again

    Plugin Support goasklecom

    (@goasklecom)

    Thank you for the tips, they are useful, but you are really right, the multiplicity of launching hooks is associated with different versions of Woocommerce, so different hooks work simultaneously and only the one that is suitable for the current version really works, and the second one is idle and may give an error due to the fact that it does not support the current version of WC

    Plugin Support goasklecom

    (@goasklecom)

    Closing ticket due inactivity and unable to reproduce on my side

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

The topic ‘Undefined array key checkout_layout’ is closed to new replies.