<?php

namespace Kanzu\StoreVoiceAI\Services;

// Prevent direct file access.
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}


class Product_Search {


    public function search_products_by_name($search_term){
        $args = [
            'post_type' => 'product',
            'posts_per_page' => 5, // Get multiple matching products (limit to 5 for simplicity)
            's' => $search_term,    // Search by name
        ];
    
        return new \WP_Query( $args );
    }


}