WooCommerce - excelling eCommerce
[resolved] Set Product type in database (2 posts)

  1. peteincali2103
    Posted 1 year ago #

    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?


  2. peteincali2103
    Posted 1 year ago #

    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' );

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.