Tagged: product variation, woocommerce
- This topic has 2 replies, 2 voices, and was last updated 5 years, 4 months ago by
sebastianmerk.
Viewing 2 reply threads
-
AuthorPosts
-
-
October 4, 2016 at 5:29 pm #7412
sebastianmerkParticipantI use the example code of the piklist-demo to reference woocommerce products within my custom post type. For simple products this works right out of the box. But I can´t get my head around how to do this with product variations:
array( 'type' => 'select' ,'field' => '_' . piklist::$prefix . 'item_contracted' ,'label' => __('Contracted Item', 'myinventory') ,'columns' => 12 ,'choices' => piklist( get_posts(array( 'post_type' => 'product' ,'numberposts' => -1 ,'orderby' => 'title' ,'order' => 'ASC' )) ,array('ID', 'post_title') ) ,'relate' => array( 'scope' => 'post' ) )Would be great if someone could point me in the right direction.
Thanks Sebastian
-
October 5, 2016 at 1:54 pm #7414
DanParticipantHi, this is on my list to look into. However as a starting point this hook may be of interest. It’s where I’m staring this evening – will let you know how I get on!!
woocommerce_cli_save_product_variation
https://docs.woocommerce.com/wc-apidocs/source-class-WC_CLI_Product.html#1781 -
October 5, 2016 at 3:40 pm #7415
sebastianmerkParticipantSounds great. Will look into it as well. Keep me posted
-
-
AuthorPosts
Viewing 2 reply threads
- You must be logged in to reply to this topic.