Developer forum

Forum » Templates » Problem in SearchFormSuggestions.html

Problem in SearchFormSuggestions.html

Anders Ebdrup
Reply

Hi Dw,

 

I have experienced a problem in this template: SearchFormSuggestions.html, where you have this syntax:

<img class="dw-search-result-smallimage" src="" alt=""/>

Which first of all makes an unecessary call to the server, second it makes a call to the root of the website, and if you have a site with multiple websites on the same domain then the session values will be set to the default values.

This is a problem e.g. when adding products to the cart with ajax because then the latest session values will be used, which now origins from the call to the root because of the syntax in the instant search and not the current page view. To fix this quick, then you can use:

<img class="dw-search-result-smallimage" src="/x.gif" alt=""/>

Where the image is cached by the client and do not mess up the session.

 

Best regards, Anders


Replies

 

You must be logged in to post in the forum