Twitter Tweets

Locked

Views: 12,077

Results 21 to 40 of 60
This thread is locked. New replies are disabled.
23 Jun 2009, 8:36 AM
#21
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Twitter Tweets

I've tested it by clicking the "New Product" button and it works very well indeed. Great job Wilt very well done.

Here is the code that appears at the top of the screen:

**Error Tue Jun 23 08:32:34 +0000 2009 2292140682 LIMELITES has a new product. http://tinyurl.com/mbvohh web false false 37887574 limelites.co.uk limelites http://s3.amazonaws.com/twitter_production/profile_images/208255443/avatar_normal.gif false 8 9ae4e8 000000 0000ff e0ff92 87bc44 3 Tue May 05 08:51:47 +0000 2009 1 http://static.twitter.com/images/themes/theme1/bg.gif false 8 false false false **

This should be precisely what Linux was after and I can confirm that it does work beautifully. I'm sure it'll be useful to a lot of people who Twitter.

Could I be a pain in the ######## and ask, is there a way to manipulate this code so that it also works when I "copy" a product and use the "Duplicate product" Radio Button to create a new ad?

23 Jun 2009, 12:39 PM
#22
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Twitter Tweets

I've tried replacing **if ($action == 'insert_product') ** with if ($action == 'duplicate_product')

........ but obviously I don't know the correct function as this does noting... What might I need to use instead?

23 Jun 2009, 3:37 PM
#23
nfm avatar

nfm

New Zenner

Join Date:
Jan 2008
Posts:
90
Plugin Contributions:
0

Re: Twitter Tweets

Honestly, since I'm using FireFox I have the Shareaholic plugin. I just go to the new product, right click, click Bit.ly and then post the new product to Twitter with two button presses. Sometimes I customize the message as well.

BTW...the Shareaholic plugin for Firefox is amazing for e-commerce. I add to Bit.ly (which adds to Twitter for me), Facebook, MySpace, Kaboodle, and Twine from it and there is no need to add any code to Zen-Cart.

I know it's not EXACTLY what you were looking for but it's definitely worth grabbing.

23 Jun 2009, 4:27 PM
#24
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Twitter Tweets

OK, so I've answered my own question. I just replaced if ($action == 'insert_product') with if ($action == 'update_product') and it's now adding everything to Twitter when I am in fact just duplicating existing ads to use as templates. When I finally click "Update" then it adds to Twitter.

Wonderful!!

I read the post above about Shareaholic and I've installed the FF Addon too. It will come in handy if I decide to ever use those other networks.... Do you recommend any in particular? Twine?? I've never even heard of Twine but is it worth the time and effort having your products listed there?

Also, could I ask you to help with one more thing? Instead of the Twitter feed saying** $message = STORE_NAME . ' has a new product. ' . $tinyPurl;** would there be a way to make it display the product_id and the product_price and then the tiny URL? ?

23 Jun 2009, 6:07 PM
#25
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Twitter Tweets

OK guys, someone please help me out here as I've been struggling with this code for ages now. I'm trying to have the code upload to Twitter, but instead of the STORE_NAME and standard message, I want it to post the products name followed by the products_price and finally the tiny url....

The Code I'm using is working for the price and the tiny url but I cannot for the life of me get the products name to display... what $ must I use for it to display the products name because $products_name just will not work!! I've also tried $productname and $ProductName but just cannot get it to display...

$message = $products_name . ' £' . $products_price . ' ' . $tinyPurl;

Can anyone help please??

23 Jun 2009, 6:20 PM
#26
wilt avatar

wilt

Oji-san

Join Date:
Jun 2003
Location:
Newcastle UK
Posts:
1,928
Plugin Contributions:
3

Re: Twitter Tweets

The problem with the product name is that it is language dependant. So there is no simple variable holding it.

However you can access the name in the default language using

$_POST['products_name'][$_SESSION['languages_id']]

23 Jun 2009, 6:21 PM
#27
wilt avatar

wilt

Oji-san

Join Date:
Jun 2003
Location:
Newcastle UK
Posts:
1,928
Plugin Contributions:
3

Re: Twitter Tweets

Just a note as well. There is an API to use bit.ly, although it takes a bit more work than tinyUrl as it requires authentication.

23 Jun 2009, 6:36 PM
#28
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Twitter Tweets

Wilt, thank you!! That worked an absolute treat :-)

24 Jun 2009, 7:17 AM
#29
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Twitter Tweets

Hi All,

Back to the drawing board with this, it's working but now I want the product special price sent to twitter... what would I use instead of** $products_price** to display $products_special_price?

24 Jun 2009, 8:11 AM
#30
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Twitter Tweets

OK, answered my own question again:
**
$display_special_price = zen_get_products_special_price($products_id, true)**

But how do you get the price to display to two places after the decimal point? At present, it's displaying £49.9900 instead of £49.99

24 Jun 2009, 10:28 AM
#31
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: Twitter Tweets

OK, solved:

round(zen_get_products_special_price($products_id, false), 2)

24 Jun 2009, 2:20 PM
#32
nfm avatar

nfm

New Zenner

Join Date:
Jan 2008
Posts:
90
Plugin Contributions:
0

Re: Twitter Tweets

limelites:

I read the post above about Shareaholic and I've installed the FF Addon too. It will come in handy if I decide to ever use those other networks.... Do you recommend any in particular? Twine?? I've never even heard of Twine but is it worth the time and effort having your products listed there?

I get a good share of my visitors from Kaboodle and Twine believe it or not.

Also...the other poster mentioned needing an API for Bit.ly....I never set one up and it works fine for me.

24 Jun 2009, 3:27 PM
#33
wilt avatar

wilt

Oji-san

Join Date:
Jun 2003
Location:
Newcastle UK
Posts:
1,928
Plugin Contributions:
3

Re: Twitter Tweets

Shareaholic uses its own bit.ly account/api key behind the scenes.

If you want custom tracking of bit.ly links then you can set it to use your own personal bit.ly account.

If you want to use the bit.ly api programtically, you will need a bit.ly account/api key.

HTH

25 Jun 2009, 12:00 AM
#34
johnmans avatar

johnmans

New Zenner

Join Date:
Mar 2007
Posts:
31
Plugin Contributions:
0

Re: Twitter Tweets

This seems great. Is there someone that can post a wrapup version of this code and what to change. I really want to do the same thing on my shop!

7 Jul 2009, 10:05 PM
#35
karimm avatar

karimm

New Zenner

Join Date:
Nov 2008
Posts:
53
Plugin Contributions:
0

Re: Twitter Tweets

Yes, this is great...

please post a copy and past solution...

thanks

10 Aug 2009, 1:56 AM
#36
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Twitter Tweets

wilt:

Hi,

I've successfully tried this a number of times.

You're probably going to have to do some debugging. One thing you could try is this.

Replace this line.

  updateStatus($user, $password, $message);
> ```
      $result = updateStatus($user, $password, $message);
      $messageStack->add_session($result, 'error');

Now when you add a new product, you should see a red error bar at the top of the page, containing a lot of unformatted information.

If you 'view source' for that page you should see something like this.

<table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="messageStackError"> <td class="messageStackError"><img src="images/icons/error.gif" border="0" alt="Error" title=" Error "> <?xml version="1.0" encoding="UTF-8"?> <status> <created_at>Mon Jun 22 19:53:49 +0000 2009</created_at> <id>2283649261</id> <text>Zen Cart has a new product. http://tinyurl.com/lxpf9k</text> <source>web</source>

<truncated>false</truncated>
<in_reply_to_status_id></in_reply_to_status_id>
<in_reply_to_user_id></in_reply_to_user_id>
<favorited>false</favorited>
<in_reply_to_screen_name></in_reply_to_screen_name>
<user>
<id>32979144</id>

> 
> If you do not get the error message, then the code does not seem to be executing.

I have inserted the code and it is where it is suppose to be. My problem is this, when i insert a new product I get the error message bar at the top but their is no writing or nothing besides the error bar. When I look at the source code it don't show up. What am I doing wrong. Thank you.

Is your site Upgraded to the current version 1.5.4 Yet?
zencart-upgrades-website-installation

11 Aug 2009, 3:11 PM
#37
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Twitter Tweets

Mr wilt do you have time to help me out. I know you are very busy. I just can not figure it out. It wont work for me but I sure would like for it to. Thank You in advance.

Is your site Upgraded to the current version 1.5.4 Yet?
zencart-upgrades-website-installation

11 Aug 2009, 8:22 PM
#38
wilt avatar

wilt

Oji-san

Join Date:
Jun 2003
Location:
Newcastle UK
Posts:
1,928
Plugin Contributions:
3

Re: Twitter Tweets

Its difficult to know without seeing exactly what you have done.

However; If you are seeing an error message bar, then by deduction, there must be something in your html source.

12 Aug 2009, 12:04 AM
#39
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Twitter Tweets

wilt:

Its difficult to know without seeing exactly what you have done.

However; If you are seeing an error message bar, then by deduction, there must be something in your html source.

What would you like for me to do so you can take a peek. I really would like this to work. I don't know if it would be because of GoDaddy severs or not.

Is your site Upgraded to the current version 1.5.4 Yet?
zencart-upgrades-website-installation

12 Aug 2009, 12:24 AM
#40
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Twitter Tweets

sorry, I will pm you with it. My source code that is.

Is your site Upgraded to the current version 1.5.4 Yet?
zencart-upgrades-website-installation