Skip to content

Instantly share code, notes, and snippets.

@MarkKevin08
Created December 31, 2020 10:04
Show Gist options
  • Save MarkKevin08/6a08cd6267d81f1d2990a91fc4543ff9 to your computer and use it in GitHub Desktop.
Save MarkKevin08/6a08cd6267d81f1d2990a91fc4543ff9 to your computer and use it in GitHub Desktop.
Flat rate - QTY auto checked
add_filter( 'wcv_product_shipping_fee_national_qty', 'change_default_product_shipping_fee_national_qty' );
function change_default_product_shipping_fee_national_qty() {
$field['id'] = '_shipping_fee_national_qty';
$field['label'] = __( 'Charge once per product for national shipping, even if more than one is purchased.', 'wcvendors-pro' );
$field['type'] = 'checkbox';
$field['value'] = 'yes';
$field['class'] = 'wcv-disable-national-input'; // This checks the checkbox
return $field;
}
add_filter( 'wcv_product_shipping_fee_international_qty', 'change_default_product_shipping_fee_international_qty' );
function change_default_product_shipping_fee_international_qty() {
$field['id'] = '_shipping_fee_national_qty';
$field['label'] = __( 'Charge once per product for national shipping, even if more than one is purchased.', 'wcvendors-pro' );
$field['type'] = 'checkbox';
$field['value'] = 'yes';
$field['class'] = 'wcv-disable-national-input'; // This checks the checkbox
return $field;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment