SalesforceCommerceCloud / pwa-kit

React-based JavaScript frontend framework to create a progressive web app (PWA) storefront for Salesforce B2C Commerce.
https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/pwa-kit-overview.html
BSD 3-Clause "New" or "Revised" License
276 stars 126 forks source link

[Product Tile] Promotion callout message (@W-13974753@) #1786

Closed vmarta closed 1 month ago

vmarta commented 2 months ago

This PR implements the default behaviour for promotion callout. It relies on Alex's display-price work in her PR #1760 .

If the rendered price is a promotional price, we'll also render that promo's callout message in the ProductTile. Otherwise, if the variant has promotions, we'll show the callout from the very first promotion.

Types of Changes

Breaking changes include:

  • Removing a public function or component or prop
  • Adding a required argument to a function
  • Changing the data type of a function parameter or return value
  • Adding a new peer dependency to package.json

Changes

How to Test-Drive This PR

  1. Navigate to this PLP: /search?q=roll%20sleeve%20blouse
  2. Verify the promo callout message to be "10$ Off roll sleeve blouse". 34.16 is a promotional price, and we're rendering the callout message of that promotion.

Also, try other kinds of products:

Also, try other pages:

Checklists

General

Accessibility Compliance

You must check off all items in one of the follow two lists:

or...

Localization