Last active
September 24, 2025 14:38
-
-
Save plugin-republic/3fd8196a9045e2c8de039decf8618a36 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Remove quantity field from single product pages for specific products | |
| * Update list of product IDs | |
| */ | |
| function pr_is_sold_individually_product_list( $individually, $product ) { | |
| if( in_array( $product->getid(), array( 1234, 5678 ) ) ) { // Update the IDs in this list | |
| $individually = true; | |
| } | |
| return $individually; | |
| } | |
| add_filter( 'woocommerce_is_sold_individually', 'pr_is_sold_individually_product_list', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment