-
AuthorPosts
-
July 24, 2018 at 1:24 pm #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?
July 24, 2018 at 8:28 pm #989346Hi,
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.July 24, 2018 at 9:14 pm #989378Hi 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,
VictoriaJuly 24, 2018 at 9:28 pm #989382Hi 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, 5 months ago by catchbudapest. Reason: Code added in the private section
July 24, 2018 at 10:09 pm #989394Hi 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!
July 25, 2018 at 9:34 am #989572Hi 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.
July 25, 2018 at 1:38 pm #989668Hi catchbudapest,
Yes, looks ok. Is it working for you now?
Best regards,
VictoriaJuly 25, 2018 at 1:49 pm #989674Hi Victoria,
Yes, after the last modification it finally works :)
Thanks for the reply!
July 25, 2018 at 4:59 pm #989805Hi catchbudapest,
Glad you got it working for you! :)
If you need further assistance please let us know.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.