• 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/

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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.

    Thread Starter icouper

    (@icouper)

    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?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Code to add Custom Meta’ is closed to new replies.