Continue reading WooCommerce: Aelia Prices by Country product visibility

WooCommerce: Aelia Prices by Country product visibility

Aelia has a Prices by Country for WooCommerce plugin, which can adjust prices based on customer country and hide products unavailable in a specific country. Jason James shared a function that makes Relevanssi hide unavailable products in search: This function uses the relevanssi_post_ok filter hook to control which posts are included in the search and…

Read more WooCommerce: Aelia Prices by Country product visibility 0 Comment on WooCommerce: Aelia Prices by Country product visibility
Continue reading WooCommerce: Make Relevanssi notice stock changes

WooCommerce: Make Relevanssi notice stock changes

In some cases, WooCommerce product stock level changes don’t affect the search immediately. If the search is set up to exclude out-of-stock items, a product that sells out may still be included in the search until the next reindexing. This happens because changes in the stock status don’t trigger a WordPress post update that Relevanssi…

Read more WooCommerce: Make Relevanssi notice stock changes 0 Comment on WooCommerce: Make Relevanssi notice stock changes
Continue reading WooCommerce: Searching for orders

WooCommerce: Searching for orders

Searching for shop orders is tricky with WooCommerce. WooCommerce blocks searching the orders. WooCommerce also keeps the order data in many different tables. Because of this complexity, the shop_order post type is not available for indexing. You can enable it by adding this to your site: This is not enough, though. The order use custom…

Read more WooCommerce: Searching for orders 0 Comment on WooCommerce: Searching for orders
Continue reading WooCommerce 4.4 problems

WooCommerce 4.4 problems

Updating WooCommerce to version 4.4 breaks Relevanssi searches. After updating WooCommerce to version 4.4, Relevanssi searches no longer find results. This problem is caused by changes in WooCommerce. Those who are interested in the details can go read the GitHub issue I created. For those interested in solving the problem, the next version of Relevanssi…

Read more WooCommerce 4.4 problems 7 Comments on WooCommerce 4.4 problems
Continue reading WooCommerce: Return only exact matches for SKU searches

WooCommerce: Return only exact matches for SKU searches

This little filter function works on relevanssi_hits_filter. When a search query is made that matches an SKU (or any other custom field, but SKUs are the most likely scenario here), only results that match the SKU will be returned. For this to work, Relevanssi must be set to index the _sku custom field (because otherwise,…

Read more WooCommerce: Return only exact matches for SKU searches 1 Comment on WooCommerce: Return only exact matches for SKU searches
Continue reading WooCommerce: Indexing product variation SKUs for main product

WooCommerce: Indexing product variation SKUs for main product

Relevanssi can index product and product variation SKUs for WooCommerce products: just add _sku to list of custom fields to index. However, if you want to find the main product when searching for the product variation SKU, you need some extra code using the relevanssi_content_to_index filter hook. Add this function to your site and rebuild…

Read more WooCommerce: Indexing product variation SKUs for main product 14 Comments on WooCommerce: Indexing product variation SKUs for main product
Continue reading WooCommerce: Hidden products in search

WooCommerce: Hidden products in search

Relevanssi by default shows out-of-stock and excluded from catalogue WooCommerce products in the search results, but hides those set to excluded from search (before 2.2.2 and 4.1.2 the default behaviour was to show all products). It is quite easy to make Relevanssi not display hidden products in the results. The best way is to unindex…

Read more WooCommerce: Hidden products in search 23 Comments on WooCommerce: Hidden products in search
Continue reading WooCommerce: Popularity and price sorting

WooCommerce: Popularity and price sorting

Many WooCommerce users use search sorting that allows users to sort by popularity or price. Unfortunately, while Relevanssi works fine with WooCommerce, those sorts do not work. Relevanssi doesn’t know about price or popularity, and the sorting assumes there’s a default WP search underneath. Relevanssi doesn’t do meta field sorting as easily as the default…

Read more WooCommerce: Popularity and price sorting 39 Comments on WooCommerce: Popularity and price sorting