2

We have used http://www.magentocommerce.com/magento-connect/google-trusted-stores.html to integrate Google Trusted Store with Magento 1.8. While Test Drive shows the error as

Javascript is not implemented on the page How to Fix: Implement the JavaScript code on this page of your website.

How to solve this error?

6

I had the same issue when installing the same extension.

Basically the js in the extension is for the US Google Trusted Stores and I assume you are implementing it for the UK Google Certified Shops? If you are you need to open the following files:

app/design/frontend/base/default/template/googletrustedstore/badge.phtml

app/design/adminhtml/base/default/default/template/googletrustedstore/order_confirmation.phtml

These 2 files contain the badge javascript in question that we need to edit. In both files, locate the following code/function within the javascript:

(function() {
    var scheme = (("https:" == document.location.protocol) ? "https://" : "http://");
    var gts = document.createElement("script");
    gts.type = "text/javascript";
    gts.async = true;
    gts.src = scheme + "www.googlecommerce.com/trustedstores/gtmp_compiled.js";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(gts, s);
  })();

Replace the above code with the following function:

(function() {
    var gts = document.createElement("script");
    gts.type = "text/javascript";
    gts.async = true;
    gts.src = "https://www.googlecommerce.com/trustedstores/api/js";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(gts, s);
  })();

Basically the first function that is in the extension calls a js file for the US system, but the UK system uses a different js.

Hope that gets you going.

  • I just encountered this with the US version; not sure if Google is discontinuing the gtmp_compiled.js API (it still loaded, but was producing the "JS not implemented" error on validation). Google is using the /api/js path in their integration sample code, so it's probably best to use everywhere. – STW Jun 25 '15 at 13:38

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.