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

fix: Don't render PDP with no price #2142

Closed
wants to merge 1 commit into from
Closed

Conversation

Gmantiqueira
Copy link
Contributor

@Gmantiqueira Gmantiqueira commented Dec 4, 2023

What's the purpose of this pull request?

Related to #2085, we were rendering PDPs with no associated price. They doesn't show in PLPs, but we can access the URL.

How it works?

This PR fixes that triggering the 404 page when we have no price associated.

How to test it?

Check those products, they're without price:

https://sfj-da92366--starter.preview.vtex.app/awesome-granite-cheese/p
https://sfj-da92366--starter.preview.vtex.app/sleek-wooden-chair-16834618/p

Starters Deploy Preview

References

@Gmantiqueira Gmantiqueira requested a review from a team as a code owner December 4, 2023 12:13
@Gmantiqueira Gmantiqueira requested review from icazevedo and renatamottam and removed request for a team December 4, 2023 12:13
Copy link

vercel bot commented Dec 4, 2023

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

Name Status Preview Updated (UTC)
faststore-site ✅ Ready (Inspect) Visit Preview Dec 4, 2023 0:13am

Copy link

codesandbox-ci bot commented Dec 4, 2023

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.

Latest deployment of this branch, based on commit ecefaad:

Sandbox Source
Store UI Typescript Configuration

Copy link
Contributor

@icazevedo icazevedo left a comment

Choose a reason for hiding this comment

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

How can I test it? Do you have a faulty product?

@Gmantiqueira
Copy link
Contributor Author

How can I test it? Do you have a faulty product?

Sorry! I was still deploying, updated the description!

@@ -214,9 +214,13 @@ export const getStaticProps: GetStaticProps<

const { data, errors = [] } = searchResult

const hasPrice = data?.product?.offers.offers.some(
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we should move this logic to the faststore/api, throwing an isNotFoundError from there.

@hellofanny
Copy link
Contributor

@Gmantiqueira do we still need this PR?

@hellofanny
Copy link
Contributor

Hey people! Just a quick update - I'm closing this PR as it seems the problem was actually due to an indexing issue. 👍
cc: @Gmantiqueira

@hellofanny hellofanny closed this Feb 19, 2024
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