Posted on 03/11/2024 22:34:54
Hello,
I'm looking for clarification regarding the queries/logic that drive the standard related products slider (https://doc.dynamicweb.com/swift/setup-project/content-design/content-columns#12027) options in DW 9 + Swift, specifically relating to 'Frequently bought' and 'Most sold'.
Based on the RelatedProductsList.cshtml Swift template (excerpt below) and this documentation (https://doc.dynamicweb.com/documentation-9/ecommerce/other/product-recommendations), it looks like:
- Most sold: Sorts by (OrderCount) descending, which is all applicable parent products that appear in most orders placed in the previous 60 days.
- Frequently bought: Displays all parent products purchased on orders with the current product (BoughtWithProductIds)
- This documentation (https://doc.dynamicweb.com/template-tags/ecommerce/customer-center/frequently-bought-items) seems to indicate instead that this was sorting by highest count of products purchased on orders associated with the currently impersonated account. Please clarify which is correct?
@*--- VARIANTS ---*@ @if (sourceType == "variants") { <input type="hidden" name="MainProductID" value="@productIds"> } @*--- MOST SOLD ---*@ @if (sourceType == "most-sold") { <input type="hidden" name="SortBy" value="OrderCount"> <input type="hidden" name="GroupId" value="@groupId"> <input type="hidden" name="isVariant" value="false"> } @*--- TRENDING ---*@ @if (sourceType == "trending") { <input type="hidden" name="SortBy" value="OrderCountGrowth"> <input type="hidden" name="GroupId" value="@groupId"> <input type="hidden" name="isVariant" value="false"> } @*--- LATEST ---*@ @if (sourceType == "latest") { <input type="hidden" name="SortBy" value="Created"> <input type="hidden" name="GroupId" value="@groupId"> <input type="hidden" name="isVariant" value="false"> } @*--- FREQUENTLY BOUGHT ---*@ @if (sourceType == "frequently") { <input type="hidden" name="BoughtWithProductIds" value="[@productIds]"> <input type="hidden" name="isVariant" value="false"> } @*--- RELATED PRODUCTS ---*@ @if (sourceType == "related-products") { <input type="hidden" name="ProductvariantId" value="@productVariantIds"> }