Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add additional info into Product now? #110

Closed
sailorsamoor opened this issue Jul 18, 2018 · 4 comments
Closed

How to add additional info into Product now? #110

sailorsamoor opened this issue Jul 18, 2018 · 4 comments
Labels

Comments

@sailorsamoor
Copy link

sailorsamoor commented Jul 18, 2018

Hello. I created new site, and changed Product model to as I read in the blog.

If I want to add some additional field into current Product model - e.g. second (third) price - what should I do? (Maybe some tutorial is existing).

Best regards,
Vladimir.

@kloon
Copy link
Member

kloon commented Jul 19, 2018

@sailorsamoor you would use the same CRUD functions as is recommended at present. $product->add_meta_data function.

Using that function will ensure your data goes to the right table, at present any additional product data will go into the wp_postmeta table, but if #108 realises it might go to a new table. Using that function will ensure you do not need to update your extensions or custom code constantly to keep up.

@manospsyx
Copy link

@kloon Note that #108 was not about migrating all existing product/post meta to a new table, or storing product meta in a new table. After all, we have no way to tell which of the meta associated with a product ID are WooCommerce-related, and which are not. Moving all of them to a new table would cause issues to plugins that simply see a WooCommerce product as a custom WP post type.

The suggestion in #108 was to introduce a new meta table and let developers decide whether they want to leverage it in their CRUD classes. A good use of that table would be to store product properties of custom product types -- not meta in general.

@kloon
Copy link
Member

kloon commented Jul 26, 2018

Right, sorry for the confusion then. Will have a discussion with the team regarding this and will take it from there.

@sailorsamoor
Copy link
Author

Well, but if I create the meta data, which will be used only me - I just do it, right? I do not need to use any another plugins for work with my meta data - this is only my functionality.

Can I use the new Product model in future production - can I hope that the interface will be permanent?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants