• Resolved humam33

    (@humam33)


    Hello

    Can I change the code to be searching in one specific category?

    For example: “Trainer” category the slug is “trainer” when I’ll start the search it show me the products in “Trainer” category only and ignore other categories.

    Thank you

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Damian Góra

    (@damian-gora)

    Hello,

    You can use the filter dgwt_wcas_products_args. F.e.:

    
    add_filter('dgwt_wcas_products_args', function($args){
    
    	$keyword = $args['s']; // Your keyword, f.e.Trainer
    
    	/*
    	 * Your code...
    	 * - check if you have product category equals "trainer"
    	 * - if yes, add tax query to the $args array: https://codex.wordpress.org/Template_Tags/get_posts#Taxonomy_Parameters
    	 */
    
    	return $args;
    
    })
    
Viewing 1 replies (of 1 total)

The topic ‘one specific category’ is closed to new replies.