Home › Forums › WoodMart support forum › header error
header error
- This topic has 15 replies, 2 voices, and was last updated 3 years, 4 months ago by
Aizaz Imtiaz Awan.
-
AuthorPosts
-
September 29, 2021 at 11:35 am #321985
baumerParticipantHello, can u please help? After migrating website to another server and domain I got an error at the frontside header:
/home/users/optykpoznan/public_html/optykpoznan.pl/wp-content/themes/woodmart/header.php
September 29, 2021 at 1:13 pm #322029
Aizaz Imtiaz AwanKeymasterHello,
Please provide the admin panel login details of the website to check it myself and help you out accordingly.
Regards.
Xtemos Studios.September 30, 2021 at 8:15 pm #322382
baumerParticipantHello,
thank you for the fast reply.I also got some emails from WordPress:
Szczegóły błędu
===================
Błąd typu E_ERROR został spowodowany w linii 1176 pliku /home/users/optykpoznan/public_html/optykpoznan.pl/wp-content/themes/woodmart/inc/integrations/woocommerce/template-tags.php. Komunikat błędu: Uncaught Error: Call to a member function get_cart_contents_count() on null in /home/users/optykpoznan/public_html/optykpoznan.pl/wp-content/themes/woodmart/inc/integrations/woocommerce/template-tags.php:1176
Stack trace:
#0 /home/users/optykpoznan/public_html/optykpoznan.pl/wp-content/themes/woodmart/inc/modules/sticky-toolbar.php(265): woodmart_cart_count()
#1 /home/users/optykpoznan/public_html/optykpoznan.pl/wp-content/themes/woodmart/inc/modules/sticky-toolbar.php(150): woodmart_sticky_toolbar_cart_template()
#2 /home/users/optykpoznan/public_html/optykpoznan.pl/wp-includes/class-wp-hook.php(303): woodmart_sticky_toolbar_template(”)
#3 /home/users/optykpoznan/public_html/optykpoznan.pl/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters(NULL, Array)
#4 /home/users/optykpoznan/public_html/optykpoznan.pl/wp-includes/plugin.php(470): WP_Hook->do_action(Array)
#5 /home/users/optykpoznan/public_html/optykpoznan.pl/wp-includes/general-template.php(3031): do_action(‘wp_footer’)
#6 /home/users/optykpoznan/public_html/optykpoznan.pl/wp-includes/blocks/legacy-widget.php(123): wp_footer()
#7 /home/users/optykpoznan/public_html/optykpoznan.pl/wp-includes/class-wp-hook.php(303): handle_legacy_widget_preview_iframe(”)
#8 /home/users/optykpoznan/public_html/optykpoznan.pl/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters(NULL, Array)
#9 /home/users/optykpoznan/public_html/optykpoznan.pl/wp-includes/plugin.php(470): WP_Hook->do_action(Array)
#10 /home/users/optykpoznan/public_html/optykpoznan.pl/wp-admin/admin.php(175): do_action(‘admin_init’)
#11 /home/users/optykpoznan/public_html/optykpoznan.pl/wp-admin/widgets.php(10): require_once(‘/home/users/opt…’)
#12 {main}
thrownOctober 1, 2021 at 6:52 am #322462
Aizaz Imtiaz AwanKeymasterHello,
Please provide the admin panel login details of the website to check it myself and help you out accordingly.
The login details you provided are not working.
Regards.
Xtemos Studios.October 1, 2021 at 9:33 am #322503
baumerParticipantHello,
please find new ftp detail below,October 1, 2021 at 11:12 am #322531
Aizaz Imtiaz AwanKeymasterHello,
Please, try to add this code to the functions.php file in your child theme
function woodmart_cart_count() { if ( ! is_object( WC() ) || ! property_exists( 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
October 3, 2021 at 7:57 pm #322816
baumerParticipantHello,
I did but with no results.
Please verify.Attachments:
You must be logged in to view attached files.October 4, 2021 at 6:02 am #322850
Aizaz Imtiaz AwanKeymasterHello,
Please provide the Correct FTp and WordPress Dashboard login details to check it myself and help you out accordingly.
Regards.
Xtemos Studios.October 4, 2021 at 9:58 am #322924
baumerParticipantThank you ,
find the ftp and WP details below:October 4, 2021 at 11:54 am #322970
Aizaz Imtiaz AwanKeymasterHello,
You have some wrong code in the header.php file that is not a part of our theme.
Screenshot for Clarification: https://gyazo.com/da4d2f6b5ee1b1a9913b3cd771d65b28
Please remove the code or try installing the theme completely.
Best Regards
October 4, 2021 at 12:34 pm #322981
baumerParticipantHello again,
thank you. I removed the whole piece as in the screenshot.<body <?php body_class(); ?>>
<?php echo realpath(__FILE__);?>
<?php if ( function_exists( ‘wp_body_open’ ) ) : ?>
<?php wp_body_open(); ?>
<?php endif; ?>Does it look correct now?
Attachments:
You must be logged in to view attached files.October 4, 2021 at 1:00 pm #322993
Aizaz Imtiaz AwanKeymasterHello,
As you removed the code the message is not displayed on the header.
Screenshot for Clarification: https://gyazo.com/1b6deb89bdc3051414214272993881e9
Best Regards
October 5, 2021 at 11:59 am #323164
baumerParticipantThank you, I really appreciate your help! It works now.
What about the previous piece of code you gave me? Shall i keep it in the functions.php file in my child theme?function woodmart_cart_count() {
if ( ! is_object( WC() ) || ! property_exists( 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
}October 5, 2021 at 12:20 pm #323168
Aizaz Imtiaz AwanKeymasterHello,
You are Most Welcome.
Yes you need to keep the code because the Code provided is the solution for the warnings you got in emails as you mentioned.
The text in the header was due to the code you added in the Fucntions.php.
Best Regards
October 5, 2021 at 7:07 pm #323240
baumerParticipantThanks a lot for a quick help again!
October 6, 2021 at 6:02 am #323278
Aizaz Imtiaz AwanKeymasterHello,
If you do not mind, can you please leave a 5 stars rating for our Theme & Customer and Technical Support by going here: http://themeforest.net/downloads It will allow us to release more updates and provide dedicated support in future. It would encourage our work a lot. If you like our Theme and Support.
Thanks for contacting us.
Have a great day:-)
Topic Closed.
Best Regards. -
AuthorPosts
The topic ‘header error’ is closed to new replies.
- You must be logged in to create new topics. Login / Register