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

Add 'Voucher:' before voucher code on edit cart page #13061

Conversation

kernal053
Copy link
Contributor

What? Why?

What should we test?

  • When voucher is used in an order as a shopper, edit cart page will contain "Voucher:" text before voucher code.
  • Check also for translated "Voucher" text.

Release notes

Changelog Category (reviewers may add a label for the release notes):

  • User facing changes
  • API changes (V0, V1, DFC or Webhook)
  • Technical changes only
  • Feature toggled

The title of the pull request will be included in the release notes.

Dependencies

Documentation updates

Before:
Screenshot 2025-01-04 at 2 19 39 PM

After:

Screenshot 2025-01-04 at 2 20 04 PM

@drummer83
Copy link
Contributor

Thank you, @kernal053! That was super fast!

Is it ready for review?

@kernal053
Copy link
Contributor Author

Is it ready for review?

Yes.

@drummer83
Copy link
Contributor

Great! I wonder if it makes sense to use the same string as we do in other places. That way at least those ones where we want the format 'Voucher: Code' are always the same.
See app/views/checkout/summary.html.haml.

What do you think? Does it make sense, @kernal053?

@kernal053
Copy link
Contributor Author

Yes, it makes sense to ensure consistent format.

So, should I go ahead and make similar changes inapp/views/checkout/_summary.html.haml& app/views/spree/orders/_totals_footer.html.haml(for order confirmation page) witht(:order_voucher_label, code: adjustment.label)format ?

@drummer83
Copy link
Contributor

I was thinking the other way round? 🤔

@rioug
Copy link
Collaborator

rioug commented Jan 6, 2025

Looks like there is more work to be done here, and also could you address the rubocop warning ? Moving back to in process.

@kernal053
Copy link
Contributor Author

I was thinking the other way round? 🤔

@drummer83 Apologies, I thought it will provide flexibility for customizing format if needed in future with just changing scope in en.yml such as Voucher (CODE), CODE (Voucher) ?

If we're planning to keep format 'Voucher: Code' then I will change it to same string as we are using in other places currently.

@drummer83
Copy link
Contributor

If we're planning to keep format 'Voucher: Code' then I will change it to same string as we are using in other places currently.

Yes, let's keep the format because the positions above and below have the same format and they are hard coded as well.

Thanks again, especially for your patience, and sorry for the confusion.

Copy link
Member

@dacook dacook left a comment

Choose a reason for hiding this comment

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

Good fix, and great work on the specs, thank you!

I like the idea of using the translation engine as you suggested, but it's good that this is consistent with other parts of the app 👍

Copy link
Member

@mkllnk mkllnk left a comment

Choose a reason for hiding this comment

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

Thank you.

@filipefurtad0 filipefurtad0 self-assigned this Jan 17, 2025
@filipefurtad0 filipefurtad0 added the pr-staged-fr staging.coopcircuits.fr label Jan 17, 2025
@filipefurtad0
Copy link
Contributor

Hey @kernal053 ,

Thanks for this improvement!

I was able to verify the change you've introduced:

Before this PR

image

After this PR

image

This closes the underlying issue and can be merged.
Thanks again 🎉

@filipefurtad0 filipefurtad0 removed the pr-staged-fr staging.coopcircuits.fr label Jan 17, 2025
@filipefurtad0 filipefurtad0 merged commit ace3bfa into openfoodfoundation:master Jan 17, 2025
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add 'Voucher:' before voucher code on edit cart page
6 participants