Geo Location Filtering Search Results
-
Hi – fantastic plugin mate.
Quick question – I am also using a plugin called WooCommerce Geolocation Based Products. I need the ability for users from the US to not see certain products / categories. The plugin works great, except with this ajax search plugin (which still shows the results).
I have been looking through the code, and it seems like the Geo Plugin hooks into the api and hides the products / categories.
I was hoping to see if you could point me to the hooks I could use to get this working with your plugin.
For example: The Geo Plugin does the following:
add_filter( ‘woocommerce_product_categories_widget_args’, array( $this, ‘hide_from_categories_view’ ) );
add_filter( ‘woocommerce_products_widget_query_args’, array( $this, ‘hide_from_products_widget’ ) );and functions like this:
public function hide_from_products_widget( $args ) {
if ( $this->matches ) {
$product_ids = array_filter( array_map( ‘absint’, $this->matches[‘products’] ) );$args[‘post__not_in’] = array_unique( array_merge( $product_ids, $this->get_product_ids_from_excluded_cats() ) );
}return $args;
}Any help would be incredibly appreciated. I believe I could make it work if you could tell me the name of the add_filter to use.
Cheers
Pete
- The topic ‘Geo Location Filtering Search Results’ is closed to new replies.