Last active
September 9, 2021 02:08
-
-
Save nayemDevs/2ece4051ed257126e9e9075aa96347ff to your computer and use it in GitHub Desktop.
Shipping class option required on single product page
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
function dokan_can_edit_product_shipping_filed_validation( $errors ) { | |
if ( stripslashes( isset( $_POST['_disable_shipping'] ) ) && 'yes' == $_POST['_disable_shipping'] ) { | |
$errors[] = __( 'Please select shipping option', 'dokan-lite' ); | |
} | |
if ( $_POST['product_shipping_class'] < 1 ) { | |
$errors[] = __( 'Please select shipping class', 'dokan-lite' ); | |
} | |
return $errors; | |
} | |
add_filter( 'dokan_can_edit_product', 'dokan_can_edit_product_shipping_filed_validation', 35, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Help! I tried using it but my website crashed. Could you please help me?
P.S. I appreciate very much your hard work!