Comments Saroj Subedi started the conversationMarch 15, 2021 at 9:18amI needed to implement recently viewed product query .add_action( 'elementor/query/dv_recently_viewed_products', function( $query ) { //$query->set( 'posts_per_page', 3 ); // Get recently viewed product cookies data $viewed_products = ! empty( $_COOKIE['woocommerce_recently_viewed'] ) ? (array) explode( '|', $_COOKIE['woocommerce_recently_viewed'] ) : array(); $viewed_products = array_filter( array_map( 'absint', $viewed_products ) ); //var_dump($viewed_products ); //$query->set( 'post__in', $viewed_products ); $query->set( 'post__in', array( 11069,11065 ) ); } ); The widget isn't accepting the Query ID. Max replied privately Max replied privately Sign in to reply ...
I needed to implement recently viewed product query .
add_action( 'elementor/query/dv_recently_viewed_products', function( $query ) {
//$query->set( 'posts_per_page', 3 ); // Get recently viewed product cookies data $viewed_products = ! empty( $_COOKIE['woocommerce_recently_viewed'] ) ? (array) explode( '|', $_COOKIE['woocommerce_recently_viewed'] ) : array(); $viewed_products = array_filter( array_map( 'absint', $viewed_products ) ); //var_dump($viewed_products ); //$query->set( 'post__in', $viewed_products ); $query->set( 'post__in', array( 11069,11065 ) );
} );
The widget isn't accepting the Query ID.