WooCommerce and 5.0.8 problems

Just updated to 5.0.8 – two issues so far:

  1. I have a page that calls the {{dc:woocommerce:cart_subtotal_raw}} dynamic content, and I’ve narrowed it down to that piece of code that when I go to the non-Cornerstone edit page, this is the result:

  1. A plugin I use, Woo Commerce Product Tables PRO, apparently breaks the screen layout whenever I change the responsive view from the sidebar. NOTE: the plugin works fine on the actual site; it’s just the responsive PREVIEW that’s broken. When I load the page to edit, the screen looks fine. But any change to another breakpoint preview makes the screen suddenly vanish all the non-header/footer content. Oddly, this happens on every page, not just a page that contains one of the plugin’s tables.

I know you might think #2 is not Themeco’s problem, but the plugin was working perfectly under Pro v4, so it’s almost certain that Themeco’s new v5 responsive preview that is causing the problem. I hope you can find the incompatibility so either Themeco can fix what went wrong, or at least I can tell the plugin developer what the problem might be for them to look at.

See this screenshot:

I have tried on multiple browsers (Safari and Chrome on Mac) with the same problems. I have deactivated all plugins and turned them back on one by one to isolate the issues.

I’ll add login info in a secure note.

Hope there is a quick fix – thanks!

Hello @cheshiredave,

Thanks for writing in! We need to fix the first issue first. Is there any error message in your server’s error log? Can you please enable the WordPress debug mode instead? You might be able to see an error message on the site right away. If not, the error log could reveal where the problem is originating. You can do this by opening wp-config.php and adding


define('WP_DEBUG', true);

/* That's all, stop editing! Happy blogging. */

When you revisit the Non-Cornerstone edit page, you should have some error output describing the issue in more detail.

Please let us know the error message then. Thank you.

This is what Cloudways sent me (apologies for the bad formatting):

WordPress version 5.8

Current theme: Pro – Child Theme (version 1.0.0)

Current plugin: (version )

PHP version 7.3.29-1+0~20210701.86+debian9~1.gbp7ad6eb

Error Details

=============

An error of type E_ERROR was caused in line 359 of the file /home/231684.cloudwaysapps.com/dtebdbyber/public_html/wp-content/themes/pro/cornerstone/includes/classes/dynamic-content/class-dynamic-content-woocommerce.php. Error message: Uncaught Error: Call to a member function get_cart_subtotal() on null in /home/231684.cloudwaysapps.com/dtebdbyber/public_html/wp-content/themes/pro/cornerstone/includes/classes/dynamic-content/class-dynamic-content-woocommerce.php:359

Stack trace:

#0 /home/231684.cloudwaysapps.com/dtebdbyber/public_html/wp-includes/class-wp-hook.php(303): Cornerstone_Dynamic_Content_WooCommerce->supply_field('', 'cart_subtotal_r...', Array)

#1 /home/231684.cloudwaysapps.com/dtebdbyber/public_html/wp-includes/plugin.php(189): WP_Hook->apply_filters('', Array)

#2 /home/231684.cloudwaysapps.com/dtebdbyber/public_html/wp-content/themes/pro/cornerstone/includes/classes/dynamic-content/class-dynamic-content.php(157): apply_filters('cs_dynamic_cont...', '', 'cart_subtotal_r...', Array)

#3 /home/231684.cloudwaysapps.com/dtebdbyber/public_html/wp-content/themes/pro/cornerstone/includes/classes/dynamic-content/class-dynamic-content.php(165): Cornerstone_Dynamic_Content->expand(Array)

#4 [internal function]: Cornerstone_Dynamic_Content

Hi @cheshiredave,

I have checked your website and added a Test page and didn’t find both of the issues. I have used {{dc:woocommerce:cart_subtotal_raw}} and it is also showing the correct output without breaking the site.
I checked the above points by activating the said plugin which is having the issue.

If you are still getting the same issue, I would request you to add the below-given code into your wp-config.php file for debug setup, and the error logged into the file name debug.log inside the wp-content folder.
We are really curious to know if any error that is related to our theme or theme bundled plugins.

// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );

// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );

// Disable display of errors and warnings 
define( 'WP_DEBUG_DISPLAY', false );
//SET PHP INI DISPLAY ERROR FALSE
@ini_set( 'display_errors', 0 );

Please find the video that will help you to edit wp-config.php and add the above code: https://www.youtube.com/watch?v=3SDPTafEM8o
I would also suggest you provide the FTP/CPanel credentials, we may be required to access the files directly.

Thanks

I think you didn’t test it correctly. I have restarted my machine, updated PHP to 7.4, and checked on multiple browsers and on multiple computers. The problems are definitely within Pro. Please check it again.

  1. To see problem #1 as described above, go to edit the “Breakfast” page in Cornerstone. THEN click the “Wordpress Admin” link from the main menu, and you will see the error. You can even see the error if you click “Wordpress Admin” from the test page you created.

  2. To see problem #2, please make sure the plugin “Woo Commerce Product Table PRO” is ACTIVATED. Then on basically any page being edited by the Page Builder in Cornerstone, try toggling different breakpoint previews on the sidebar. You may have to click a couple of different ones depending on what your default view is. You will see the content disappear and the footer moved up to just below the header. (The plugin may not have been activated when you tested the site, as I had turned it off to do work on the site.)

Thanks for taking another look.

Cheshire

Hello Cheshire,

Thank you for the clarifications. We have investigated the issue and we found out that you are using the {{dc:woocommerce:cart_subtotal_raw}} dynamic content incorrectly. Please be advised that before you can get the raw subtotal or just the subtotal of the cart, the cart fragment should be preset.

What this means is that your get subtotal dynamic content should be inside the cart page or inside a mini-cart element. You cannot use any of the WooCommerce cart dynamic contents independently. All of the cart dynamic contents should ONLY be used inside the cart page or a mini-cart element.

You may ask, "why it is working on the live view on the page or in the page builder? And when I edit the page using the WP Editor, it returns an error?

  • This is because the WooCommerce Subtotal dynamic content is supported by the page builder. When viewing the live view of the page, Cornerstone will render any of the dynamic content. When you edit the page outside of Cornerstone, the dynamic content is not supported this is why it returns an Error. Outside of Cornerstone or the builder, the dynamic content becomes unrecognizable thus will give an error instead.

One thing to remember, if you edit the page using the Cornerstone page builder, you are not supposed to switch between editors. Doing so will corrupt the cornerstone data thus might give you some issue later on that you can no longer be able to edit the page back in the Cornerstone page builder.

Hope this explains your issue briefly.

First off, I’m not trying to switch between editors, but I don’t know any other way to get back to the WP dashboard. Is there another button I should be clicking instead of “Wordpress Admin”? Because it’s that button that’s taking me to the WP page editor where I get the error.

Now back to the first problem: why give us the option to call for Woo dynamic content if we’re only supposed to be using it under specific circumstances? That’s very frustrating. I love a lot of things about Pro, but the way it deals with Woo is just so surprisingly poorly thought out and integrated. I’m kind of shocked that Pro is so bad at Woo.

Finally, you still have not addressed the problem of the breakpoint preview and the plugin conflict. Can you please look at that?

Thanks,
Cheshire

Hi Cheshire,

I have already tried the steps to replicate the 2nd issue you are having with the plugin named WooCommerce Product Table PRO, and that is why I asked you to add the WP Debug set up to recognize the problem behind it.

I have checked it and again I am not able to replicate any issue. I have made a screen capturing video, please check and let me know if any step(s) is required to replicate it.

https://www.awesomescreenshot.com/video/5093176?key=7995e79caa128cac21a124f521d3d8b3

Thanks

OK, I have enabled DEBUG mode and made both of the errors happen. Please check the error log and see what you can find.

Thanks,
Cheshire

Hello Cheshire,

First off, I’m not trying to switch between editors, but I don’t know any other way to get back to the WP dashboard. Is there another button I should be clicking instead of “Wordpress Admin”? Because it’s that button that’s taking me to the WP page editor where I get the error.

When you are in the builder, you can click on the Hamburger icon in the upper left corner and you will see the Navigation Menu > WordPress Admin link. Once you click this link, it will take you to the WordPress Admin page editing screen. It will still give you an error if you have inserted the Get Total dynamic content on the page.

Now back to the first problem: why give us the option to call for Woo dynamic content if we’re only supposed to be using it under specific circumstances? That’s very frustrating. I love a lot of things about Pro, but the way it deals with Woo is just so surprisingly poorly thought out and integrated. I’m kind of shocked that Pro is so bad at Woo.

As we have mentioned in the previous reply, the WP Editor or the WP page/post editing screen does not support dynamic content especially the get total dynamic content. No worries, I will be informing our developers about this so that they can make something that prevents any error when opening the page in the WP Editor.

Finally, you still have not addressed the problem of the breakpoint preview and the plugin conflict. Can you please look at that?

We already have responded to your other thread.

Best Regards.

Yes, that is the link I am clicking to get back to the WP Admin. But if I am in the middle of editing a page using Cornerstone, and I open the hamburger menu and click WordPress Admin like you suggest, it takes me to the screen where I’m editing the page in WordPress.

If you’re on something else in Cornerstone, like adjusting Theme Options, and you click WordPress Admin, yes, it takes you to the actual WP dashboard. But NOT — I repeat, NOT — if you’re editing a Page Builder page in Cornerstone. Please, check it out for yourself and you’ll see that I’m right.

It is so frustrating for you folks to keep telling me I’m wrong about stuff when I’m not. This is turning into a very bad Themeco experience, and I have been with you folks practically from the start.

Hello Cheshire,

Your issue has been added as a bug and has been forwarded to our developers.

Thanks for your understanding.

Great, thank you.

However, the original problem of the vanishing content when Woo Commerce Product Tables PRO is active is still the case, after all of my efforts purging cache/history, restarting, private browsing, etc. Not limited to Safari – broken on all browsers. Did enabling the DEBUG help at all? Anything I can flag for the plugin developer? Should I turn the DEBUG off?

Honestly very disappointed in the v5 rollout. I’ve lost so many hours to trying to figure out these problems.

Update: the plugin developer was able to see something in the way Themeco developed the breakpoint previews and devised a solution for his plugin that accounted for that. I’m trying to see if he can share any info that will help Themeco troubleshoot the next time another plugin runs into a similar problem.

In the meantime, can I go ahead and turn DEBUG mode off?

Hello Cheshire,

Yes, you can disable the debug mode. Be advised that only the PHP notices and Warning will not be displayed when the debug mode is disabled. So, even if the debug mode is disabled if there is a fatal error, you will always see the “Wrapper Attention” message from WordPress.

Best Regards.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.

Hi @cheshiredave,

I wanted to let you know we’ve added a check in Dynamic Content to make sure the cart exists before trying to access it. This will resolve the fatal error you are encountering here. The fix will be in the next release.