I am creating a dedicated WordPress ecommerce website without using WooCommerce for myself. I created the custom post type called 'products' but now I am stuck on how to add specific terms like SKU, price, variations, short description, and related products section in it.
Can you please help me know. I don't know if I can specifically make sections to update such terms in the product post type.
I am creating a dedicated WordPress ecommerce website without using WooCommerce for myself. I created the custom post type called 'products' but now I am stuck on how to add specific terms like SKU, price, variations, short description, and related products section in it.
Can you please help me know. I don't know if I can specifically make sections to update such terms in the product post type.
Share Improve this question asked Feb 10, 2021 at 5:28 Rishabh JhaRishabh Jha 12 Answers
Reset to default 0I think you should save this data in post_meta.
These values are part of every single product post and are different in every product.
You can add custom input fields with add_meta_box()
function in the hook add_action('add_meta_boxes', 'my_custom_metaboxes');
for example.
The easy way?
Just use Custom Post Type UI to create custom taxonomies (in your case: SKU, price, variations, short description, and related products).
And for the admin page, use ACF to add meta boxes to your products edit screen.
That's what I did. Then you can concentrate to other matters.