Skip to content
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

Merged
merged 7 commits into from
Dec 9, 2024

Conversation

hellofanny
Copy link
Contributor

@hellofanny hellofanny commented Dec 4, 2024

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 label

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 - task
  • 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

How it works?

Changing the label via CMS, the default text is Sponsored

Admin Store
admin-cms faststore-label

How to test it?

  1. Run the store locally
  2. On discovery.config.jsfile, update showSponsored setting.
 // Platform specific configs for API
  api: {
    ...
    showSponsored: true,
  }
  1. Change via CMS, you can use my test account fannyads
    • 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 to visualize the change in the store.
    • You should be able to see the Label with the text.

Starters Deploy Preview

Preview Link - PLP
Test PR

References

Jira ticket
Ad Network (Beta)

Copy link

vercel bot commented Dec 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
faststore-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 9, 2024 5:28pm

Copy link

codesandbox-ci bot commented Dec 4, 2024

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.

@hellofanny hellofanny marked this pull request as ready for review December 4, 2024 23:49
@hellofanny hellofanny requested a review from a team as a code owner December 4, 2024 23:49
@hellofanny hellofanny requested review from emersonlaurentino and lariciamota and removed request for a team December 4, 2024 23:49
@hellofanny hellofanny self-assigned this Dec 5, 2024
@hellofanny hellofanny changed the title Feat: Add ads label product card sfs 1607 Feat: Add ads label product card (SFS-1607) Dec 5, 2024
@hellofanny hellofanny changed the title Feat: Add ads label product card (SFS-1607) feat: Add ads label product card (SFS-1607) Dec 5, 2024
Copy link
Contributor

@lariciamota lariciamota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🎉
image

Copy link
Member

@eduardoformiga eduardoformiga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
I am just wondering if it would be better to wait until the IS issue is addressed so that we can prevent gaps among ProductGrids. WDYT?
Edit: my bad, I think we can merge once this PR is just related to the label and we have another task to address the issue.
Screenshot 2024-12-06 at 17 57 02

@hellofanny hellofanny changed the title feat: Add ads label product card (SFS-1607) feat: add ads label product card Dec 9, 2024
@hellofanny hellofanny merged commit ae6f655 into main Dec 9, 2024
11 checks passed
@hellofanny hellofanny deleted the feat/add-ads-label-product-card-sfs-1607 branch December 9, 2024 18:05
@@ -54,6 +54,10 @@
--fs-product-card-wide-bkg-color : var(--fs-color-neutral-bkg);
--fs-product-card-wide-min-width : 9rem;

// Sponsored Label
Copy link
Contributor Author

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

emersonlaurentino pushed a commit that referenced this pull request Jan 10, 2025
## 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants