Skip to content

Instantly share code, notes, and snippets.

@codersaiful
Created November 16, 2023 04:10
Show Gist options
  • Save codersaiful/5d7520ddcdbb03c2ab8780acb3faa521 to your computer and use it in GitHub Desktop.
Save codersaiful/5d7520ddcdbb03c2ab8780acb3faa521 to your computer and use it in GitHub Desktop.
<?php
/**
* If you want to set Zero for default quantity value,
* this function and hook will help you.
*
* @author Saiful Islam <codersaiful@gmail.com>
*/
add_filter('woocommerce_quantity_input_min','wpt_custom_default_quantity_zero');
function wpt_custom_default_quantity_zero(){
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment