add an ADDTHIS social bookmark link to your products

Having read the other addthis social bookmark threads, they just didnt do what I wanted so I muddled through to insert an addthis link next to each product



After much trial an error (very new to this cs-cart_super_fangled_software) I did this:



duplicated the file /skins/[I]yourskin[/I]/customer/blocks/wrappers/mainbox_general.tpl



calling it mainbox_products.tpl



edited the mainbox_products.tpl by inserting the link code after line 7



logged into the admin sections I changed the design > blocks > products > central content to mainbox_products.tpl



and hey presto! an addthis link below each product title



Would welcome comments from some of the more seasoned cs-carters out there if there is a ‘correct’ way of doing this

addthis_example.jpg

Excellent work there catch1fish.

I’ll implement this when I get around to having some time to develop :wink:

Thanks mate, but how should i give some space from top of the image.

share.jpg

[quote name=‘miracles’]Thanks mate, but how should i give some space from top of the image.[/QUOTE]


{* $Id: mainbox_general.tpl 7166 2009-03-31 13:29:22Z zeke $ *}<br />
{if $anchor}<br />
<a name="{$anchor}"></a><br />
{/if}<br />
<div class="mainbox-container"><br />
	{if $title}<br />
	<h1 class="mainbox-title"><span>{$title}</span></h1><br />
<p><br />
<!-- AddThis Button BEGIN --><br />
<a href="http://www.addthis.com/bookmark.php?v=250&pub=#####" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"><img src="upload://dX7wYvDdskfBaNlHbVyuOJP10ic.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"></a><script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js?pub=#####"></script><br />
<!-- AddThis Button END --><br />
</p><br />
	{/if}<br />
	<div class="mainbox-body">{$content}</div><br />
</div>
```<br />
<br />
I just stuck my link in between some para tags <p></p>

thanks for sharing

I don’t have a BLOCKS folder in my skins/myskin/customer/ folder & I also tried searching for mainbox_general.tpl but couldn’t find it. Is there another way to use this?



UPDATE: Disregard. I just placed my code in skins/customer/product_pages/product_details.tpl & it works fine. I can even put it exactly where I want it to appear on the page.

[quote name=‘Brennie369’]I don’t have a BLOCKS folder in my skins/myskin/customer/ folder & I also tried searching for mainbox_general.tpl but couldn’t find it. Is there another way to use this?[/QUOTE]

This change is for version 2. Look for something comparable in /skins/YOURSKIN/customer/addons/listmania/listboxes.



Bob

this now appears to not work on 2.0.13, does anyone know how to get it done now?



Cheers

[quote name=‘AmitP’]this now appears to not work on 2.0.13, does anyone know how to get it done now?



Cheers[/QUOTE]



With some playing I placed it right at the top of the tpl and directly under :



{* $Id: mainbox_products.tpl 8967 2010-03-02 09:04:29Z angel $ *}



Cheers

PS: I only just found this code tonight and like it so much that I applied it to my “All pages” central block, so it doesn’t just appear in the products.

I still can’t get this to work how i like it, id like it sittin under the picture if possible, I have instead added it as a html block on the right of the page

Just want to give this a bump. I don’t know what the problem is. Running 2.0.14 and when I insert the code, the product details page goes completely blank as do the side columns.



I’ve done this before with another snippit of code that we use for click-to-call and it works fine. I’m stumped. Any help is appreciated.

Excellent, thx for this!!

Hi,

I’ve followed the instructions on how to add “addthis” snipet, everything works except when I click on share with facebook it does not display the product image, instead it displays a side banner image from the right column!!

Could you suggest a fix?

You can take a look at it here.

[url]http://alturl.com/woogj[/url]



Thanks

Frankly, I’m pretty new to CS-Cart and I didn’t follow the above method. So… I just went into the Design tab, Blocks, and the page I wanted the AddThis info on. In my case I put it on the All Pages section.



Click on Add Block, give it a name “AddThis”, content HTML block, and then paste in the code that you got from AddThis when you set up the block.



This code:

[QUOTE]










[/QUOTE]

will get you this
[IMG]http://c0080172.cdn2.cloudfiles.rackspacecloud.com/addthis.png[/IMG]

Set group as Right Column (left col, etc) and wrapper (I used /mainbox_simple.tpl).

And Voilá, you now have social bookmarks that work on every page.

Great addition to the site as it includes all the sharing sites I can think of.



I found a nice place to add this is just under the ‘Add to cart’ & ‘Add to Wishlist’ links. The one I chose fits quite nicely.



~ domain.co.uk/skins/yourskin/customer/common_templates/product_data.tpl

~ Line 104


```php {/hook}













[B][/B] ```I've added the padding just to bring it down a touch.

If you’re trying to track clickbacks and you’re getting the following error:


[QUOTE]Fatal error: Smarty error: [in top.tpl line 33]: syntax error: unrecognized tag: “data_track_clickback”:true (Smarty_Compiler.class.php, line 440) in /home/xxxyyyzzz/public_html/dreamsoy/classes/templater/Smarty.class.php on line 1095[/QUOTE]



Here’s your fix:



[URL=“http://www.addthis.com/forum/viewtopic.php?f=4&t=29561&start=0&st=0&sk=t&sd=a”]http://www.addthis.com/forum/viewtopic.php?f=4&t=29561&start=0&st=0&sk=t&sd=a[/URL]



After pasting the code from AddThis, you need to surround the line with {literal} tags:


[QUOTE]{literal}


{/literal}[/QUOTE]

[quote name='Virtualburn' timestamp='1296608037' post='102539']

Great addition to the site as it includes all the sharing sites I can think of.



I found a nice place to add this is just under the 'Add to cart' & 'Add to Wishlist' links. The one I chose fits quite nicely.



~ domain.co.uk/skins/yourskin/customer/common_templates/product_data.tpl

~ Line 104


```php {/hook}













[B][/B] ```I've added the padding just to bring it down a touch.
[/quote]

This works like a charm, however, for facebook if there's a picture in the main description I think it grabs that one instead of the item picture. This is exactly what I was looking for though..

I'm just testing cs-cart with the free version right now so I don't have ssl activated, does using these addthis buttons cause problems (give warnings) or do they disappear when SSL is activated.

[quote name='Virtualburn' timestamp='1296608037' post='102539']

Great addition to the site as it includes all the sharing sites I can think of.



I found a nice place to add this is just under the 'Add to cart' & 'Add to Wishlist' links. The one I chose fits quite nicely.



~ domain.co.uk/skins/yourskin/customer/common_templates/product_data.tpl

~ Line 104


```php {/hook}













[B][/B] ```I've added the padding just to bring it down a touch.
[/quote]

When I do this, it also appears in Product Grid View, which is pretty ugly. Couldn't figure out how to get it below the add to cart button without this extra unwanted bonus effect. I've settled for up top below the catalog number for now.

If you want it in the detail page, I think this code should be inside the tag “product-info” on the “default_template.tpl” file located at “skins/your-skin/customers/blocks/product_templates” folder. Try to place right before closing the tag

[quote name='colortone' timestamp='1327535264' post='129957']

If you want it in the detail page, I think this code should be inside the tag “product-info” on the “default_template.tpl” file located at “skins/your-skin/customers/blocks/product_templates” folder. Try to place right before closing the tag

[/quote]



Perfecto! Thank you!