Yet another google +1 Question

Okay, so I've got the google +1 Code:



I've tried following every mention of explanation I could find here in the forums. I just can NOT get it to work.

Most often I come up with a smarty error:

[b]Fatal error[/b]: Smarty error: [in addons/my_changes/hooks/index/blahblah.tpl line 2]: syntax error: unrecognized tag 'var' (Smarty_Compiler.class.php, line 589) in [b]/home/whdcocom/public_html/2afirearmsdealer/lib/templater/Smarty.class.php[/b] on line [b]1095[/b]

I'm at a complete loss.

WHERE am I supposed to put that code?

Put the javascript in [color=#282828][font=arial, verdana, tahoma, sans-serif]skins/YOUR-SKIN/customer/meta.tpl (or better, use a hook)[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]Put the div class where you'd like the button to show. [/font][/color]

Then clear cs-carts cache.

[color=#282828][font=arial, verdana, tahoma, sans-serif]I put the div class line in the facebook like add-on so the button renders beautifully next to it. I did the same for a pinterest button. How to do that I explained here: [/font][/color]http://forum.cs-cart…nterest-pin-it/

You might have to change the size of the g+ button (see their website, you can choose) so it will be just as big.

Okay, I tried putting it in meta.tpl but still got the same error:

Fatal error: Smarty error: [in index.tpl line 52]: syntax error: unrecognized tag 'var' (Smarty_Compiler.class.php, line 589) in /home/whdcocom/public_html/2afirearmsdealer/lib/templater/Smarty.class.php on line 1095

And you don't have that when you do not put the code in meta.tpl?

Then at least we know you don't have a hook that is overwriting this file (this happens when you use some add-ons like cscartrocks canonical url in which case you will have to edit /public_html/skins/YOUR_SKIN/customer/addons/canonical_url/hooks/index/meta.override.tpl

Try putting only this code in meta.tpl, instead of the javascript you got from google:



Enclose the javascript in {literal} tags.

[quote name='tbirnseth' timestamp='1336243049' post='135914']

Enclose the javascript in {literal} tags.


Oyeah! That too (although I didn't need to!?)


have a look at this.

[url=“Share Buttons with Google Plus - Third-Party Services - CS-Cart Community Forums”]Share Buttons with Google Plus - Third-Party Services - CS-Cart Community Forums

I just upload it and it contains the Google plus button. It is tested in .

Just try a product and you will find it there.


Okay, thanks. The literal tags worked. Not sure I understand why I needed them though.

I appreciate the help.

Because your script contains {}'s which are defined as the start and end of a template variable. Using {literal} tags essentially turns off template processing between the tags.

Oh. Thank you!

Now I wonder why I never have to do that, it's just working?!