Adding a new property to an existing entity via plugin?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
Hi all,

I was wondering what the best way to add a new field to an entity.
For example I would like to add a new field called "Product Video Url" to the product entity.

I've read the guide "Updating an existing entity. How to add a new property." found at http://docs.nopcommerce.com/pages/viewpage.action?pageId=1442499

However this seems to just override the existing entities.

Is there a way I can achieve this via developing a plugin?

I understand there are attributes you can add but there not really ideal.

Any help would be great.

Thanks
5 years ago
Hi,

You can't extend an entity without changing it.

You can create a new table in your plugin to store the additional data and map the records from the custom table to the products using the ProductId.

Regards,
Stoyan
5 years ago
Cheers, I kinda thought that might be the case.

I also just found the documentation for creating a plugin with data access so gonna give that ago.

https://docs.nopcommerce.com/display/en/Plugin+with+data+access

Thanks
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.