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."

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #300658

    loralora
    Participant

    Yesterday evening I received a message from the site about a bug with a theme. Could you tell me what this message means?

    #300660

    loralora
    Participant

    here is the error log for June 17th

    #300705

    Hello,

    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

    #300811

    loralora
    Participant

    You 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.

    #300832

    Hello,

    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

    #300876

    loralora
    Participant

    I 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

    #301034

    Hello,

    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

    #301054

    loralora
    Participant

    thanks, 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?

    #301124

    Hello,

    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

    #301140

    loralora
    Participant

    I understand, but what is the incompatibility with? which plugin?

    #301351

    Hello,

    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

    #301386

    loralora
    Participant

    I 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.
    #301677

    Hello,

    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

Viewing 13 posts - 1 through 13 (of 13 total)