Skip to content

Commit

Permalink
Only show related products if exists
Browse files Browse the repository at this point in the history
  • Loading branch information
armans-code committed Oct 18, 2024
1 parent 5c3e035 commit 7e7eabe
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ export default async function Page(props: {
<AddToCartForm productSlug={productData.slug} />
</div>
<div className="pt-8">
<h2 className="text-lg font-bold text-green-800">
Explore more products
</h2>
{related.length > 0 && (
<h2 className="text-lg font-bold text-green-800">
Explore more products
</h2>
)}
<div className="grid grid-cols-1 gap-2 md:grid-cols-2 lg:grid-cols-4">
{related?.map((product) => (
<ProductLink
Expand Down

0 comments on commit 7e7eabe

Please sign in to comment.