The wish list button on the home page can no longer be clicked.
-
Dear Support Team,
I am having an issue with the wish list button on the home page.
When I click on “Save,” the page loads, but the product is not added to the wish list. (This only happens on the home page; it works fine on the product page, etc.)
How can I fix this error?My theme: MaxstorePro
Best regards, Frank
The page I need help with: [log in to see the link]
-
Hello Frank,
thanks for contacting us!I could see the problem on your site. It’s probably due to some customization of your theme or another plugin, since the button shouldn’t refresh the page to add the item to the wishlist.
I recommend performing the following tests to see if the problem disappears at any point:
- Update the plugin, WC, and WP to the latest version.
- Switch to a default WP theme like 2025.
- Leave only WC and our plugin active, and activate your other plugins one by one until you find the conflicting one.
Could you check it, please?
Best regards.
Happy New Year! Thank you for your reply!
All plugins are up to date. I have deactivated all recently installed plugins (update) one after the other. Unfortunately, the error persists. However, it could be due to the Woocommerce plugin, as there was an update recently.
How else can I find or fix the error?
Hello there,
Have you tried changing your theme to a default WordPress theme like 2025?
Please let us know.
Best regards.
Hello, I don’t want to switch to a different theme. My shop is working very well so far, and until two weeks ago, the wish list was also working. With every new theme, the recognition value is lost, and other adjustments are necessary. Surely it must be possible to fix this with a CSS adjustment?
Good morning!
I have found a solution.
I changed the following code in functions.php (Theme: Maxstore Pro).Old:
function maxstore_pro_wishlist_products() {
if ( function_exists( 'YITH_WCWL' ) ) {
global $product;
$url = add_query_arg( 'add_to_wishlist', $product->get_id() );
$id = $product->get_id();
$wishlist_url = YITH_WCWL()->get_wishlist_url();
?>
<div class="add-to-wishlist-custom add-to-wishlist-<?php echo esc_attr( $id ); ?>">
<div class="yith-wcwl-add-button show" style="display:block"> <a href="<?php echo esc_url( $url ); ?>" rel="nofollow" data-product-id="<?php echo esc_attr( $id ); ?>" data-product-type="simple" class="add_to_wishlist"><?php _e( 'Merken', 'maxstore' ); ?></a><img src="<?php echo get_template_directory_uri() . '/img/loading.gif'; ?>" class="ajax-loading" alt="loading" width="16" height="16"></div>
<div class="yith-wcwl-wishlistaddedbrowse hide" style="display:none;"> <span class="feedback"><?php esc_html_e( 'Gemerkt!', 'maxstore' ); ?></span> <a href="<?php echo esc_url( $wishlist_url ); ?>"><?php esc_html_e( 'Wunschliste ansehen', 'maxstore' ); ?></a></div>
<div class="yith-wcwl-wishlistexistsbrowse hide" style="display:none"> <span class="feedback"><?php esc_html_e( 'Schon gemerkt!', 'maxstore' ); ?></span> <a href="<?php echo esc_url( $wishlist_url ); ?>"><?php esc_html_e( 'Zur Wunschliste', 'maxstore' ); ?></a></div>
<div class="clear"></div>
<div class="yith-wcwl-wishlistaddresponse"></div>
</div>
<?php
}
}
add_action( 'woocommerce_before_shop_loop_item', 'maxstore_pro_wishlist_products', 9 );New:
function maxstore_pro_wishlist_products() {
if ( ! function_exists( 'YITH_WCWL' ) ) {
return;
}
global $product;
if ( ! $product instanceof WC_Product ) {
return;
}
echo '<div class="add-to-wishlist-custom">';
// 👉 offizielles YITH Template (AJAX-fähig!)
echo do_shortcode('[yith_wcwl_add_to_wishlist]');
echo '</div>';
}
add_action( 'woocommerce_before_shop_loop_item', 'maxstore_pro_wishlist_products', 9 );This now works because it is retrieved directly from the Yith plugin.
*******
Now I have another problem with updating the counter in the header. The counter does not update automatically.
How can I change the following code so that it works? Or can I add something?Maxstore Pro / funktions.php
if ( !function_exists( 'maxstore_pro_cart_link' ) ) {
function maxstore_pro_cart_link() {
if ( get_theme_mod( 'cart-top-icon', 1 ) == 1 ) {
?>
<a class="cart-contents text-right <?php echo get_theme_mod( 'header-cart-style', 'cart-style-one' ); ?>" href="<?php echo esc_url( wc_get_cart_url() ); ?>" title="<?php esc_attr_e( 'Warenkorb anzeigen', 'maxstore' ); ?>">
<i class="fa fa-shopping-cart"><span class="count"><?php echo absint( WC()->cart->get_cart_contents_count() ); ?></span></i><span class="amount-title hidden-sm hidden-xs"><?php echo esc_html_e( 'Warenkorb ', 'maxstore' ); ?></span><span class="amount-cart"><?php echo wp_kses_data( WC()->cart->get_cart_subtotal() ); ?></span>
</a>
<?php
}
}
}
if ( !function_exists( 'maxstore_pro_head_wishlist' ) ) {
function maxstore_pro_head_wishlist() {
if ( function_exists( 'YITH_WCWL' ) ) {
$wishlist_url = YITH_WCWL()->get_wishlist_url();
?>
<div class="top-wishlist text-right <?php echo get_theme_mod( 'header-wishlist-style', 'cart-wishlist-one' ); ?>">
<a href="<?php echo esc_url( $wishlist_url ); ?>" title="<?php esc_attr_e( 'Wunschliste', 'maxstore' ); ?>" data-toggle="tooltip" data-placement="top">
<div class="fa fa-heart"><div class="count"><span><?php echo absint( yith_wcwl_count_products() ); ?></span></div></div>
</a>
</div>
<?php
}
}
}
// Header wishlist icon ajax update
add_action( 'wp_ajax_yith_wcwl_update_single_product_list', 'maxstore_pro_head_wishlist' );
add_action( 'wp_ajax_nopriv_yith_wcwl_update_single_product_list', 'maxstore_pro_head_wishlist' );
if ( !function_exists( 'maxstore_pro_header_cart' ) ) {
function maxstore_pro_header_cart() {
?>
<div class="header-cart-inner">
<?php maxstore_pro_cart_link(); ?>
<ul class="site-header-cart menu list-unstyled">
<li>
<?php the_widget( 'WC_Widget_Cart', 'title=' ); ?>
</li>
</ul>
</div>
<?php
if ( get_theme_mod( 'wishlist-top-icon', 0 ) != 0 ) {
maxstore_pro_head_wishlist();
}
?>
<?php
}
}
if ( !function_exists( 'maxstore_pro_header_add_to_cart_fragment' ) ) {
add_filter( 'woocommerce_add_to_cart_fragments', 'maxstore_pro_header_add_to_cart_fragment' );
function maxstore_pro_header_add_to_cart_fragment( $fragments ) {
ob_start();
maxstore_pro_cart_link();
$fragments[ 'a.cart-contents' ] = ob_get_clean();
return $fragments;
}
}Please help. Best regards, Franky
-
This reply was modified 3 months, 1 week ago by
franky4lee.
You must be logged in to reply to this topic.