-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add ads label product card #2582
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
packages/components/src/molecules/ProductCard/ProductCardContent.tsx
Outdated
Show resolved
Hide resolved
packages/components/src/molecules/ProductCard/ProductCardContent.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
packages/components/src/molecules/ProductCard/ProductCardContent.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -54,6 +54,10 @@ | |||
--fs-product-card-wide-bkg-color : var(--fs-color-neutral-bkg); | |||
--fs-product-card-wide-min-width : 9rem; | |||
|
|||
// Sponsored Label |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mariana-caetano We've update these tokens, I've already created a task to update it :) Thanks https://vtex.slack.com/archives/C01664JGV43/p1733767718144659
## What's the purpose of this pull request? Enable Ad label indicator in `ProductCard`. Since products are duplicated in the Product Gallery, it's important to clearly indicate which products are sponsored. This will help prevent users from finding the duplication confusing. Additionally, we want to provide an easier way to customize the sponsored label. To achieve this, we're adding the label to the ProductCard and enable text customization via the CMS. |Before|After| |-|-| ![no-label](https://github.com/user-attachments/assets/0429bf10-7954-4a17-a827-1225970c3f95)|![label](https://github.com/user-attachments/assets/a6e95a6b-f3ad-4fb5-8e40-f2e5f6adf4db) TODO: - [ ] Run cms sync in the main account to reflect the `sections.json` changes. - [ ] Update `ProductCard` component doc with new tokens related to sponsored-label - I'll create a ticket when merging this PR - [x] Verifying with IS team if sponsored products should be included in the count parameter (it's a bug or feature) - current scenario setting the query with `count=12` its returning 13 products. [thread](https://vtex.slack.com/archives/C03L3CRCDC4/p1733413820077979?thread_ts=1733356825.821979&cid=C03L3CRCDC4) ## How it works? Changing the label via CMS, the default text is `Sponsored` |Admin|Store| |-|-| ![admin-cms](https://github.com/user-attachments/assets/e9cfa44d-c543-477f-9f37-88b026120fa9)|![faststore-label](https://github.com/user-attachments/assets/837e8098-bb9c-4bfb-bb88-1feb2d21a03d) ## How to test it? 1. Run the store locally 2. On `discovery.config.js`file, update `showSponsored` setting. ``` // Platform specific configs for API api: { ... showSponsored: true, } ``` 3. Change via CMS, you can use my test account [fannyads](https://fannyads--storeframework.myvtex.com/admin/new-cms/faststore/) - On the Product List Page: Look for Product Card Configuration, and update the `Sponsored Label` input. - Update the text and save. Use the [CMS mode preview](https://developers.vtex.com/docs/guides/faststore/headless-cms-previewing-changes-in-development-mode) to visualize the change in the store. - You should be able to see the Label with the text. ### Starters Deploy Preview [Preview Link - PLP](https://sfj-2e9ae6b--starter.preview.vtex.app/office?category-1=office&fuzzy=0&operator=and&facets=category-1%2Cfuzzy%2Coperator&sort=score_desc&page=0) [Test PR](vtex-sites/starter.store#628) ## References [Jira ticket](https://vtex-dev.atlassian.net/jira/software/c/projects/SFS/boards/1051?selectedIssue=SFS-1607) [Ad Network (Beta)](https://help.vtex.com/pt/tutorial/vtex-ad-network-beta--2cgqXcBuJmXN2livQvClur)
What's the purpose of this pull request?
Enable Ad label indicator in
ProductCard
.Since products are duplicated in the Product Gallery, it's important to clearly indicate which products are sponsored. This will help prevent users from finding the duplication confusing. Additionally, we want to provide an easier way to customize the sponsored label. To achieve this, we're adding the label to the ProductCard and enable text customization via the CMS.
TODO:
sections.json
changes.ProductCard
component doc with new tokens related to sponsored-label - I'll create a ticket when merging this PR - taskcount=12
its returning 13 products. threadHow it works?
Changing the label via CMS, the default text is
Sponsored
How to test it?
discovery.config.js
file, updateshowSponsored
setting.Sponsored Label
input.Starters Deploy Preview
Preview Link - PLP
Test PR
References
Jira ticket
Ad Network (Beta)