WordPress.org

Forums

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

  1. peteincali2103
    Member
    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?

    http://wordpress.org/plugins/woocommerce/

  2. peteincali2103
    Member
    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

Tags

No tags yet.