Skip to content

Customer pricing

<storesynk-customer-pricing> is the PDP customer-pricing advisory widget (“Log in - Wholesale members save 20%” / a member preview price). It renders the one live customer-pricing rule the Storesynk app synced that targets the current product (PUBLIC_READ $app:customer_pricing metaobjects, discovered via the shop-level customer_pricing metafield; product match runs client-side). Like the bundle/volume widgets it needs the app’s concrete metafield namespace (namespace here, or app-namespace on <storesynk-store>); no namespace → the widget stays [ss-empty] (SSK-211). Three visitor states, switched on the login state: anonymous → prompt mode (the template’s <show-pricing-prompt> renders the login copy); logged-in member (profile tags ∩ rule tags) → member mode (the preview price with the struck original, [ss-member] on the host, always labeled by <show-pricing-note>); logged-in non-member → nothing ([ss-empty]). SSR-adopted like the volume widget (ss-adopt / ss-customer-pricing-key), holding its decision until the session settles.

The member preview is ADVISORY. The engine never treats the preview math as the price - the cart’s discountAllocations (once buyerIdentity carries the customer token) are authoritative, and the app’s Discount Function applies the real cut at checkout. Always pair <show-pricing-price> with <show-pricing-note> (“Applied at checkout”).

  • Purpose: the widget root; consumes productContext, clones its first-child template once for the winning rule in a renderable state, and provides customerPricingContext.
  • Attributes:
    • namespace : string = "" - overrides the store-level app-namespace for this widget alone.
  • Required ancestor / context: storesynk-product (SSK-102) + storeContext. Provides customerPricingContext.
  • Children / template rule: its first element child is captured as the per-rule template (SSK-107) - free-form content (show-pricing-* displayers, a <log-in>, hardcoded copy); cloned once when there is something to say. Never put the regular price displayers (show-price / show-compare-price / show-unit-price) in the template (SSK-111): a product with no matching rule renders no clone, and the regular price disappears with it. Keep them siblings of the widget and swap the halves via :has(storesynk-customer-pricing[ss-member]) CSS (build-patterns §2.12, inline recipe). Multiple instances per page are fine - each selects its rule independently.
  • State it sets: [ss-loading] during fetch; [ss-member] in member mode; [ss-empty] when there is no live rule or the visitor is a logged-in non-member.

show-pricing-prompt / show-pricing-title / show-pricing-percentage / show-pricing-price / show-pricing-original-price / show-pricing-note

Section titled “show-pricing-prompt / show-pricing-title / show-pricing-percentage / show-pricing-price / show-pricing-original-price / show-pricing-note”
  • Purpose: the widget’s displayers, all consuming customerPricingContext.
    • show-pricing-prompt - the anonymous login copy (member mode: hidden). text attribute overrides the default; {title} / {discount} placeholders resolve from the rule.
    • show-pricing-title - the rule’s title (e.g. “Wholesale”), both modes.
    • show-pricing-percentage - the rule’s percentage (e.g. “20%”), both modes.
    • show-pricing-price - the member preview price (prompt mode: hidden). Money-formatted.
    • show-pricing-original-price - the undiscounted price for the struck compare-at (prompt mode: hidden). Money-formatted.
    • show-pricing-note - the “Applied at checkout” label (prompt mode: hidden). text attribute overrides the default.
  • Attributes: text on show-pricing-prompt and show-pricing-note; none on the others.
  • Required ancestor / context: storesynk-customer-pricing (SSK-105); the two price leaves also consume storeContext for money formatting.
  • State it sets: hidden + [ss-empty] when their leaf has nothing to show in the current mode.

Imported from the Storesynk skill v0.1.0 (references/component-reference.md). To change this page, change it there.