Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Hello Shihab, sorry to see you hare having other troubles. I think productid is saving, but the saved value does not get populated on the form because the saved value is assigned to $id, but the form displays the value of $productid, which is undefined at that point. Change the assignment of $id to $productid in the 5th line of the product_meta_options() function. The form will then display the saved value.

    The reason the template does not display values is you confused form field names and meta names. All meta names have a preceding underscore as in ‘_category’, corresponding to a form field name of ‘category’. If you change all the meta names in calls to get_post_meta() on the template to be preceded with an underscore (i.e. change ‘category’ to ‘_category’ and similar for each meta name) you should then see the saved values.

Viewing 1 replies (of 1 total)
  • The topic ‘what error in my CPT and Template ?’ is closed to new replies.