O'Reilly logo

PHP 5 e-commerce Development by Michael Peacock

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Tweeting about happy customers

With a sharp rise in social networking, automated tweets can be a nice touch to add to a website. We could have our framework automatically send a tweet each time a customer pays for an order.

There is a simple, easy-to-use PHP Twitter library available, which makes sending Twitter updates a breeze:http://emmense.com/php-twitter/.

To use the library, all we need to do is include the library, create a new Twitter object, set our username and password, and then call the update method. To send a tweet on each purchase, we just add the following code into our payment method object, where it updates the status of orders.

requier_once('lib/class.twitter.php'); $t = new Twitter; $t->username = 'TWITTER USERNAME'; $t->password ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required