Post by BulletJules » Sun Jun 05, 2011 1:29 am

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

Newbie

Posts

Joined
Sun Apr 17, 2011 4:12 am

Post by BrianW » Sun Jun 05, 2011 4:42 am

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.
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


New member

Posts

Joined
Mon Mar 21, 2011 5:39 am
Location - Massachusetts

Post by speedingorange » Mon Jun 06, 2011 11:29 pm

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

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>
Anyone want to confirm it works? Works fine for me on FF4

Active Member

Posts

Joined
Tue Feb 23, 2010 7:33 pm

Post by reynierpm » Tue Jun 07, 2011 4:04 am

I made a extension for that ;) http://www.opencart.com/index.php?route ... 14&page=10 (just changes the needed files)

User avatar
Active Member

Posts

Joined
Tue Jan 12, 2010 9:51 pm

Post by speedingorange » Tue Jun 07, 2011 10:09 pm

Just patched mine up a little for those who are still on v 1.4.9

Code: Select all

<g:plusone size="medium" href="<?php echo str_replace('&', '&amp;', $link['href']); ?>"></g:plusone>
Seems to do the trick. :)

Active Member

Posts

Joined
Tue Feb 23, 2010 7:33 pm

Post by robbiecs » Sun Jul 03, 2011 5:21 am

hallo I have the version 1.4.9 how i do for add google +1 in my site?

User avatar
Active Member

Posts

Joined
Sat Oct 24, 2009 5:29 am


Post by ablain » Sun Jul 03, 2011 6:13 am

You can also add the google +1 button via AddThis. It's a lot easier.

New member

Posts

Joined
Sun Jul 03, 2011 1:51 am

Post by BulletJules » Mon Jul 04, 2011 6:14 am

ablain wrote:You can also add the google +1 button via AddThis. It's a lot easier.
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?

Newbie

Posts

Joined
Sun Apr 17, 2011 4:12 am
Who is online

Users browsing this forum: Amazon [Bot] and 34 guests