Custom action on product buik edit (status -> archived)
-
Hi,
following one of your suggestion used in the forum, I added a custom snipped to my child theme for changing automatically the visibility of a product when it has been archived (a sort of custom action).Specifically:
add_action( 'wcfm_after_product_archived', function( $product_id ) { $product = wc_get_product( $product_id ); $product->set_catalog_visibility( 'hidden' ); $product->save(); });
That is perfect!
The issue is that it’s obviously not working during the bulk edit of the products (but only when you archived a product using the specific button in the back-end gui). It’s quite hard to do that one by one if you have 1M products to be archived for example ??
Moreover, there is another case that is so much important:
If we configured when a vendor is disabled (for no membership renewal) all products will be archived, these products are still visible in the woocommerce list (visibility is not hidden but catalog & search).I know that we can do it manually but a vendor can disable itself on its own, it’s very hard to intervene always manually.
Could you please provide a solution for this? Is there any kind of custom action on vendor disabled and/or product bulk edit?
Thanks a lot.
The page I need help with: [log in to see the link]
- The topic ‘Custom action on product buik edit (status -> archived)’ is closed to new replies.