I am trying to add this javascript to my Opencart page, i am on version 3.0.2.0 and using the Journal Theme. I have tried to add the code in Journal's "Custom JS" section with no success. I have also tried to add the script inside a new .js file and insert the code $this->document->addScript('catalog/view/javascript/xxxx.js'); into the header controller, also with no success.
Someone please help me with a solution for this to work?
Script:
<script> (function() { var s = document.createElement('script'); s.async = true; s.src = 'https://cdn.listagram.com/static/api/listagram.js'; document.body.appendChild(s); window.LISTAGRAM_CFG = { 'token': '9753f621-7ef4-4199-a23e-ff6b272de16e', 'base_media': 'https://cdn.listagram.com/media/', 'base_static': 'https://cdn.listagram.com/static/', 'base_api': 'https://www.listagram.com/api/', }; }());</script>
And after that you have refreshed ocmod?stashdesign wrote: ↑Sat Dec 08, 2018 5:36 pmI have also tried to add the script inside a new .js file and insert the code $this->document->addScript('catalog/view/javascript/xxxx.js'); into the header controller
Cleared theme cache, SASS Cache (from Dashboard, top right)
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
Yes, i have cleared all cache and refreshed ocmodxxvirusxx wrote: ↑Sun Dec 09, 2018 6:25 pmAnd after that you have refreshed ocmod?stashdesign wrote: ↑Sat Dec 08, 2018 5:36 pmI have also tried to add the script inside a new .js file and insert the code $this->document->addScript('catalog/view/javascript/xxxx.js'); into the header controller
Cleared theme cache, SASS Cache (from Dashboard, top right)
Use View source to see if you script is loaded.
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
Try to add in you journal header.twig
Code: Select all
<script src="catalog/view/javascript/you_file.js" type="text/javascript"></script>
Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer
Unfortently, no successxxvirusxx wrote: ↑Sun Dec 09, 2018 10:11 pmTry to add in you journal header.twig
Code: Select all
<script src="catalog/view/javascript/you_file.js" type="text/javascript"></script>
Who is online
Users browsing this forum: No registered users and 46 guests