'; woocommerce_wp_checkbox( array( 'id' => Eligibility::META_NO_RETURN, 'label' => __( 'Not returnable', 'returnkit' ), 'description' => __( 'Customers can\'t request a return for this product (ReturnKit).', 'returnkit' ), ) ); woocommerce_wp_checkbox( array( 'id' => Eligibility::META_NO_WITHDRAWAL, 'label' => __( 'No right of withdrawal', 'returnkit' ), 'description' => __( 'A legal exception to the EU right of withdrawal, for example sealed hygiene goods, made-to-order or perishable items. Make sure your terms say so.', 'returnkit' ), ) ); wp_nonce_field( 'rtkt_product', 'rtkt_product_nonce' ); echo ''; } /** * Save. * * @param \WC_Product $product Product. * @return void */ public static function save( $product ) { if ( ! $product instanceof \WC_Product || ! isset( $_POST['rtkt_product_nonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_POST['rtkt_product_nonce'] ) ), 'rtkt_product' ) ) { return; } foreach ( array( Eligibility::META_NO_RETURN, Eligibility::META_NO_WITHDRAWAL ) as $key ) { if ( ! empty( $_POST[ $key ] ) ) { $product->update_meta_data( $key, 'yes' ); } else { $product->delete_meta_data( $key ); } } } }