Tag: Update

  • woocommerce_process_shop_coupon_meta

    This is the filter that is responsible for saving your field data for the coupon.

    [php]
    function webdav_newcoupon_save_data( $post_id ) {
    $newcoupon_fields = array (
    // Your fields should be listed here as an array of
    // strings.
    );
    foreach ($newcoupon_fields as $field) {
    $value = isset($_POST[ $field ]) ? $_POST[ $field ] : ”;
    update_post_meta($post_id, $field, $value);
    }
    }
    add_filter( ‘woocommerce_process_shop_coupon_meta’, ‘webdav_newcoupon_save_data’, 10, 1 );
    [/php]