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

Currency selector #54

Merged
merged 3 commits into from
Feb 28, 2020
Merged

Conversation

microposmp
Copy link
Contributor

Implemented logic to be able to select the currency prices are shown in on the site. It builds on the configuration settings that were added to the PricePart.

There are two implementations added:

  1. NullCurrencySelector - Don't affect anything. DefaultCurrency returned from MoneyService will be displayed.
  2. CommerceSettingsCurrencySelector - Will use currency configured in commerce settings. Can be different from the default site currency configured. Good for testing.

Update in Startup.cs which implementation will be used.

Notes:

  • Changed PricePart to be reusable by default.
  • Updated PriceProvider to work with multiple currencies on a product. The selected currency is used for showing prices in the shopping cart.
  • Added a sample recipe for a product with multiple PriceParts.

@microposmp microposmp force-pushed the currency-display-strategy branch from 75d33f6 to 199de95 Compare February 15, 2020 19:26
@microposmp microposmp force-pushed the currency-display-strategy branch from 199de95 to dda3297 Compare February 17, 2020 18:10
@microposmp
Copy link
Contributor Author

I agree that the currency selector should be in it's own feature in the future. The current settings based implementation I think can be removed altogether when a more real world implementation is in place. I think it's good to have right now during early development when concepts are being tried out.

@microposmp microposmp force-pushed the currency-display-strategy branch from dda3297 to 0bbb926 Compare February 17, 2020 20:36
@microposmp
Copy link
Contributor Author

This is currently broken. Please wait with further review.

@microposmp microposmp force-pushed the currency-display-strategy branch from 2c65248 to 490c923 Compare February 22, 2020 11:18
Basic infrastructure for supporting price display in different currencies.
@microposmp microposmp force-pushed the currency-display-strategy branch from 490c923 to db4ae29 Compare February 27, 2020 19:47
Startup.cs Outdated
@@ -107,4 +105,14 @@ public override void Configure(IApplicationBuilder app, IEndpointRouteBuilder ro
);
}
}

// TODO: Move to it's own project? Think about Commerce solution structure...
Copy link
Member

Choose a reason for hiding this comment

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

I wouldn't.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed comment.

@bleroy
Copy link
Member

bleroy commented Feb 28, 2020

Is this good to merge now? LGTM.

Currency selector intended for (Dev/Test) scenarios.
@microposmp microposmp force-pushed the currency-display-strategy branch from 42b8178 to d1c8cd8 Compare February 28, 2020 19:47
@microposmp
Copy link
Contributor Author

It's ok to merge. Thanks.

@bleroy bleroy merged commit 22fbba7 into OrchardCMS:master Feb 28, 2020
@bleroy
Copy link
Member

bleroy commented Feb 28, 2020

Thanks!

@microposmp microposmp deleted the currency-display-strategy branch February 28, 2020 23:35
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.

3 participants