Changing the parameters of deleted items
-
Thanks again for the wonderful plugin!
Please tell me, when importing, if the product is not in the file, I change its visibility in the catalog using the following code:<?php function my_is_post_to_delete( $is_post_to_delete, $post_id, $import ) { // Unless you want this code to execute for every import, check the import id // if ( $import->id == 5 ) { ... } if ( $product = wc_get_product( $post_id ) ) { $product->set_catalog_visibility( 'hidden' ); $product->save(); } return false; } add_filter( 'wp_all_import_is_post_to_delete', 'my_is_post_to_delete', 10, 3 ); ?>
How can I modify this code to change not only the visibility in the directory, but also:
1) Specify the text “Out of stock” instead of the price
2) Remove the Buy button
3) Add the button “View the entire section of this category”I understand that I am impudent with such a request. But nevertheless, suddenly you have already encountered such a problem and you have a ready-made solution.
Thank you so much!
The page I need help with: [log in to see the link]
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Changing the parameters of deleted items’ is closed to new replies.