Search product selection for Comparison Zone is not visible when user returns back from Comparison window
An issue with Search comparisons may occur after upgrading from an existing Aurora storefront to Version 9.1. On returning to the storefront after doing a comparison using the Search function, the items selected for the comparison are no longer selected. Attempting to select them again results in an error popup appearing.
Problem
In HCL Commerce Version 9.1.2, the Search comparison function can produce
an error. To reproduce:
- At the store front, search for a product or item.
- Select two or more products for comparison (maximum of 4).
- Click on the Compare button.
- The Comparison window opens.
- Verify the products you selected for comparison.
- Now click on : back to Search: screws link to return back to the search results page.
- Check if your products are still selected.
Expected Result: Products are still marked for comparison.
Actual Result: Products are not marked for Comparison. If you attempt to
select them again for comparison, the following warning
appears:
The product you are trying to add to the compare zone already exists.
Solution
To correcct this behavior and able to preserve the selected Compared items when
moving back to the previous page, edit the following Javascript
file.
/crs-web/WebContent/AuroraStorefrontAssetStore/ShoppingArea/CatalogSection/SearchSubsection/SearchResultsDisplay.jsp
Move
to line 220 of the file and insert the string '<c:out
value="${totalContentCount}"/>'
as shown in the following
example.if(searchTabContentCount != null) {
searchTabContentCount.innerHTML = '<c:out value="${totalContentCount}"/>'; (need a single quote around this c:out statement)
}
Result
When you return to the storefront after doing comparisons, the items originally selected for the comparison are still selected.