How to extend ProductVariant with plugin

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 anos atrás
Hello,

I need to develop a payment method (credit card gateway) that supports partial payments.

My question is, within the plugin, how should i extend the ProductVariant to add fields to configure if that product supports partial payment and how much portions ?

This kind of settings needs to be per-product variant.

Thanks!
12 anos atrás
I have actually been considering this same exact thing and this is what I came up with that seems fairly powerful.

I built a core plugin that adds a few tables (ie ProductVariantExtendedMetaData, ProductExtendedMetaData, CategoryExtendedMetaData, etc.) The data domain and service logic behind these tables follows suite for what the devs at nopCommerce have done with CustomerAttributes.

I then wrote some helper actions, functions to display the data in a separate tab on the admin interface for the respective configuration screens. Of course this requires you to edit the admin views for those screens but their isn't a whole lot of options for that scenario as of right now.

I am however writing (and will contribute back to nopCommerce if they would like a few new plugin types):
1. ProductPlugin
2. ProductVariantPlugin
3. CategoryPlugin

The idea behind them is that you can obviously configure additional data for any of those entities without regard to hard coded table fields. Also any plugin that inherits one of those from above would be automatically installed under a plugin tab on their respective configuration screens and that plugin could have it's own set up for additional data about the entities.

I suppose the idea could be used as groundwork for a way to customize just about anything about an entity using nothing more than some user interface screens on the admin side.

I should be done within a couple weeks if you are interested in such a solution / idea.
12 anos atrás
Hello,

Yes, the current modeling lacks of Metadata for things like this.

It think they really should consider implement this in the next version, because right now, we cant extend domains with a plugin, if do not want to distribute a lot of files to replace (which is a bad idea for a project with this level of activity).

Thanks for your reply!
12 anos atrás
Hi Cybernexus,
I'm interested in your idea of having a ProductVariantPlugin type. I am implementing a plugin that requires a one to one relationship with ProductVariant and accounting system data.
Did you ever finish it off?

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