Add Script In All Pages

I want add script

<script src="//sharebutton.net/plugin/sharebutton.vertical.js"></script>
```<br />
<br />
Where I need put that tag to get it work? I already try ```php
/design/backend/templates/common/scripts.tpl 
``` but no luck.<br />
<br />
I'm using CS-Cart 4.2.3

The best way is to put the code inside:

templates/addons/my_changes/hooks/index/scripts.post.tpl

This will 'survive'after the store updates as well

Dear Raix022,



Find [color=#262626][font=arial, sans-serif][size=3]\design\themes\responsive\templates\common\scripts.tpl[/size][/font][/color]

[color=#262626][font=arial, sans-serif][size=3]Insert your lines before the tag [/size][/font][/color][color=#262626][font=arial, sans-serif][size=3]{/scripts}.[/size][/font][/color]



[color=#262626][font=arial, sans-serif][size=3]Best regards, Alt-team.[/size][/font][/color]

You can also use my changes addon to avoid future upgrade problem.

Please check our post:



How To Add Custom Javascript With My Changes Addon - Developers' Corner - CS-Cart Community Forums



Just insert your custom code instead of {script} tag

[quote name=‘Alt-team’ timestamp=‘1417702088’ post=‘198742’]

Dear Raix022,



Find [color=#262626][font=arial, sans-serif][size=3]\design\themes\responsive\templates\common\scripts.tpl[/size][/font][/color]

[color=#262626][font=arial, sans-serif][size=3]Insert your lines before the tag [/size][/font][/color][color=#262626][font=arial, sans-serif][size=3]{/scripts}.[/size][/font][/color]



[color=#262626][font=arial, sans-serif][size=3]Best regards, Alt-team.[/size][/font][/color]

[/quote]



I add this code to there, clean cache but not workin…



end of the file

<br />
<script src="//sharebutton.net/plugin/sharebutton.vertical.js"></script><br />
{/scripts}
```<br />
<br />
I also try<br />
```php
<br />
{script src="//sharebutton.net/plugin/sharebutton.vertical.js"}<br />
{/scripts}
```<br />
<br />
And I try addon<br />
<br />
scripts.post.tml<br />
```php
{script src="//sharebutton.net/plugin/sharebutton.vertical.js"}
```<br />
<br />
Nothing work for me <img src="upload://n4syhXZrRhsStKvmS4jT3Mp2S3k.png" class="bbc_emoticon" alt=":(">

You either need a protocol (http: or https:) or get rid of the '//' for a proper URL. But note that not specifying a protocol will default to 'http:' and will then give “insecure content” errors on https pages. You might try something like:


{if $smarty.const.HTTPS}
{assign var="proto" value="https://"}
{else}
{assing var="proto" value="http://"}
{/if}
{script src="`$proto`sharebutton.net/plugin/sharebutton.vertical.js"}


This should set the correct protocol based on the protocol of the current page.

Hi @raix022,

You can also try [url=“Custom Code - Free CS-Cart Add-on by HungryWeb.net”]http://www.hungryweb.net/cs-cart-addons/custom-code.html[/url]



Keep on smiling,





Valentin

[color=#808080][size=2]part of hungryweb.net[/size][/color]

Try to use our solution from post #5