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

Prevent showing a product when it is not cataloged correctly #2085

Open
vivaltech opened this issue Oct 30, 2023 · 2 comments
Open

Prevent showing a product when it is not cataloged correctly #2085

vivaltech opened this issue Oct 30, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@vivaltech
Copy link
Contributor

vivaltech commented Oct 30, 2023

Describe the bug
Faststore shows the PDP of products with no associated price, stock, or logistics in the backend.

Expected behavior
The PDP should not be displayed if the product does not meet the conditions of the documentation:

Why is the product not visible on the website?

The product and its SKUs must be in the Catalog with all the details filled in correctly, as explained in the Adding products tutorial.

The product must have a price associated with it.

The product must be included in the store’s logistics settings. This means that all settings for inventory, loading docks, carrier, weight, dimensions, etc, must correspond to the product in question.

Current behavior
Currently, the 404 page component only validates if the url exists, but it should also validate the product information.

Steps to reproduce
A step-by-step on how to reproduce the bug behavior.

  1. You need a product that has no price or stock.
  2. Then access the PDP in Faststore.
  3. It will show you a product without price or stock.

Possible Solution
Maybe the error should be addressed from two points:

ErrorBoundary:
.faststore\src\sdk\error\ErrorBoundary\ErrorBoundary.tsx
image

And the PageProvider:
node_modules@faststore\core\src\sdk\overrides\PageProvider.tsx
image

Additional context
Add any other context, screenshots, or comments about the problem.

@vivaltech vivaltech added the bug Something isn't working label Oct 30, 2023
@hellofanny
Copy link
Contributor

Thank you for reporting this issue. The team will discuss about it 🚀

@Lucaspoladore
Copy link

I have validated this with this product https://www.vtexfaststore.com/awesome-granite-cheese/p on our faststore core site.

If you go into the admin, there's no inventory or price for any of it's SKUs.

If you do a search on catalog, it shows nothing.

image

If you do a search on the API used by FS to query the IS, it also shows no results.

image

But, if you reach the PDP url directly (which could happen easily on a highly ranked SEO page for example), the product still appears.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants