Post by stashdesign » Sat Dec 08, 2018 5:36 pm

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>

Newbie

Posts

Joined
Fri Oct 06, 2017 2:40 am

Post by xxvirusxx » Sun Dec 09, 2018 6:25 pm

stashdesign wrote:
Sat Dec 08, 2018 5:36 pm
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
And after that you have refreshed ocmod?
Cleared theme cache, SASS Cache (from Dashboard, top right)

My Extensions | OC 3.0.3.1, 3.0.2.0, 2.3.0.2 with bugs fixed | Buy me a beer or coffee


Active Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm

Post by stashdesign » Sun Dec 09, 2018 7:52 pm

xxvirusxx wrote:
Sun Dec 09, 2018 6:25 pm
stashdesign wrote:
Sat Dec 08, 2018 5:36 pm
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
And after that you have refreshed ocmod?
Cleared theme cache, SASS Cache (from Dashboard, top right)
Yes, i have cleared all cache and refreshed ocmod :)

Newbie

Posts

Joined
Fri Oct 06, 2017 2:40 am

Post by xxvirusxx » Sun Dec 09, 2018 8:30 pm

Use View source to see if you script is loaded.

My Extensions | OC 3.0.3.1, 3.0.2.0, 2.3.0.2 with bugs fixed | Buy me a beer or coffee


Active Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm

Post by stashdesign » Sun Dec 09, 2018 9:28 pm

xxvirusxx wrote:
Sun Dec 09, 2018 8:30 pm
Use View source to see if you script is loaded.
Can find it the chrome console, but not in "View source". Strange, the script working perfect with my another WooCommerce shop, but not with opencart.

Newbie

Posts

Joined
Fri Oct 06, 2017 2:40 am

Post by xxvirusxx » Sun Dec 09, 2018 10:11 pm

Try to add in you journal header.twig

Code: Select all

<script src="catalog/view/javascript/you_file.js" type="text/javascript"></script>

My Extensions | OC 3.0.3.1, 3.0.2.0, 2.3.0.2 with bugs fixed | Buy me a beer or coffee


Active Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm

Post by stashdesign » Mon Dec 10, 2018 2:38 am

xxvirusxx wrote:
Sun Dec 09, 2018 10:11 pm
Try to add in you journal header.twig

Code: Select all

<script src="catalog/view/javascript/you_file.js" type="text/javascript"></script>
Unfortently, no success :(

Newbie

Posts

Joined
Fri Oct 06, 2017 2:40 am
Who is online

Users browsing this forum: goodguyssigns and 30 guests