bleroy / Nwazet.Commerce

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

Localization of Attributes #110

Closed MatteoPiovanelli-Laser closed 7 years ago

MatteoPiovanelli-Laser commented 7 years ago

Continuing on #99 and #101, I made an extension feature to handle the localization of Attributes.

This is not unlike what was done in O1.10 for ContentPickerFields.

The feature adds the following settings/behaviours related to ProductAttributesPart of Products that also have a LocalizationPart (note: by correct culture, I mean the product's):

  1. On Update, the code will attempt to substitute attributes whose culture is different than the products with corresponding ones whose culture is correct.
  2. (Only available if 1. is active) If an attribute does not have a localization in the correct culture, it is simply deselected. If this option is not active, the attribute will remain selected.
  3. If some selected attribute is not in the correct culture, validation will fail and the Product will not save/publish
  4. Removes all attributes that are not in the correct culture from the Editor view of ProductAttributesPart.

The PR for this will come momentarily.

bleroy commented 7 years ago

Sounds good. I'll check out the PR.

MatteoPiovanelli-Laser commented 7 years ago

Closing this since the PRs have been merged