vtex-apps / product-summary

VTEX Product Summary app
11 stars 51 forks source link

Feature: implement sponsored product badge and wrapper #381

Closed hcaula closed 1 year ago

hcaula commented 1 year ago

What problem is this solving?

This PR adds the "Sponsored" badge in sponsored products, as well as adds some data-properties.

To collect sponsored product metrics, the Activity Flow script will observe for specific data-properties in the HTML.

This PR adds these data-properties in a wrapper. When a product is not sponsored, the wrapper simply returns the children.

How to test it?

TBD: we're creating a test workspace with mocked sponsored products. When it's ready, I'll add it here.

To test it, search for a term and inspect a sponsored product. The data-properties should be there.

Screenshots

The badge style can be manipulated with CSS in the classes sponsoredBadgeContainer and sponsoredBadge.

image

Related to / Depends on

https://github.com/vtex-apps/product-summary-context/pull/24

vtex-io-ci-cd[bot] commented 1 year ago

Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖

Please select which version do you want to release:

And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.

vtex-io-docs-bot[bot] commented 1 year ago

Beep boop :robot:

I noticed you didn't make any changes at the docs/ folder

In order to keep track, I'll create an issue if you decide now is not a good time

hcaula commented 1 year ago

Closing in favor of this new app I've made:

https://github.com/vtex-apps/sponsored-products