Plugin Author
ILLID
(@mihail-barinov)
Hello,
Can you please give me some screenshot of ATUM inventory plugin dashboard where I can see how you made these product hidden for the search results?
Regards
Hi ILLID,
ATUM are using hooks to filter rather than using the product level hidden product. (we have also tried making the raw material product hidden but this also surprisingly still shows in the AJAX search)
They have said:
https://www.stockmanagementlabs.com/addons/atum-product-levels/
“We’ve added some hooks to Product Levels to prevent they from showing on standard WooCommerce queries (like the shop list page or the product page or the default WP search) but if this plugin you are using is not following the WooCommerce standards to search for products, it’s going to just show up all the products you have (no matter is a BOM or not).”
Happy to get the code they used if that makes it easier, or a category filter solution.
Here is a screenshot of the setting to hide these products: https://ibb.co/X3sm4Y9
Plugin Author
ILLID
(@mihail-barinov)
Looks like I found the solution for you. Please use following code snippet
add_filter( 'aws_indexed_data', 'my_aws_indexed_data', 10, 2 );
function my_aws_indexed_data( $data, $id ) {
if ( class_exists( 'AtumProductLevelsAddon' ) ) {
$is_purchasable = AtumLevels\Inc\Helpers::is_purchase_allowed( $id );
if ( ! $is_purchasable ) {
$data = array();
}
}
return $data;
}
You need to add it somewhere outside the plugins folder. For example, inside functions.php file of your theme or use some plugin for adding code snippets.
Also, after adding this code, you need to re-index the plugin table.
Thank you ILLID much appreciated