Now that code is available to place the Google #1 button on sites, where does OpenCart recommend we place this code for our sites? Being a newbie and not that savy on CSS code, can you please be specific so all us newbies can understand it?
I should also be asking if the code would work on OpenCart?
Thanks
I should also be asking if the code would work on OpenCart?
Thanks
I would think that if you're using it you'd want it along side your product, up by where it lists the price, etc. The code for the Google +1 button needs to go in two places -- the first part goes in your header, which should be in your theme > template > common > header file between the <head> and </head> tags. Update: just a note that Google did update their script, and the first part no longer goes in the header, but instead goes in the end of the body -- the very end (after the last place that you inserted the button anyway).
Then to actually place the button you'll want to go to your theme > template > product > product file and insert it where you want it to go. I'm still very new to opencart, but I'm pretty sure that's the right place if you want the button to go along with the product info.
Then to actually place the button you'll want to go to your theme > template > product > product file and insert it where you want it to go. I'm still very new to opencart, but I'm pretty sure that's the right place if you want the button to go along with the product info.
Last edited by BrianW on Sat Oct 08, 2011 3:04 am, edited 1 time in total.
Give a man a fire and you make him warm for a day. Light a man on fire, and you make him warm for the rest of his life.
http://www.awesomedice.com
I have just adapted the google code a little so that it shares the right URL if you have SEO Urls enabled.
E.g. the URL it shares will be consistent
http://mysite.com/category/product
will revert to
http://mysite.com/product
Anyone want to confirm it works? Works fine for me on FF4
E.g. the URL it shares will be consistent
http://mysite.com/category/product
will revert to
http://mysite.com/product
Code: Select all
<g:plusone size="medium" href="<?php echo $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product&product_id='.$this->request->get['product_id']); ?>"></g:plusone>
I made a extension for that ;) http://www.opencart.com/index.php?route ... 14&page=10 (just changes the needed files)
Just patched mine up a little for those who are still on v 1.4.9
Seems to do the trick. 
Code: Select all
<g:plusone size="medium" href="<?php echo str_replace('&', '&', $link['href']); ?>"></g:plusone>

Don't mean to be totally stupid, but what is "AddThis"? And how would I procceed to add the +1 button onto my 1.4.9 site and exactly where would I place the code?ablain wrote:You can also add the google +1 button via AddThis. It's a lot easier.
Who is online
Users browsing this forum: Amazon [Bot] and 34 guests