Zen Cart Logo
Forums / All Other Contributions/Addons / "Google Plus One (+1), Facebook Send and Twitter Follow" addon Support

"Google Plus One (+1), Facebook Send and Twitter Follow" addon Support

Views: 16,533

Results 1 to 20 of 76
26 Nov 2011, 9:02 AM
#1
gopinathgoswami avatar

gopinathgoswami

New Zenner

Join Date:
Nov 2011
Posts:
32
Plugin Contributions:
1

"Google Plus One (+1), Facebook Send and Twitter Follow" addon Support

Three Internet Giants Viz., Google, Facebook and Twitter have launched three different services recently.

  1. Google has launched its own Social Networking called "Google +1. Now, Google +1 is open for businesses also as announced on November 8, 2011.

  2. Facebook has also recently launched a new service called "Send" button. The Send Button allows users to easily send content to their friends. It is just like "Tell A Friend" button already available in Zen cart, but lot superior as recipients' email addresses are automatically populated from Facebook database and instantly shoots a mail to a whole group or selected individuals. The message will include a link to the URL specified in the send button, along with a title, image, and short description of the link.

  3. Twitter too rolled out its awesome Follow button recently.

In this contribution, I have attempted to avail the services of all these NEW SERVICES of all three INTERNET GIANTS...! Ofcourse along with Facebook Send button, Facebook Like button is also installed automatically.

This contribution can be downloaded at http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=2026

This is the support thread for this contribution... Shall try to support as much as possible.

Regards

19 Dec 2011, 9:33 AM
#3
gopinathgoswami avatar

gopinathgoswami

New Zenner

Join Date:
Nov 2011
Posts:
32
Plugin Contributions:
1

Re: "Google Plus One (+1), Facebook Send and Twitter Follow" addon Support

Hi,

For google plus code, please try this:

<g:plusone annotation="inline" width="400"></g:plusone>

For facebook code, please try this:

<fb:like send="true" width="400" show_faces="true"></fb:like>

I have just reduced the width size to 400 from 450 pixels.

Regards

19 Dec 2011, 10:08 AM
#4
gopinathgoswami avatar

gopinathgoswami

New Zenner

Join Date:
Nov 2011
Posts:
32
Plugin Contributions:
1

Re: "Google Plus One (+1), Facebook Send and Twitter Follow" addon Support

Dear all users of this Contribution,

I noticed that email address and City fields are prefilled with your store email address and your city when customer reaches Register page or Contact us page. This is because $city and $email_address used in the code appearing in (your-zencart-store-root)/includes/templates/your_custom_template/common/html_header.php interferes with zencart's code. So, I suggest you changing the names to $mycity and $myemail_address. Also, please replace "1" to "0" if you do not want to use your address, email and phone fields in the meta tags.

################ start of AutoOpenGraph ###################

$store_name = "Your Company Name"; //e.g. "Samanthas Power Tools", or "Gus' China Shop".
$store_url = "http://www.yourdomain.com/store"; //url to your store (no trailing '/')
$product_type = "product"; //type of product you're selling (see tutorial)
$use_addr = 0; //use address? if yes, set $use_addr = 1; (no quotes). edit lines below suitably.
$use_email = 0; //use email address? if yes, set $use_email = 1; (no quotes) edit lines below suitably.
$use_phone = 0; //use phone number? if yes, set $use_phone = 1; (no quotes) edit line below suitably.

//if $use_addr is set to 1;
$mystreet = "123 Your Street Name";  //change to your street address.
$mycity = "City"; //your city
$mystate = "State"; //Your State. Facebook exaple uses abbreviation.
$myzip = "zipcode"; //you're zip/postal code.
$mycountry = "USA"; //your country. Facebook example uses acronym.

//if $use_email is set to 1;
$myemail_address = "[email protected]"; // your email

//if use_phone is set to 1
$myphone_number = "+1-123-12345678"; //format: +country code - area code - number.

//no need to edit below this line:
extract($product_info_metatags->fields);
extract($category_metatags->fields);
$prod_url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

//get defined image or default
$myImage= zen_get_products_image((int)$_GET['products_id']);
$img = simplexml_load_string($myImage);
$img = $img['src'];
if($this_is_home_page){ $depends = $store_name; $product_type = "website"; }
else if ($categories_name){  $depends = $categories_name; $product_type = "website";  }
else if ($products_name){ $depends = $products_name; }
else { $depends = META_TAG_TITLE; $product_type = "website"; }
//print_r($product_info_metatags);
################# end of AutoOpenGraph ####################

Under meta tags, please change suitably as follows:

<?php
if($use_addr){
echo '<meta property="og:street-address" content="'.$mystreet.'" />'."\n";
echo '<meta property="og:locality" content="'.$mycity.'" />'."\n";
echo '<meta property="og:region" content="'.$mystate.'" />'."\n";
echo '<meta property="og:postal-code" content="'.$myzip.'" />'."\n";
echo '<meta property="og:country-name" content="'.$mycountry.'" />'."\n";
}
if($use_email){
echo '<meta property="og:email" content="'.$myemail_address.'" />'."\n";
}
if($use_phone){
echo '<meta property="og:phone_number" content="'.$myphone_number.'" />'."\n";
}
?>

Regards

19 Dec 2011, 5:10 PM
#5
joseph_heinen avatar

joseph_heinen

New Zenner

Join Date:
Jun 2007
Posts:
65
Plugin Contributions:
0

Re: "Google Plus One (+1), Facebook Send and Twitter Follow" addon Support

OK I fixed it. It was the <div> tags.

When I inserted the whole line it fixed it
Thanks!

I also made the other changes you suggested.

Thanks for all of your help!

Now I just have to figure out google, facebook and twitter :D

24 Dec 2011, 1:39 PM
#6
serious avatar

serious

Totally Zenned

Join Date:
Feb 2011
Posts:
686
Plugin Contributions:
0

Re: "Google Plus One (+1), Facebook Send and Twitter Follow" addon Support

Before I download and install this Add-On, is it possible to install just the FB and google portion? I'm not a twitter user.

25 Dec 2011, 4:39 AM
#7
gopinathgoswami avatar

gopinathgoswami

New Zenner

Join Date:
Nov 2011
Posts:
32
Plugin Contributions:
1

Re: "Google Plus One (+1), Facebook Send and Twitter Follow" addon Support

Yes.. it is possible. Please do not copy and paste the code starting from

<!-- Twitter Follow Button BEGIN -->

to

<!-- Twitter Follow Button END-->

Thats.. it.. very simple....!!

19 Jan 2012, 5:34 PM
#8
jostar avatar

jostar

New Zenner

Join Date:
Jan 2011
Posts:
22
Plugin Contributions:
0

Re: "Google Plus One (+1), Facebook Send and Twitter Follow" addon Support

Thank you, Gopinath for wonderful addon to zencart.

I have a question with SSL.

Upon installation of 'ADD IT' side box, the google chrome detected some contents that are not secured with SSL so my SSL become incomplete.

It did not happen when I only installed the G+, FB, Twitter buttons for
product description page.

I tried to see if there's any link used in 'ADD IT' side box is using HTTP instead of HTTPS, but all of them seem to use HTTPS.

My website is https://www.jostaronline.com. If you could use Chrome, you will see 'X' mark on the 'https://'on the address bar.

Please let me know if you have any suggestions.

Thank you!

ADDED: Also the problem persists even if I turn off the 'ADD IT' side box. Funny thing is that there isn't actual link in the module file.

19 Jan 2012, 5:56 PM
#9
gopinathgoswami avatar

gopinathgoswami

New Zenner

Join Date:
Nov 2011
Posts:
32
Plugin Contributions:
1

Re: "Google Plus One (+1), Facebook Send and Twitter Follow" addon Support

Please try this...

Please edit the file (your-zencart-store-root)/includes/templates/your_custom_template/common/html_header.php and search for <!-- beginning of AddThis Javascript -->.

In the next line, you can use https://s7.addthis.com/js/250/addthis_widget.js for SSL. If you want the browsers to use SSL automatically you can skip the https: and just use //s7.addthis.com/js/250/addthis_widget.js

Regards

19 Jan 2012, 6:18 PM
#10
jostar avatar

jostar

New Zenner

Join Date:
Jan 2011
Posts:
22
Plugin Contributions:
0

Re: "Google Plus One (+1), Facebook Send and Twitter Follow" addon Support

Wow.

You're amazing.
Fast response with simple, yet perfect solution!
Thank you very much!

23 Jan 2012, 11:15 PM
#11
jostar avatar

jostar

New Zenner

Join Date:
Jan 2011
Posts:
22
Plugin Contributions:
0

Re: "Google Plus One (+1), Facebook Send and Twitter Follow" addon Support

Hi, thanks for your previous help.
Upon installing your MOD, I learned that the Contact Us form is acting weird. Contact Us form started to pre-fill an email for visitors. Problem is that the email is my email no matter who tries to use the form.

Here's the related thread.

http://www.zen-cart.com/forum/showthread.php?t=191459

When I switched the html_header.php back to original instead of the modified one for the MOD to work, the symptom disappeared but MOD does not 100% correctly. It works but some components of MOD do not work. Facebook Meta Tag for example.

Some Zen Cart experts pointed out that the use of og:url has to do with the issue.
Do you know if I should make a change in html_header.php file?

Thank you in advance!

24 Jan 2012, 2:31 AM
#12
gopinathgoswami avatar

gopinathgoswami

New Zenner

Join Date:
Nov 2011
Posts:
32
Plugin Contributions:
1

Re: "Google Plus One (+1), Facebook Send and Twitter Follow" addon Support

Hi,

I have addressed this issue already and also posted the solution in this thread on 19th December 2011, 03:38 PM. Please go the page no. 1 of this support thread and make the changes as suggested.

Thanks

24 Jan 2012, 4:47 AM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: "Google Plus One (+1), Facebook Send and Twitter Follow" addon Support

It would be appropriate to post an updated version of your addon to fix the bug in your current release, which is causing conflicts with normal core code.

24 Jan 2012, 5:15 PM
#14
rafcamera avatar

rafcamera

New Zenner

Join Date:
Mar 2006
Location:
Belarus
Posts:
63
Plugin Contributions:
0

Re: "Google Plus One (+1), Facebook Send and Twitter Follow" addon Support

Hi. Thanks for the mod. But my store cache folder is getting flooded with PHP warnings:

PHP Warning: extract() [<a href='function.extract'>function.extract</a>]: First argument should be an array in html_header.php on line 50
PHP Warning: extract() [<a href='function.extract'>function.extract</a>]: First argument should be an array in html_header.php on line 51

Referred lines in the file are:

extract($product_info_metatags->fields);
extract($category_metatags->fields);

What can be done to fix this?
Thanks

24 Jan 2012, 6:00 PM
#15
rafcamera avatar

rafcamera

New Zenner

Join Date:
Mar 2006
Location:
Belarus
Posts:
63
Plugin Contributions:
0

Re: "Google Plus One (+1), Facebook Send and Twitter Follow" addon Support

Forgot to add that I'm using v1.5 Zen-Cart

8 Feb 2012, 10:56 PM
#16
leon2lil avatar

leon2lil

New Zenner

Join Date:
Jan 2012
Posts:
38
Plugin Contributions:
0

Re: "Google Plus One (+1), Facebook Send and Twitter Follow" addon Support

Hi i get this error when i press like

The app ID specified within the "fb:app_id" meta tag is not allowed on this domain. You must setup the Connect Base Domains for your app to be a prefix of http://www.mydomain.co.uk/index.php?main_page=product_info&cPath=9&products_id=74.

But yet it still post. What am i suppose to do.

9 Feb 2012, 3:48 AM
#17
gopinathgoswami avatar

gopinathgoswami

New Zenner

Join Date:
Nov 2011
Posts:
32
Plugin Contributions:
1

Re: "Google Plus One (+1), Facebook Send and Twitter Follow" addon Support

Hi,

It appears that you have typed a wrong domain name of http://www.mydomain.co.uk instead of your correct domain name.

Regards

16 Feb 2012, 3:48 PM
#18
larojiblanca avatar

larojiblanca

New Zenner

Join Date:
Jan 2009
Posts:
10
Plugin Contributions:
0

Re: "Google Plus One (+1), Facebook Send and Twitter Follow" addon Support

Hey, thanks for this incredibly quick and simple mod! Just a question though...is it possible to get the Google Plus and Twitter buttons on the same line on the product info display page? On my website it looks a bit cumbersome for them to be on separate lines.

17 Feb 2012, 3:41 AM
#19
gopinathgoswami avatar

gopinathgoswami

New Zenner

Join Date:
Nov 2011
Posts:
32
Plugin Contributions:
1

Re: "Google Plus One (+1), Facebook Send and Twitter Follow" addon Support

Please try to insert these codes in a table and see if it works.. for eg:

<table>
<tr>
<td><!-- bof Google +1 button to render --></td>
<td><!-- Twitter Follow Button BEGIN --></td>
</tr>
</table>

Regards

4 Mar 2012, 6:12 AM
#20
kamion avatar

kamion

New Zenner

Join Date:
Mar 2011
Posts:
93
Plugin Contributions:
0

Re: "Google Plus One (+1), Facebook Send and Twitter Follow" addon Support

Dear gopinathgoswami,

Did you try looking at the page for Facebook like button on Google Chrome browser? It doesn't show up in Chrome.

I shows up in Firefox and IE, but not Chrome.

Any ideas?

Cheers,
kamion