WordPress.org

Ready to get started?Download WordPress

Forums

WP eCommerce
Code to add Custom Meta (3 posts)

  1. icouper
    Member
    Posted 10 months ago #

    I'm trying to create a function that will dynamically add in a custom meta field for a product on save. Can someone point me to the documentation/code that would allow me to do this?

    I'm assuming I can use a standard WP hook to run the function when the product is saved, but I'm not sure what function I need to create a custom metal field for the product.

    Any help would be appreciated.

    http://wordpress.org/plugins/wp-e-commerce/

  2. Lee Willis
    Member
    Plugin Author

    Posted 10 months ago #

    You should be able to use standard WP hooks for all of it. Products are custom post types, so you can store info in post meta as you would with a WordPress post.

  3. icouper
    Member
    Posted 10 months ago #

    I've tried using "add_post_meta" and "update_post_meta", but I haven't been able to get a custom field to be added.

    I'm using the following custom post type hooks for the function:
    "new_to_publish_wpsc-product"
    "draft_to_publish_wpsc-product"
    "pending_to_publish_wpsc-product"

    Any thoughts?

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.