• Resolved gabri85

    (@gabri85)


    I’m using a company’s webhook which only allows a metadata key to be exactly: Activation Date

    With this checkout plugin the key/id can’t have any spaces so they can’t match the field, so activation_date for example is not possible. Is it possible to use a key/id which does allow spaces? Using this plugin?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author ThemeHigh

    (@themehigh)

    Unfortunately, your requirement is not possible due to some validation in our plugin.

    But if required, you can try some code snippet that copies the value of the meta key created by the checkout field editor into a custom meta key.

    We hope this helps.

    Thank you!

    Thread Starter gabri85

    (@gabri85)

    Hi,

    I also edited the key/id directly in the database, however in the admin panel the change is not displayed. So I guess there is an extra validation like you mentioned.

    Do you perhaps have a code snippet example like you mentioned? If that’s all what is needed. Thanks.

    Plugin Author ThemeHigh

    (@themehigh)

    Can you please try adding the below code in your active theme’s functiosn.php file?

    add_action('woocommerce_checkout_update_order_meta', 'th_checkout_update_order_meta', 11, 2);
    function th_checkout_update_order_meta($order_id, $posted){
            $value = isset($posted['activation_date']) ? $posted['activation_date'] : '';
            if($value){
                    update_post_meta($order_id, 'Activation Date', $value);
            }
    }

    We hope this helps.

    Thank you!

    Thread Starter gabri85

    (@gabri85)

    Wow amazing, that worked!

    Plugin Author ThemeHigh

    (@themehigh)

    Great!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Change id/key to allow spaces’ is closed to new replies.