Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Marketplace (WooCommerce Multivendor Marketplace) › Prefilled Product Addons
- This topic has 0 replies, 1 voice, and was last updated 4 years, 7 months ago by david_kogan.
Viewing 0 reply threads
- AuthorPosts
- April 14, 2020 at 4:20 pm #119014david_koganParticipant
I created a custom product type if this product type is chosen by the vendor I would like to prefill the product addons settings.
I managed it already for the WordPress frontend, but I can’t manipulate the wcfm product to have the required meta_data.
Here is my code:
if ( 'auto-draft' === get_post_status( $post_ID ) && get_post_type( $post_ID ) == 'product' ) { if ( wc_get_product( $post_ID ) ) { //@formatter:off $data = unserialize('a:1:{....}'); add_post_meta( $post_ID, '_product_addons', $data, false ); add_post_meta( $post_ID, '_product_addons_exclude_global', '1'); //@formatter:on } }
The post when creating a a product via the wcfm is not the actual product is a page so it won’t work.
Is there a way to prefill the post_meta with content for the product template?
- AuthorPosts
Viewing 0 reply threads
- You must be logged in to reply to this topic.