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

Commerce: Promo codes on checkout #77

Merged
merged 10 commits into from
Mar 29, 2024
Merged

Commerce: Promo codes on checkout #77

merged 10 commits into from
Mar 29, 2024

Conversation

erikrakuscek
Copy link
Contributor

@erikrakuscek erikrakuscek commented Mar 28, 2024

We have 2 different types of discounts: percent (eg. 20% off) and amount (eg. $50 off).

Each Promo has property skus, which is an array of product SKUs to which the discount applies. If skus is undefined, the discount shall be applied to all items in the cart.

Only 1 promo code per order is allowed.

Requires bump of hanzo/commerce

image

image

@zeekay
Copy link
Member

zeekay commented Mar 28, 2024

On bank wire only show US instructions.

@zeekay
Copy link
Member

zeekay commented Mar 28, 2024

Make the credit card not collapsible and remove "CC", should say something like "Secure payments with .."

@zeekay
Copy link
Member

zeekay commented Mar 28, 2024

Show discount on line in order summary after promo is applied

@zeekay
Copy link
Member

zeekay commented Mar 28, 2024

Can you also add discount field when its mobile and order summary is collapsed? this is normal behavior also.

@zeekay
Copy link
Member

zeekay commented Mar 28, 2024

Other updates look great

@erikrakuscek
Copy link
Contributor Author

Can you also add discount field when its mobile and order summary is collapsed? this is normal behavior also.

Discount field already added to both mobile and desktop
image

moved Promo into it's own file: types/Promo
util/formatPrice -> formatCurrencyValue;
Copy link
Contributor

@artemis-prime artemis-prime left a comment

Choose a reason for hiding this comment

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

Please see my comments in util/promo-codes.ts

Create a task for yourself for post launch to do that. @erikrakuscek

@@ -0,0 +1,46 @@
'use server'
Copy link
Contributor

Choose a reason for hiding this comment

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

It should be the business of the Service, NOT some utitity somewhere to apply Promo codes.

There should be another optional argument to the impl, and getSingleton, and the ContextProvider, that is simply, 'promos'. For convenience, this can be pass in from @luxdefi/common/promos or something like that.

@artemis-prime artemis-prime merged commit aa4aabb into main Mar 29, 2024
1 of 4 checks passed
@artemis-prime artemis-prime deleted the commerce/promo-codes branch March 29, 2024 04:54
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.

checkout: enable promo / discount codes / gift cards
3 participants