WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. peteincali2103
    Member
    Posted 10 months 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 10 months 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' );

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.