Skip to content

Instantly share code, notes, and snippets.

@fervous
Last active October 26, 2017 01:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fervous/911250bf26f97fbd49e848f515721314 to your computer and use it in GitHub Desktop.
Save fervous/911250bf26f97fbd49e848f515721314 to your computer and use it in GitHub Desktop.
hide / remove charge only once / qty override in store settings shipping pro dashboard for vendors wc vendors pro
add_filter( 'wcv_shipping_national_qty', 'change_wcv_shipping_national_qty' );
function change_wcv_shipping_national_qty( $field ) {
$field['label'] = __( '' );
$field['type'] = 'hidden';
$field['value'] = 'no';
$field['wrapper_start'] = __( '' );
$field['wrapper_end'] = __( '' );
return $field;
}
@digitalchild
Copy link

You forgot to pass the field variable to the function. Fixed. But it still didn't work because there was a bug in the qty override code for the shipping class. Which I have now fixed.


add_filter( 'wcv_shipping_national_qty', 'change_wcv_shipping_national_qty' );
function change_wcv_shipping_national_qty( $field ) {
		$field['label'] = __( '' );
		$field['type'] = 'hidden';
		$field['value'] = 'yes'; 
		return $field;
}
add_filter( 'wcv_shipping_international_qty', 'change_wcv_shipping_international_qty' );
function change_wcv_shipping_international_qty( $field ) {
		$field['label'] = __( '' );
		$field['type'] = 'hidden';
		$field['value'] = 'yes'; 
		return $field;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment