• Resolved Tatitas

    (@taiswebsites)


    Hello,

    I found a fatal error when opening the Coupons screen in WooCommerce.

    Environment:

    • WordPress: 6.9.4
    • PHP: 8.3
    • WooCommerce: 10.6.0
    • Google for WooCommerce: 3.5.3

    Issue:
    When I open the Coupons tab / add a new coupon, the page triggers a fatal error related to the Google for WooCommerce plugin.

    From the stack trace, it looks like the plugin tries to render the coupon meta box view:
    views/meta-box/coupon_channel_visibility.php

    Inside that view, it expects the property:
    is_setup_complete

    But this property is missing from the view context, which causes the fatal error.

    Error log:
    [13-Mar-2026 00:28:28 UTC] PHP Fatal error: Uncaught Automattic\WooCommerce\GoogleListingsAndAds\View\ViewException: The property “is_setup_complete” could not be found within the context of the currently rendered view. in /home/public_html/wp-content/plugins/google-listings-and-ads/src/View/ViewException.php:70
    Stack trace: 0 /home/public_html/wp-content/plugins/google-listings-and-ads/src/View/PHPView.php(216): Automattic\WooCommerce\GoogleListingsAndAds\View\ViewException::invalid_context_property(‘is_setup_comple…’) 1 /home/public_html/wp-content/plugins/google-listings-and-ads/views/meta-box/coupon_channel_visibility.php(40): Automattic\WooCommerce\GoogleListingsAndAds\View\PHPView->__get(‘is_setup_comple…’) 2 /home/public_html/wp-content/plugins/google-listings-and-ads/src/View/PHPView.php(80): include(‘/home/…’) 3 /home/public_html/wp-content/plugins/google-listings-and-ads/src/Admin/Admin.php(291): Automattic\WooCommerce\GoogleListingsAndAds\View\PHPView->render(Array) 4 /home/public_html/wp-content/plugins/google-listings-and-ads/src/Admin/MetaBox/AbstractMetaBox.php(137): Automattic\WooCommerce\GoogleListingsAndAds\Admin\Admin->get_view(‘meta-box/coupon…’, Array) 5 /home/public_html/wp-content/plugins/google-listings-and-ads/src/Admin/MetaBox/AbstractMetaBox.php(116): Automattic\WooCommerce\GoogleListingsAndAds\Admin\MetaBox\AbstractMetaBox->render(Array) 6 /home/public_html/wp-admin/includes/template.php(1453): Automattic\WooCommerce\GoogleListingsAndAds\Admin\MetaBox\AbstractMetaBox->handle_callback(Object(WP_Post), Array) 7 /home/public_html/wp-admin/edit-form-advanced.php(714): do_meta_boxes(Object(WP_Screen), ‘side’, Object(WP_Post)) 8 /home/public_html/wp-admin/post-new.php(75): require(‘/home/…’) 9 {main}

    Next Automattic\WooCommerce\GoogleListingsAndAds\View\ViewException: Could not load the View URI “/home/public_html/wp-content/plugins/google-listings-and-ads/views/meta-box/coupon_channel_visibility.php”. Reason: “The property “is_setup_complete” could not be found within the context of the currently rendered view.”. in /home/public_html/wp-content/plugins/google-listings-and-ads/src/View/ViewException.php:35

    thrown in /home/public_html/wp-content/plugins/google-listings-and-ads/src/View/ViewException.php on line 35

    Expected behavior:
    Opening the Coupons screen should not trigger a fatal error, even if Google for WooCommerce is not fully configured or if coupon channel visibility is unavailable.

    Actual behavior:
    The Coupons screen crashes because the view expects a missing context property.

    Can you confirm if this is a bug in version 3.5.3, and if there is a workaround or patch available?

    Thank you.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi @taiswebsites,

    Thank you for sharing the detailed report and stack trace, it is very helpful and I can see how this fatal error when opening the Coupons screen would interrupt normal workflow. I will gladly help look into this with you.

    From what you described, the error appears to originate from the Google for WooCommerce plugin when it attempts to render the coupon meta box and the expected is_setup_complete property is not present in the view context. This indicates the issue is likely coming from the plugin rather than WooCommerce core.

    To begin troubleshooting, please try the following steps.

    1. Ensure all plugins are updated, especially Google for WooCommerce, as updates often include fixes for admin view rendering issues.
      https://wordpress.org/plugins/google-listings-and-ads/
    2. Temporarily deactivate the Google for WooCommerce plugin and then open Marketing → Coupons or create a new coupon again. This will help confirm whether the issue is isolated to that plugin.
    3. If the page works normally after deactivating the plugin, please reactivate it and confirm whether the plugin setup wizard has been fully completed under Marketing → Google Listings & Ads, as the error suggests the setup state may not be fully initialized.

    If the issue persists after confirming the setup is complete and all plugins are updated, please share the full System Status Report so we can investigate further. You can paste it via: https://pastebin.com or https://gist.github.com. You can generate it from WooCommerce → Status → Get system report → Copy for support.

    Once we have that, we can take a closer look and guide you further.

    Thread Starter Tatitas

    (@taiswebsites)

    Hi @lovingbro

    1. I am already testing with Google for WooCommerce 3.5.3. The issue is not a generic “please update everything” case. The fatal error points to a specific code problem in the plugin view layer.
    2. Disabling the plugin confirm that the issue comes from Google for WooCommerce, but the stack trace already shows that clearly. The fatal happens inside: views/meta-box/coupon_channel_visibility.php and is triggered because the template tries to access: $this->is_setup_complete while that property is not present in the rendered view context.

    So yes, the issue is isolated to the plugin, but that is already evident from the trace.

    1. The main problem is not whether setup was completed or not.

    A plugin should not fatal just because setup is incomplete. If setup is incomplete, the view should handle that safely. In this case, the fatal happens because the template expects a context property that is missing. This is a view/context contract bug.

    More specifically:

    • views/meta-box/coupon_channel_visibility.php reads $this->is_setup_complete
    • the corresponding context does not provide is_setup_complete
    • the view renderer throws an exception for missing context properties
    • opening the Coupons screen crashes

    Also, in that template, the related variables appear to be unused, which suggests stale code in the view.

    So this is not just a setup issue. It is a plugin bug.

    I have same problem as Tatitas. Any solutions for the bug?

    I have temporrary fix, I have edited:

    wp-content/plugins/google-listings-and-ads/views/meta-box/coupon_channel_visibility.php

    and edited and set:

    $is_setup_complete = true;

    It works.

    Plugin Support Frank Remmy (woo-hc)

    (@frankremmy)

    Hi @taiswebsites @bfcior,

    Thanks for the updates. @bfcior I’m really glad to hear you managed to put a workaround in place in the meantime. That definitely helps keep things moving while the underlying issue gets sorted out.

    The problem you’re seeing is actually a known one, and it’s being tracked here: https://github.com/woocommerce/google-listings-and-ads/issues/3287. The good news is that the fix has already been completed and will be included in the next release.

    Once that update is available, I’d recommend installing the latest version, but be sure to test it on a staging environment first just to confirm everything behaves as expected with your setup.

    If anything else comes up, feel free to share.

    Hey @taiswebsites and @bfcior,

    Thanks again for reporting this issue!

    The fix is included in v3.6.0, which is now available for download. I recommend to test it on a staging environment first to confirm that everything looks good with your setup.

    If the new version resolves the issue you reported, please consider leaving a review describing your experience with our plugin and support. Meaningful reviews can help other users decide if a plugin is the right one for their use case. Thank you! 🌟

    Thread Starter Tatitas

    (@taiswebsites)

    @jasonkytros Fixed. Thanks!

    Plugin Support Frank Remmy (woo-hc)

    (@frankremmy)

    Great to hear that it’s working now for you!

    We hope you leave us a review whenever you get a chance. 😀

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

You must be logged in to reply to this topic.