Home Forums WoodMart support forum Product variation name is not showing in wishlist

Product variation name is not showing in wishlist

Viewing 22 posts - 1 through 22 (of 22 total)
  • Author
    Posts
  • #547021

    refa
    Participant

    Hi,

    I am showing variation products as a single product. When I added the product to the wishlist it was not showing with the variation name like on the shop/category page instead, it showed as a variable name. If the product has two or more variations then it’s showing fine.

    Also, I want to show the count number on the wishlist icon like the cart icon, how to do that?

    Can you please check and resolve this issue? I attached screenshots for your reference.

    Thank you,

    #547251

    Luke Nielsen
    Keymaster

    Hello,

    In this case, is there any chance that you could give me access to the dashboard area so I can have a look at the settings on your website, please?

    Kind Regards

    #549738

    refa
    Participant

    Sorry for the delayed response.

    I’ve shared the testing website credentials below. If you want to deactivate any plugin/theme for testing, please do.

    I noticed one more issue, which is when I add any products to the wishlist for the first time it’s not showing on the wishlist page I have to add it again to appear.

    Please find the attached a video for your reference.

    Thank you,

    #550176

    Luke Nielsen
    Keymaster

    Hello,

    The thing is that the “Hide parent product” is not working on the Wishlist page, so as a result you can see some products without attribute names because the parent product can be shown there: https://prnt.sc/q56NKQU-s1Qu

    For now, it works in such a way.

    Kind Regards

    #550236

    refa
    Participant

    How to resolve this? It is coming if the product has only variation, if it has multiple variations then it appears with attributes.

    #550777

    Luke Nielsen
    Keymaster

    Hello,

    In general, it’s not a bug that the parent product can be shown on the Wishlist page.

    In WooCommerce, a variation product has separate simple products that do not have a single product page and are called variations. Our show single variation option when active displays these variations as separate products, but when you go to the single product page of these products, it redirects you to the main product page with this variation selected. When you add products to the wishlist, for example, on the shop page, you add a variation, not the main product, but when you add a product to the wishlist on a single product page, you add the main variation product, and unfortunately, it is impossible to correct this. All we can recommend to you is to hide the Wishlist button on a single product and to add products to the Wishlist only on the archive page.

    Kind Regards

    #551309

    refa
    Participant

    I understood the variation product doesn’t have a separate page but at least the variation we choose should come, right? If it is not coming then showing wishlist items is useless. At least it would help if you allowed customers to see the product variation in the wishlist similar to the “YITH woocommerce wishlist” plugin. I attached the screenshot for your reference.

    I also had a problem showing variation products on the related product slider then you helped me with a custom code that worked. I need a similar way to achieve this.

    You are allowing customers to see the variation product as a single product on the product page, product sliders, cart page, and checkout page, so why not on the wishlist page?

    Also in my screen record video, there is a problem with showing the wishlist items on the wishlist page, in the icon it is showing the numbers but when I go to the page sometimes it is showing, and sometimes it is not.

    Also, when the customer logs out the wishlist items are still there, it shouldn’t be there.

    Attachments:
    You must be logged in to view attached files.
    #551488

    Luke Nielsen
    Keymaster

    Hello,

    1. Sorry for now it works in such a way but the team consider changing it in future updates.

    2. Please send some screenshots of the issue in the related product slider.

    Thank you for your time and patience.

    Kind Regards

    #552198

    refa
    Participant

    If the add to wishlist from the product slider is correctly working, and from the single product page is not working can I use the same link that is used on the product slider to the single product page using any template override or custom functions?

    Also as I mentioned earlier, for the first time when I add the product to the wishlist it is not showing, I have to do it again to make it appear, and if I logged in and add some products to the wishlist then I logout still those products are showing in wishlist. How to fix these two issues?

    #552417

    Luke Nielsen
    Keymaster

    Hello,

    1. For now, there is no possible custom code because, in the button setting the ID of the product is defined that will be added to the wishlist.

    2. The below code, will clear the wishlist after log out from an account.

    add_action('wp_logout', function() {
    	if ( ! function_exists( 'woodmart_set_cookie' ) ) {
    		return;
    	}
    
    	$cookie_products_name = 'woodmart_wishlist_products';
    	$cookie_count_name    = 'woodmart_wishlist_count';
    
    	if ( is_multisite() ) {
    		$cookie_products_name .= '_' . get_current_blog_id();
    		$cookie_count_name    .= '_' . get_current_blog_id();
    	}
    
    	woodmart_set_cookie( $cookie_products_name, '' );
    	woodmart_set_cookie( $cookie_count_name, '' );
    });

    Also, clear the browser cache/cookie and recheck the issue with the first time added product.

    Kind Regards

    #552569

    refa
    Participant

    Thank you, the code works for me.

    The first time added a product to the wishlist issue was still there. I cleared the cache and cookies from my browser. I checked with different browsers and systems, but the issue remains.

    Please help me to resolve this issue.

    Thank you,

    #552787

    Luke Nielsen
    Keymaster

    Hello,

    I made a video from my side: https://dropmefiles.com.ua/en/QGN2 as you can see it looks like it works well.

    Please send me a video from your side so I can try to replicate the issue.

    Kind Regards

    #552923

    refa
    Participant

    You can check the video from the below link. This issue only happens when I try to add a product to my wishlist for the first time after that, it’s working fine.

    https://we.tl/t-dmvu3ufoPg

    #553373

    Luke Nielsen
    Keymaster

    Hello,

    Okay, may I disable 3rd party plugins and enable the parent theme for testing?

    Looking forward to collaborating with you!

    Kind Regards

    #553743

    refa
    Participant

    Please do..

    #554045

    Luke Nielsen
    Keymaster

    Hello,

    I apologize for the delay.

    Could you please update the password: https://prnt.sc/wO_1a0LWqMnQ ?

    Looking forward to hearing back from you!

    Kind Regards

    #554048

    refa
    Participant

    Hi,

    Please find it below

    #554227

    Luke Nielsen
    Keymaster

    Hello,

    In the wp-content\themes\woodmart\inc\integrations\woocommerce\modules\wishlist\class-wishlist.php file find the remove_unnecessary_products function and replace it with the below code:

    public function remove_unnecessary_products() {
    		if ( is_user_logged_in() ) {
    			if ( ! get_user_meta( get_current_user_id(), 'wishlist_cleared_time', true ) ) {
    				update_user_meta( get_current_user_id(), 'wishlist_cleared_time', time() );
    			}
    
    			$wishlist_cleared_time = get_user_meta( get_current_user_id(), 'wishlist_cleared_time', true );
    		} else {
    			if ( ! woodmart_get_cookie( 'wishlist_cleared_time' ) ) {
    				woodmart_set_cookie( 'wishlist_cleared_time', time() );
    			}
    
    			$wishlist_cleared_time = woodmart_get_cookie( 'wishlist_cleared_time' );
    		}
    
    		$wishlist_cleared_time = intval( $wishlist_cleared_time );
    
    		if ( time() < $wishlist_cleared_time + DAY_IN_SECONDS ) {
    			return;
    		}
    
    		foreach ( $this->get_all() as $product_data ) {
    			$product_id  = $product_data['product_id'];
    			$wishlist_id = ! empty( $product_data['wishlist_id'] ) ? $product_data['wishlist_id'] : $this->get_id();
    
    			if ( 'publish' !== get_post_status( $product_id ) || 'product' !== get_post_type( $product_id ) ) {
    				$this->remove( $product_id, $wishlist_id );
    			}
    		}
    
    		$this->update_count_cookie();
    
    		if ( is_user_logged_in() ) {
    			update_user_meta( get_current_user_id(), 'wishlist_cleared_time', time() );
    		} else {
    			woodmart_set_cookie( 'wishlist_cleared_time', time() );
    		}
    }

    Kind Regards

    #554539

    refa
    Participant

    Thank you, it worked.

    I put this code in my parent theme, if I update the theme in the future the function will go right? Is there any way to put this on a functions.php or child theme to avoid it?

    Also, where can I find the single product page add to wishlist and homepage slider wishlist functions if I want to customize it?

    #554991

    Luke Nielsen
    Keymaster

    Hello,

    The above code will be added globally in the next update so you do not need it in the child theme.

    As for the customization of add to wishlist, you can find that functionality in /inc/integrations/woocommerce/modules/wishlist/class-ui.php

    https://prnt.sc/r0QyYD3CY2GL

    Kind Regards

    #560185

    refa
    Participant

    Hi,

    The wishlist issue has not been resolved even after the last two updates I received. At least, provide a custom solution to resolve it. I am still facing the same wishlist issue with the variable products.

    #560338

    Luke Nielsen
    Keymaster

    Hello,

    Firstly, please update the Core plugin and recheck the issue – https://prnt.sc/RE8g4p0zRvJC

    Let me know the result.

    Kind Regards

Tagged: 

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