• Resolved skunkbad

    (@skunkbad)


    If I have a custom field, for instance a field for phone extension, and I don’t prefix the name with an underscore, then this plugin creates 2 postmeta rows, one for the name I set, and one with an underscore prefix.

    So, if I created that field with name “billing_phone_ext”, then I end up with 2 postmeta rows, one with meta_key “billing_phone_ext“, and one with meta_key “_billing_phone_ext“.

    Simply naming the field with the underscore prefix eliminates the problem, but we now must perform some DB maintenance and get rid of the extra rows. 1000s of rows.

    The other part of this is that this creates a data integrity issue if I’m only expecting one of these fields in the database. I change one, yet the other stays with the original value.

    Is there a way to have a name without underscore prefix and not have this issue?

    • This topic was modified 1 year, 4 months ago by skunkbad. Reason: more info
Viewing 1 replies (of 1 total)
  • Plugin Author ThemeHigh

    (@themehigh)

    Please be informed that in WooCommerce, when a billing prefix is provided, it is stored using an underscore(_) key.

    When an order is created, we are saving it using the “woocommerce_checkout_update_order_meta” hook, resulting in the data being saved twice.

    To prevent the data from being saved twice, it is necessary to save it without the “billing_” prefix.

    Unfortunately, currently, it is the only feasible option available.

    Thank you!

Viewing 1 replies (of 1 total)
  • The topic ‘Prefix w/ underscore, or duplicate data in order meta’ is closed to new replies.