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

PricePart currency configuration. #51

Merged
merged 2 commits into from
Feb 13, 2020

Conversation

microposmp
Copy link
Contributor

Added a settings option on PricePart that makes it possible to configure/restrict what currencies are possible to select when entering data for a product. This way rules can be setup when the product type is designed and make the entered data more reliable.

Possible options:

  1. All Currencies - The only option available today. If not configured when attaching the PricePart to a type this is the default.
  2. Default Currency - Restricts the PricePart to the configured default currency. Useful for sites that only sells in a single market/region.
  3. Specific Currency - The idea with this option is to make it possible to restrict the currency that can be selected for PricePart to a specific currency. Right now this option is disabled.

On a product type multiple PricePart objects can be attached with different configurations.

Some examples:

A site that only sells in one market/region can add a single PricePart to the product type and configure it to use the default currency.

A site that targets multiple markets/regions can add more than one PricePart when designing the product type. One PricePart with the default currency and additional PricePart objects configured for a specific currency. For this to work some kind of pricing strategy will need to be configured that selects the price in the correct currency.

image

Copy link
Member

@bleroy bleroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a few suggestions, but in general, if the feature isn't feature complete, I would rather have it live on its own branch until it is, if that's ok with you. Thanks for the contribution, this should be very useful.

@microposmp
Copy link
Contributor Author

Thanks for the review. It's ok to keep it in this branch until it's complete. Just wanted some feedback on the idea of how to handle this. This replaces the old idea to configure what currencies should be available to select on the site.

@bleroy
Copy link
Member

bleroy commented Feb 12, 2020

Yes, I like it better as a setting on the part. Maybe later there can be an additional mode with multi-selection.

@microposmp microposmp force-pushed the pricepart-currency-configuration branch from f043084 to d62247f Compare February 12, 2020 21:55
@microposmp
Copy link
Contributor Author

Now all review points should be ok. I've thought about multi-selection mode. For that I think we should have a different display in the admin. For example if 3 currencies are selected it should draw 3 entry fields so it will be consistent which currency amount is entered in each separate entry field.

@microposmp microposmp force-pushed the pricepart-currency-configuration branch 2 times, most recently from 2833ed0 to 5f45c97 Compare February 13, 2020 00:04
@microposmp microposmp force-pushed the pricepart-currency-configuration branch 3 times, most recently from d35f72c to 58e8306 Compare February 13, 2020 10:24
@microposmp microposmp force-pushed the pricepart-currency-configuration branch from 58e8306 to 31186c9 Compare February 13, 2020 10:36
@microposmp
Copy link
Contributor Author

Thanks for great feedback during the review.

I plan to look at multiple selection mode later. Probably after a pricing strategy is in place that will support selecting the correct currency. It can be achieved today by adding multiple PriceParts to a product type with different currencies.

For multiple selection mode I think about 2 scenarios:

  1. Selecting via the dropdown. Subset of all currencies option available today.
  2. A new display mode in admin that will show multiple amount entry fields. One for each currency that is configured in the subset. I think this will provide a better experience for users maintaining products.

@bleroy
Copy link
Member

bleroy commented Feb 13, 2020

I'm partial to columns of checkboxes for this type of multiple choice.

@bleroy bleroy merged commit 042c74f into OrchardCMS:master Feb 13, 2020
@bleroy
Copy link
Member

bleroy commented Feb 13, 2020

Thanks for the contribution!

@microposmp microposmp deleted the pricepart-currency-configuration branch February 13, 2020 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants