Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Support thread for Google Custom Search addon for CE


Recommended Posts

A simple header that installs the Google Custom Search box to your site header. This will give you a nice Modal search pop up window.

You will need to have a google account to get the custom search code. The code can be made to limit search to within your site only.

You can get your code from here  https://cse.google.co.uk/cse/

Once you have your code simply edit “tpl_cm_jcm_google_search.php” and add you code as marked.

<!------------------add your Google Script below this line------------------>    
    
     <script>
  (function() {
    var cx = '007037419634106605348:gua56w345ta';
    var gcse = document.createElement('script');
    gcse.type = 'text/javascript';
    gcse.async = true;
    gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(gcse, s);
  })();
</script>
<gcse:search></gcse:search>

<!------------------add your Google Script above this line------------------>

 

 

The code supplied is for the test site https://justfastfood.com/

You can see the addon working on the site.

image.thumb.png.5942ae701f78fb1f5f29cd069b11a2b7.png

Search output is on pop up Modal window.

image.thumb.png.0cdf990367d20673a83c9374a51cb86e.png

 

 

Link to comment
Share on other sites

  • 4 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...