Shopify / Shopify/buy-button-js
Components use different money format config option
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 260
- Forks
- 122
- Avg merge
- 5d 14h
- Merged PRs (30d)
- 2
Description
Hi there,
I stumbled upon an issue regarding the money formats: The products component uses this.globalConfig.moneyFormat for formatting prices, while the cart component uses this.config.moneyFormat.
This forces the user of the library to define the money format twice:
UI.createComponent('collection', {
id: '123456789',
node: elem,
moneyFormat: '{{amount_no_decimals}}€',
options: {
moneyFormat: '{{amount_no_decimals}}€',
}
});
The first definition will be used by product component, the second will be used by the cart. IMO this should be unified to simplify the configuration.
Cheerio :)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the products and cart components used by UI.createComponent('collection'), and trace how each reads the moneyFormat option. Compare the globalConfig and config paths described in the issue. Done means both components use one unified money-format configuration without requiring duplicate definitions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100