• I’m new to CMB2 and I’m trying to include a couple of CMB-fields on a custom pane of the WooCommerce product metabox.

    I’ve successfully adapted the “display on front-end” approach described here – https://webdevstudios.com/2015/03/30/use-cmb2-to-create-a-new-post-submission-form/ – to show the CMB-fields within the product pane. I’m adapting parts of the form submission function explained in the post and the respective snippet and I’m using the hook ‘woocommerce_process_product_meta’ to save the meta values from the CMB-fields. I’m also using the helper function I found here – https://github.com/CMB2/CMB2-Snippet-Library/blob/master/helper-functions/modify-cmb2_metabox_form-output.php – to remove the default submit button from the form so only the default post update button will submit the post.

    While this works I can’t help but wonder if I’m not missing a simpler, more standard way to display and submit a CMB2 field group in/from a different, non-cmb2 metabox if all fields are displayed on the same admin screen and will be submitted in the same $_POST?

    Thanks for a brief tip (if there is one). Thanks for the great plugin!

Viewing 1 replies (of 1 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    I’m not personally aware of any simpler way, but I’ve also never delved into the idea of having CMB2 save to WooCommerce spots either.

Viewing 1 replies (of 1 total)
  • The topic ‘Simple/r way to save fieldgroup form in a different, non-cmb2 admin metabox?’ is closed to new replies.