Support » Plugin: WooCommerce » Set Product type in database

  • Resolved peteincali2103


    I am trying to manually input a subscription product into the wordpress database with custom code. I am able to insert a simple product along with the post_meta, but I

    do not see a post_meta value for the product type. Does anyone know how this product type is stored in the database?

Viewing 1 replies (of 1 total)
  • I figured this out, to set the product type, instead of using update_post_meta, you use:

    wp_set_object_terms( $productID, ‘subscription’, ‘product_type’ );

Viewing 1 replies (of 1 total)
  • The topic ‘Set Product type in database’ is closed to new replies.