Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2020
    Posts
    226
    Plugin Contributions
    1

    Default noob trying out an onload.js, help please?

    ok so im baffled to say the least. followed this topic https://www.zen-cart.com/showthread....-and-BODY-tags

    and also read this...

    https://docs.zen-cart.com/user/template/javascript/

    and ended up with a new folder and an on_load_.js file with the following contents....

    Code:
    <script type="text/javascript" src="//widget.trustpilot.com/bootstrap/v5/tp.widget.bootstrap.min.js" async></script>
    from the following instructions....

    Click image for larger version. 

Name:	2021-10-31 (9).jpg 
Views:	41 
Size:	55.2 KB 
ID:	19784

    The original javascript code before i tried tweaking it below and still showing the same results in the screenshot below...

    Code:
    <!-- TrustBox script -->
    <script type="text/javascript" src="//widget.trustpilot.com/bootstrap/v5/tp.widget.bootstrap.min.js" async></script>
    <!-- End TrustBox script -->
    Click image for larger version. 

Name:	2021-10-31 (10).jpg 
Views:	38 
Size:	48.2 KB 
ID:	19785

    So i'm almost right here or should i be doing the html approach? If anyone could help as i've found my google my business reviews aren't linked to my shopping results even though its showing as linked. only 4 x 5 star reviews at the moment but i can import reviews from my google business to give me a head start to trustpilot i believe?

  2. #2
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: noob trying out an onload.js, help please?

    Saw your other post which provided more information (one of the tidbits in the posting tips). I unfortunately am not where I can perform testing, but from the looks of it, if the above code is showing on your page, then to that extent it is "successful". The issue though likely is some level of problem on the associated page(s) where the script is to be executed such as lack of html validation and/or other javascript errors... I could check the html validation online, but haven't as also need to go back to that other thread (referenced above) to pull the extra info.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Nov 2020
    Posts
    226
    Plugin Contributions
    1

    Default Re: noob trying out an onload.js, help please?

    Put the javascript inside an appropriately-named file in the prescribed folder, according to this FAQ article, and Zen Cart will automatically load the code for you. No need to touch template files.
    http://www.zen-cart.com/wiki/index.p...s_-_Javascript
    quoting dr byte here i followed the guide referenced. i played around with the javascript file a good few times as at first it just displayed a symbol, eventually it displayed the word trustpilot and provided a link but it didnt look like it was as expected, it still looked like the above just with the word trustpilot added which was a link to my sites trustpilot page.

    This is my latest contents for the file, tried double click it to open it and it came up saying syntax error, clicked edit and it loaded up in notepad as was originally expecting from double clicking it, perhaps an indicator of the issue?

    Code:
    <!-- TrustBox widget - Micro Review Count -->
    <div class="trustpilot-widget" data-locale="en-GB" data-template-id="5419b6a8b0d04a076446a9ad" data-businessunit-id="617ee9dd9ebfe9707c2208b0" data-style-height="24px" data-style-width="100%" data-theme="light" data-min-review-count="20">
      <a href="https://uk.trustpilot.com/review/crazygamer.uk" target="_blank" rel="noopener">Trustpilot</a>
    </div>
    <!-- End TrustBox widget -->
    Edited to add: my template is a numinix one, perhaps all was fine but it wasnt agreeing with the template meaning I will have to place it in the header.php afterall?

 

 

Similar Threads

  1. Help a Noob Please
    By Grumpy One in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 2 Oct 2011, 12:24 AM
  2. noob help please
    By donlee600 in forum Basic Configuration
    Replies: 1
    Last Post: 23 Aug 2009, 01:10 PM
  3. Replies: 1
    Last Post: 7 Nov 2008, 02:06 PM
  4. Small List of Little Nagging Issues - Please Help a Noob!
    By ItzThePitz in forum Templates, Stylesheets, Page Layout
    Replies: 12
    Last Post: 20 Apr 2008, 12:01 AM
  5. noob needs help installing and setting up... PLEASE !!
    By ringo99 in forum Installing on a Windows Server
    Replies: 2
    Last Post: 21 Oct 2006, 09:37 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR