Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function johnproject_save_check_shipping( $post_id ) {
- if(!is_valid_shipping_destination($_POST["attribute_values"][1][0], $_POST["attribute_values"][2][0]))
- $error = $WP_Error("broke","Your product does not qualify for shipping. Please review your specifications carefully and try again.");
- return false
- }
- add_action( 'save_post', 'johnproject_save_check_shipping' );
- function johnproject_presave_check_shipping( $data ) {
- if(!is_valid_shipping_destination($_POST["attribute_values"][1][0], $_POST["attribute_values"][2][0]))
- $error = $WP_Error("broke","Your product does not qualify for shipping. Please review your specifications carefully and try again.");
- return $data;
- }
- add_filter( 'wp_insert_post_data', 'johnproject_presave_check_shipping' );
- function is_valid_shipping_destination($productType,$productVariation)
- {
- // for test purposes, always return false to see if errors are reported on product page
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement