Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #989165

    Hi,

    in order to use the Amazon OneClick functionability, Amazon wants me to copy a Java Script Code into the Footer before the end tag of my site.

    See the Amazon instruction here.

    I found a thread suggesting doing that using the functions.php and another one suggesting using the footer.php.

    What is the best way to do it?

    #989346

    Hi,

    I did some research and I think I found the solution in the enfold docummentation.

    I added the following code to the function.php of the child theme:

    //-------------------------------
    // Custom script in footer 
    //-------------------------------
    
    function custom_script_name(){
    ?>
    <script>
    // Your script here
    </script>
    <?php
    }
    add_action('wp_footer', 'custom_script_name');

    Could you just please confirm that this is the right way to do it?
    The script appears in the source code, but unfortunately the Amazon OneClick functionality doesn’t work yet how it is supposed to do.

    #989378

    Hi catchbudapest,

    Yes, the later is the way to do it.

    Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?

    Best regards,
    Victoria

    #989382

    Hi Victoria,

    thanks for the quick reply!

    Below the temporary admin access to my website.

    I also added the code which has to be added to the footer, below in the private section.

    • This reply was modified 6 years, 4 months ago by catchbudapest. Reason: Code added in the private section
    #989394

    Hi Victoria,

    additionally to my previous posting with the access data, here some more information which could be helpful:

    There are 2 possible Amazon OneClick codes/scripts which can be added to the footer (see in the private area).

    I just tested the one for Asynchronous loading preference, but it could be that I messed up the integration, since I see now that I added the script between the script tag (so 2-times script-tags).

    I really appreciate your help!

    #989572

    Hi Victoria,

    I think I figured it out how to correctly add the script in the functions.php (changed the code a bit).

    But if you still can have a look to check, that would be great.

    #989668

    Hi catchbudapest,

    Yes, looks ok. Is it working for you now?

    Best regards,
    Victoria

    #989674

    Hi Victoria,

    Yes, after the last modification it finally works :)

    Thanks for the reply!

    #989805

    Hi catchbudapest,

    Glad you got it working for you! :)

    If you need further assistance please let us know.

    Best regards,
    Victoria

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.