bleroy / Nwazet.Commerce

Idiomatic commerce module for Orchard CMS.
BSD 3-Clause "New" or "Revised" License
26 stars 21 forks source link

Product attributes don't export nicely #53

Closed bleroy closed 7 years ago

bleroy commented 10 years ago

Originally reported by: Bertrand Le Roy (Bitbucket: bleroy, GitHub: bleroy)


They lack a proper id.


MatteoPiovanelli-Laser commented 7 years ago

OK if I add a GUID?

bleroy commented 7 years ago

I really dislike GUIDs. I'd prefer if we could explore other possibilities. For instance, we could add a technical name for attributes, and generate that from its display name if it's not explicitly provided. What do you think?

MatteoPiovanelli-Laser commented 7 years ago

I agree that GUIDs are less than ideal in most cases. I will give a look at how the AutoRoutePart in Orchard generates and uses the DisplayAlias (not sure this is the name of the property) and get back to you on this. I am wondering if there is a way to throw some information form the Attribute values in it as well.

MatteoPiovanelli-Laser commented 7 years ago

The way I am implementing this right now, the technical name is part of an attribute's Identity, and is generated similarly to the way the technical name for Fields is generated during a ContentType's definition. Still have to implement the actual Import/export logic for ProductAttributePart and ProductAttributesPart

MatteoPiovanelli-Laser commented 7 years ago

In Exporting/Importing ProductAttributesPart, should I keep the "Ids" attribute for retrocompatibility? My idea is I'll keep it in Exporting, and consider it in Importing only if the new attribute that uses the TechnicalNames as identities is not there.

bleroy commented 7 years ago

No, ids should never make it to an export. Retrocompatibility is not that important for import/export, as those are not designed to be long-lived and there's no promise of back compat with them.