Home › Forums › WoodMart support forum › "This time WordPress found a bug with the Woodmart theme."
"This time WordPress found a bug with the Woodmart theme."
- This topic has 12 replies, 2 voices, and was last updated 4 years, 2 months ago by
Elise Noromit.
-
AuthorPosts
-
June 18, 2021 at 11:52 am #300658
loraloraParticipantYesterday evening I received a message from the site about a bug with a theme. Could you tell me what this message means?
June 18, 2021 at 11:55 am #300660
loraloraParticipanthere is the error log for June 17th
June 18, 2021 at 4:05 pm #300705
Elise NoromitMemberHello,
Please deactivate all the plugins not related to the theme, switch the parent theme, and check the issue, If the problem has gone, activate the plugins one by one, checking the issue to detect which one causes the problem.
if the problem remains, even after the plugins are deactivated, please, provide your site admin access to the private area.
Please confirm the permit for us to deactivate the plugins not related to the theme and switch to the parent theme for the while of checking what may take up to 15 minutes. Please make the full backup of your site.
Best Regards
June 19, 2021 at 7:24 pm #300811
loraloraParticipantYou understood me wrong. the site is displayed normally. such letters arrive at the post office at night. today another one has come with the same text. In the morning I visit the site and it usually opens from there.
if I turn on all the plugins one by one, it will take a month to understand who is causing them to fail – since I have 30 plugins.
June 19, 2021 at 11:22 pm #300832
Elise NoromitMemberHello,
Please provide your site admin access to the private area. Please provide the step-by-step actions to reproduce this error in the site.
Please confirm the permit for us to deactivate the plugins not related to the theme and switch to the parent theme for the while of checking what may take up to 15 minutes. Please make the full backup of your site.
Best Regards
June 20, 2021 at 12:53 pm #300876
loraloraParticipantI performed these actions today, turned off everything that is not related to your topic, the letter did not come to the mail, but the logs with errors are all there overnight and in the morning
June 21, 2021 at 9:17 am #301034
Elise NoromitMemberHello,
Please add this code to the functions.php of the child theme:
function woodmart_cart_count() { if ( ! method_exists( WC()->cart, 'get_cart_contents_count' ) ) { return; } $count = WC()->cart->get_cart_contents_count(); ?> <span class="wd-cart-number<?php echo woodmart_get_old_classes( ' woodmart-cart-number' ); ?>"><?php echo esc_html( $count ); ?> <span><?php echo esc_html( _n( 'item', 'items', $count, 'woodmart' ) ); ?></span></span> <?php }
Best Regards
June 21, 2021 at 10:39 am #301054
loraloraParticipantthanks, but please tell me what it was?
Is it some kind of conflict with plugins or something else?
As far as I understand, this is the only problem I have?
Will I always need to use this code or before the first update?June 21, 2021 at 2:15 pm #301124
Elise NoromitMemberHello,
This is the fix for incomaptibility. If you have added the code to the child theme you do not need to do anything, it will remain even after the update.
Best Regards
June 21, 2021 at 2:50 pm #301140
loraloraParticipantI understand, but what is the incompatibility with? which plugin?
June 22, 2021 at 10:27 am #301351
Elise NoromitMemberHello,
We cannot tell exactly which plugin causes the error. One of the plugins calls the WoodMart function earlier than Woocommerce has been initialized. As the result, the function is not available. This fix verifies the function before application.
Best Regards
June 22, 2021 at 11:48 am #301386
loraloraParticipantI figured it out, and inserted this code into the plugin for php functions My Custom Functions, and at night I received an email again with an error on line 115. On line 115, your function, please see the screenshot
Attachments:
You must be logged in to view attached files.June 23, 2021 at 8:13 am #301677
Elise NoromitMemberHello,
PLease replace the code with this one:
function woodmart_cart_count() { if ( ! is_object( WC()->cart ) || ! method_exists( WC()->cart, 'get_cart_contents_count' ) ) { return; } $count = WC()->cart->get_cart_contents_count(); ?> <span class="wd-cart-number<?php echo woodmart_get_old_classes( ' woodmart-cart-number' ); ?>"><?php echo esc_html( $count ); ?> <span><?php echo esc_html( _n( 'item', 'items', $count, 'woodmart' ) ); ?></span></span> <?php }
Best Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register