Hi

I'd appreciate any help with this one. Zen Cart 1.5.8 on my test bed with PHP 8.2. Responsive_classic template.

Experimenting with an external site search engine (namely Addsearch) in order to provide better marshalled search results. At least that's the idea.

Falling at the first hurdle though - and have been trying for ages to get the Addsearch code to work. On the face of it this should be easy, so I guess I'm making a simple error.

All I need to do is add one line of code, namely ' <script src="https://cdn.addsearch.com/v5/addsearch-ui.min.js?key=xxxxx&id=asw_01"></script> where xxxxx is the account key. I have located the common/tpl_header.php file and inserted the code near line 188 having commented out the line above which is
Code:
<?php //require(DIR_WS_MODULES . zen_get_module_sidebox_directory('search_header.php')); ?>
The addsearch box duly appears BUT doesn't work (no response when typing or on enter). However, it does work if the browser page is resized at all or if developer tools is open. Works perfectly then!

What makes this more confusing is that when I place the same line of code at the end of the page, after the 'if ( $detect->isMobile() && !$detect->isTablet() || $_SESSION['layoutType'] == 'mobile - in substitution for
Code:
<?php require(DIR_WS_MODULES . zen_get_module_sidebox_directory('search_header.php')); ?>
- the search works perfectly on a mobile device (and the same is true for a tablet).

The script just doesn't appear to be active on a desktop/laptop unless the window is resized and stays that way until the page reloads when it goes dead again.

I have also placed the script call in a file jscript.addsearch.php (including the tags) in the jscript folder and it causes the search box to pop up unformatted at the page head and it does work (but not then on any mobile device). I cannot see a way of placing it in the correct place on the page header or getting it to work on a mobile device.

Control+U shows the script is loaded and developer tools doesn't point to an error nor are there any log files to refer to.



So I would really appreciate any help to get this to work.

Dax