Use of Hook to show current categorised recent viewed featured most viewed products with Product Slider Pro Plugin
Fri Mar 17 2023 05:21:04 GMT+0000 (Coordinated Universal Time)
Saved by
@hasan1d2d
//Code to show current categorised recent viewed featured most viewed products
add_filter( 'sp_wpspro_arg', 'wpspro_current_categorised_recent_viewed_featured_most_viewed_products', 10, 2 );
function wpspro_current_categorised_recent_viewed_featured_most_viewed_products($arg, $shortcode_id) {
if('187' == $shortcode_id || '189' == $shortcode_id || '190' == $shortcode_id ) {
$wpspro_current_category_obj = get_queried_object();
if ( isset( $wpspro_current_category_obj->term_id ) ) {
$arg['tax_query'][] = array(
'taxonomy' => 'product_cat',
'field' => 'term_id',
'terms' => $wpspro_current_category_obj->term_id,
'operator' => 'IN',
);
}
}
return $arg;
}
content_copyCOPY
https://drive.google.com/drive/u/0/folders/1jC_9AcPzP8kHmGULo5D9RHx1l9tiTjwe
Comments