How to save custom field data on a gift card edit page?

For saving the custom fields data on the gift card product edit page. You can use the following code in functions.php

 

add_action('wps_wgm_giftcard_product_type_save_fields', 'wps_wgm_save_custom_filed')

function wps_wgm_save_custom_filed( $product_id ){

$custom_price = isset( $_POST[''wps_custom_price''] ) ? sanitize_text_field( wp_unslash( $_POST[''wps_custom_price''] ) ) : 0;

update_post_meta( $product_id, '_custom_price', $custom_price );

}

Was this Helpful ?

CONTACT

Ready to transform how you market your business

Let's get connected for a free consultation