Skip to content

Empty checkout form items, (especially checkboxes) may not be saved #2074

@jbeales

Description

@jbeales

I have added a checkbox to my checkout form. When it's checked WPeC saves the value of the checkbox as expected, but if it's not checked the value is not saved - most likely because its array key does not exist in the $_POST array.

I believe the culprit is here, in _wpsc_checkout_customer_meta_update() in theme-engine-v1/helpers/ajax.php, where post data is only saved if isset( $checkout_post_data[$form_field['id']] ) returns true - and that won't happen for an unchecked checkbox.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions