Forum Replies Created

Viewing 3 replies - 16 through 18 (of 18 total)
  • Thread Starter madla

    (@madla)

    What about the category information? Can I add that to the search?

    Would you mind sharing the test code you mentioned above? If I can see how your accessing the fields perhaps I can figure something out.

    Thread Starter madla

    (@madla)

    I’m stuck on that one. Based that post, I should be able to add a filter to add more to the search. But I don’t know that the right fields are. I’d like to search through category names and descriptions as well as production variation names and descriptions.

    From the post

    function custom_search_where($where) {
        // put the custom fields into an array
        $customs = array('custom_field1', 'custom_field2', 'custom_field3');
    
        foreach($customs as $custom) {
    	$query .= " OR (";
    	$query .= "(m.meta_key = '$custom')";
    	$query .= " AND (m.meta_value  LIKE '{$n}{$term}{$n}')";
            $query .= ")";
        }
    
        $where = " AND ({$query}) AND ($wpdb->posts.post_status = 'publish') ";
        return($where);
    }
    add_filter('posts_where', 'custom_search_where');

    Any help would be appreciated.

    Thread Starter madla

    (@madla)

    Let me ask the question a bit differently.

    From a FoxyCart perspective I want to be able to order each SKU.

    So I figured I can use variations. I setup each (3/4 tube and 7/8 tube) as a description field:
    Name & displayKey is the SKU and into the description field I entered the details.

    So will that allow me to order any one of those as well as all of those? What info is used to push foxyCart so it knows what the user wants to order?

Viewing 3 replies - 16 through 18 (of 18 total)