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

don't show featured products section if none exist (on not-found template) #852

Merged
merged 2 commits into from
May 6, 2024

Conversation

electricenjindevops
Copy link
Contributor

@electricenjindevops electricenjindevops commented May 5, 2024

What/Why?

The not found template doesn't account for stores that do not have any featured products, which is a dev error.

If featured products do not exist, not-found template still shows the section and the h3 headline. this commit fixes that with a length check / fallback of return null.

The git file changes may show a big block replacement, but the only changes are the if statement above the section open and else condition below the section close.

Testing

I tested by running two different Catalyst stores in dev & build, one on a store with no featured products, and one with featured products. I also had tested using a single store with featured products toggled on/off too.

If featured products do not exist, not-found template still shows the <section> and the h3 headline. this commit fixes that with a length check / fallback of return null.
@electricenjindevops electricenjindevops requested a review from a team as a code owner May 5, 2024 01:35
Copy link

changeset-bot bot commented May 5, 2024

🦋 Changeset detected

Latest commit: 68684a5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@bigcommerce/catalyst-core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented May 5, 2024

@electricenjindevops is attempting to deploy a commit to the BigCommerce Platform Team on Vercel.

A member of the Team first needs to authorize it.

@electricenjindevops
Copy link
Contributor Author

  • William @ Electric Enjin

@electricenjindevops electricenjindevops changed the title don't show featured products section if none exist don't show featured products section if none exist (on not-found template) May 5, 2024
@bookernath
Copy link
Contributor

Thanks for your contribution @electricenjindevops, I'll ask the team to review it.

Copy link
Contributor

@chanceaclark chanceaclark left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the contribution!

Copy link

vercel bot commented May 6, 2024

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

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
catalyst-1millionproducts-store ⬜️ Ignored (Inspect) Visit Preview May 6, 2024 2:29pm

@chanceaclark
Copy link
Contributor

Lint task is not going to work as it's being ran on a fork. We don't share our secrets with forked branches. Confirmed it worked locally though.

@chanceaclark chanceaclark added this pull request to the merge queue May 6, 2024
Merged via the queue into bigcommerce:main with commit 3b7ec09 May 6, 2024
1 of 7 checks passed
@github-actions github-actions bot mentioned this pull request May 2, 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