Support » Plugin: YITH WooCommerce Recently Viewed Products » Not a “true” recently viewed products plugin

  • It does not show exactly what products were viewed recently. It shows products related by tags and categories to what was viewed previously, so you see random products instead.

Viewing 1 replies (of 1 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi,
    yes, currently the plugin shows products related by tags and categories to what was viewed previously. I understand that plugin’s name can cause confusing.
    Anyway If you want to show only viewed products just add this code on your custom functions.php

    add_filter( 'yith_wrvp_similar_products_template_args', 'yith_wrvp_get_only_viewed_products', 10, 1 );
    function yith_wrvp_get_only_viewed_products( $args ){
    
    	$user_id = get_current_user_id();
    	// set cookie name based on user id
    	$cookie_name = 'yith_wrvp_list_' . $user_id;
    
    	$list = isset( $_COOKIE[ $cookie_name ] ) ? unserialize( $_COOKIE[ $cookie_name ] ) : array();
    	$args['post__in'] = $list;
    
    	return $args;
    }

    Let me know, regards 🙂

Viewing 1 replies (of 1 total)
  • The topic ‘Not a “true” recently viewed products plugin’ is closed to new replies.