Add "Buy one, get one" pricing and read currency from wcSettings#17
Merged
vbelolapotkov merged 1 commit intoJul 8, 2026
Merged
Conversation
- Offer BOGO in the pricing-type select; it is value-less, so the amount input is hidden with a help line and only the cycle scope applies - Write the value-less bogo policy on save and render "Buy one, get one" in the plans list - Source store currency from window.wcSettings (mapping symbolPosition and precision) instead of a duplicated server payload; depend on wc-settings - Cover both with JS unit tests and a REST to DB round-trip integration test
Contributor
Author
|
Folding into #16 - this is part of the same plans-UI parity work, not a separate PR. The commit now lives on update/plans-ui-canonical-parity. |
7f2bcb0
into
update/plans-ui-canonical-parity
1 of 2 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The storewide plans manager should offer the free-tier BOGO ("buy one, get one") pricing type, matching the canonical WooCommerce Subscriptions plans UI. Separately, the client was duplicating the store's currency settings in a server payload when WooCommerce already exposes them client-side.
What
{ type: 'bogo' }policy on save, and the list column renders "Buy one, get one".window.wcSettings. Currency is read from WooCommerce's own client-side settings (mappingsymbolPositionto position andprecisionto decimals) instead of a duplicated server payload. The bundle depends onwc-settings; a USD fallback covers the global being absent.Merge order
The pricing type relies on the engine's new
bogoPricingPolicytype landing via woocommerce/woocommerce#66379. CI resolves the engine from trunk, so the bogo REST round-trip test stays red until that engine change is on trunk. Draft, and do not merge before that engine PR lands.Stacked on #16 (the parity pass); retarget to trunk after #16 merges.