1 year, 4 months ago #29808
when deleting items from woocommerce via
$product = wc_get_product($id);
The items still show in the suggestions dropdown without image or link, but it doesn’t show in search page.
1 year, 4 months ago #29811
- This topic was modified 1 year, 4 months ago by wpsolr.
WPSOLR removes a post from the index when the WP ‘save_post’ hook is sent, for instance when a post is trashed.
But I just noticed that wp_delete_post() does not send the hook ‘save_post’.
To fix this issue, the hook ‘after_delete_post’ will be added on next WPSOLR release.
For now, you could trash the product before deleting it to remove it from the index.
Or change line 116 of file /wpsolr-pro/wpsolr/core/wpsolr_include.inc.php :
add_action( 'save_post', 'add_remove_document_to_solr_index', 999, 3 );
add_action( 'save_post', 'add_remove_document_to_solr_index', 999, 3 ); do_action( 'after_delete_post', 'add_remove_document_to_solr_index', 10, 2 );
1 year, 3 months ago #29864
- This reply was modified 1 year, 4 months ago by wpsolr.
There is another issue we also noticed when we first installed the plugin.
we are using Dokan with woocommerce, when we disable a vendor, their products do not get removed from the index also. but I will open a separate thread for this as I need the check the status of products when the vendor is disabled
You must be logged in to reply to this topic.