Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict with CTX Feed and Advanced Dynamic Pricing for WooCommerce #21956

Closed
leonidasmi opened this issue Jan 9, 2025 · 4 comments
Closed
Assignees

Comments

@leonidasmi
Copy link
Contributor

leonidasmi commented Jan 9, 2025

When the 'WooCommerce Default Schema Override' option is enabled in CTX Feed, and Yoast Woo SEO is enabled, this fatal is thrown on product pages:

Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /httpdocs/wp-content/plugins/wpseo-woocommerce/classes/woocommerce-schema.php:791 
Stack trace: #0 /httpdocs/wp-content/plugins/wpseo-woocommerce/classes/woocommerce-schema.php(809): WPSEO_WooCommerce_Schema->maybe_add_vat() 
#1 /httpdocs/wp-content/plugins/wpseo-woocommerce/classes/woocommerce-schema.php(271): WPSEO_WooCommerce_Schema->add_unit_price_specifications() 
#2 /httpdocs/wp-content/plugins/wpseo-woocommerce/classes/woocommerce-schema.php(215): WPSEO_WooCommerce_Schema->filter_offers() 
#3 /httpdocs/wp-includes/class-wp-hook.php(324): WPSEO_WooCommerce_Schema->change_product() 
#4 /httpdocs/wp-includes/plugin.php(205): WP_Hook->apply_filters() 
#5 /httpdocs/wp-content/plugins/woocommerce/includes/class-wc-structured-data.php(455): apply_filters() 
#6 /httpdocs/wp-includes/class-wp-hook.php(324): WC_Structured_Data->generate_product_data() 
#7 /httpdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() 
#8 /httpdocs/wp-includes/plugin.php(517): WP_Hook->do_action() 
#9 /httpdocs/wp-content/themes/woodmart/woocommerce/content-single-product.php(215): do_action()
#10 /httpdocs/wp-includes/template.php(812): require('…') 
#11 /httpdocs/wp-content/plugins/woocommerce/includes/wc-core-functions.php(284): load_template() 
#12 /httpdocs/wp-content/themes/woodmart/woocommerce/single-product.php(41): wc_get_template_part() 
#13 /httpdocs/wp-includes/template-loader.php(106): include('…') 
#14 /httpdocs/wp-blog-header.php(19): require_once('…') 
#15 /httpdocs/index.php(17): require('…') 
#16 {main} thrown in /httpdocs/wp-content/plugins/wpseo-woocommerce/classes/woocommerce-schema.php on line 791

The same error is thrown on product pages, when Advanced Dynamic Pricing for WooCommerce is enabled.

@leonidasmi
Copy link
Contributor Author

The same fatal is thrown when the Advanced Dynamic Pricing for WooCommerce plugin is active.

@rmarcano
Copy link

rmarcano commented Jan 9, 2025

Please inform the customer of conversation # 1212970 when this conversation has been closed.

@rmarcano
Copy link

rmarcano commented Jan 9, 2025

Please inform the customer of conversation # 1208514 when this conversation has been closed.

@leonidasmi leonidasmi self-assigned this Jan 10, 2025
@leonidasmi leonidasmi changed the title Conflict with CTX Feed Conflict with CTX Feed and Advanced Dynamic Pricing for WooCommerce Jan 10, 2025
@leonidasmi
Copy link
Contributor Author

After investigation:

  • Yoast Woo SEO has incompatibilities with two plugins, CTX Feed and Advanced Dynamic Pricing for WooCommerce that result in a Fatal Error in product pages, as per the task's description
  • Both incompatibilities happen because those plugins dont know how to deal with WooCommerce 9.5.0 (and more specifically, its backwards incompatible change in the product schema, mainly brought by this PR):
    • The CTX Feed one happens when a setting meant for old WooCommerce versions is enabled - I don't think that the setting should be available in newer WooCommerce versions, or if it is, then it should consider the latest schema handling from WooCommerce
    • The Advanced Dynamic Pricing for WooCommerce one happens out of the box and it's because the plugin hasn't taken the above WooCommerce 9.5.0 schema changes into account - With Yoast Woo SEO disabled, the schema in product pages with that plugin enabled is invalid.
  • Both plugins should handle WooCommerce 9.5.0 better, but we're gonna add defensive coding to avoid errors anyway, to improve the UX of users waiting improvements on those plugins

@leonidasmi leonidasmi removed their assignment Jan 10, 2025
@pls78 pls78 self-assigned this Jan 13, 2025
@pls78 pls78 closed this as completed Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants