Add related products to detail page

This commit is contained in:
sdarbinyan
2026-07-05 01:07:53 +04:00
parent d7d73c2a10
commit b676cec4e9
7 changed files with 80 additions and 1 deletions

View File

@@ -294,6 +294,23 @@
}
</div>
</div>
@if (relatedProducts().length > 0) {
<section class="related-products" aria-labelledby="novo-related-products-title">
<h2 id="novo-related-products-title">{{ 'itemDetail.relatedProducts' | translate }}</h2>
<div class="related-products-grid">
@for (related of relatedProducts(); track related.itemID) {
<app-product-card
[item]="related"
[title]="relatedItemName(related)"
[addToCartLabel]="'itemDetail.addToCart' | translate"
appearance="compact"
(addToCart)="addRelatedToCart($event.itemID, $event.event)"
/>
}
</div>
</section>
}
}
</div>
} @else {
@@ -634,6 +651,23 @@
</div>
</div>
}
@if (relatedProducts().length > 0) {
<section class="related-products" aria-labelledby="dx-related-products-title">
<h2 id="dx-related-products-title">{{ 'itemDetail.relatedProducts' | translate }}</h2>
<div class="related-products-grid">
@for (related of relatedProducts(); track related.itemID) {
<app-product-card
[item]="related"
[title]="relatedItemName(related)"
[addToCartLabel]="'itemDetail.addToCart' | translate"
appearance="compact"
(addToCart)="addRelatedToCart($event.itemID, $event.event)"
/>
}
</div>
</section>
}
}
</div>
}