Shopify / Shopify/buy-button-js

Components use different money format config option

Open
#481 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.