PayPal Hacks. 100 Industrial-Strength Tips and Tools Free Open Book

PayPal Hacks. 100 Industrial-Strength Tips and Tools

Previous Section  < Day Day Up >  Next Section

Hack 75 Upsell Your Customers

figs/moderate.gif figs/hack75.gif

Use the return variable to provide a list of items in which a customer might also be interested.

Although you can use IPN to provide an order summary [Hack #74], you're missing a sales opportunity if you don't use this page to advertise your other products, a technique known as upselling. For instance, say you're selling bicycle parts and someone comes along and buys a bottom bracket from your web site. Using this technique, your web site would then present this customer with a small ad listing some of the cranksets, pedals, and derailleurs you sell. It's easy to do, and it works better than you might expect.

7.15.1 The Return Page's Job

The return page is the page you show your customers once they are done paying for an item. To help you upsell your customers, this page has several jobs to do:

  • Retrieve information about the products purchased. In order to use this hack, you also need to insert cart details into a database [Hack #83] (or something like it) to keep a running record of purchases your customers have made.

  • Consult your sales database to find out what other buyers of this item have purchased. The heavy lifting in this hack comes from a single database query that is used to search the contents of the database table [Hack #74] to find a list of products that have been purchased by other customers.

  • Display a link and brief description for each. [Hack #55] shows how to link directly to the other product's details page so that customers can continue shopping if they choose.

7.15.2 The Code

Here's the ASP code that does it all:

<% 'Find the number of the item just purchased

Dim item_number

Item_number = Request.Form("item_number") %>



'Find products purchased by other buyers

connStore = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=

                "C:/InetPub/wwwroot/database/dbPayPal.mdb")

set rsProducts = Server.CreateObject("ADODB.Recordset")

rsProducts.ActiveConnection = connStore

rsProducts.Source = "SELECT DISTINCT item_number FROM tblOrderDetails 

                WHERE (payer_email IN (SELECT payer_email FROM tblOrderDetails WHERE 

(txtItemNumber = 'item_number')))"

rsProducts.Open( )

%>



<% If Not rsProducts.EOF Or Not rsProducts.BOF Then 'it exists %>

<%

'While recordset still has products, loop code

While NOT rsProducts.EOF

%>

<a href="http://yoursite.com/product_detail.asp?item_number=<%=rsProducts

("item_number)%">Link Text Here</a><br>

<%

'Move to next record

rsProducts.MoveNext( )

Wend

%>

<% End If %>

See the "Database Coding and Platform Choices" section of the Preface for the additional information needed to put this SQL statement to work with this and the other hacks in this book.


7.15.3 Running the Code

Simply save this file in a public folder on your web server, and then set your return page to the URL of the page [Hack #85] . When a customer pays, this code looks up the product that was just purchased and uses a SQL statement to look up past purchases of this product to see what other products those customers purchased along with it.

    Previous Section  < Day Day Up >  Next Section
    Index: [SYMBOL][A][B][C][D][E][F][G][H][I][J][L][M][N][O][P][Q][R][S][T][U][V][W][X][Y]


         Main Menu
    PayPal Hacks
    Table of Contents
    Copyright
    Credits
    Preface
    Chapter 1. Account Management
    Chapter 2. Making Payments
    Chapter 3. Selling with PayPal
    Chapter 4. Payment Buttons
    Chapter 5. Storefronts and Shopping Carts
    Chapter 6. Managing Subscriptions
    Chapter 7. IPN and PDT
    Introduction: Hacks #65-86
    What IPN and PDT Are
    How IPN Works
    Advantages of PDT
    Hack 65 Receive Instant Payment Notifications
    Hack 66 Troubleshoot Instant Payment Notifications
    Hack 67 Send a Purchase Confirmation Email with IPN
    Day Day Up
    Hack 69 Use IPN with eBay Listings
    Hack 70 Track Your eBay Products with IPN
    Hack 71 Deliver Digital Goods with IPN
    Hack 72 Deliver Digital Goods with a Return Page
    Hack 73 Implement Price Checking with IPN
    Hack 74 Provide an Order Summary with IPN
    Hack 75 Upsell Your Customers
    Hack 76 Enable Multiple IPN Pages
    Hack 77 Use Mass Pay to Create an Affiliate System
    Hack 78 Manage Your Inventory with IPN
    Hack 79 Display Donation Goals on Your Web Site
    Hack 80 Display a Recent Donor List
    Hack 81 Capture Customer Information with IPN
    Hack 82 Insert Payment Details into a Database with IPN
    Hack 83 Insert Cart Details into a Database
    Hack 84 Track Google Referrals
    Hack 85 Process Payments like a Credit Card with PDT
    Hack 86 Synchronizing PDT and IPN
    Chapter 8. The PayPal Web Services API
    Colophon
    Index


    More Books
    PHP Hacks
    Processing Xml With Java - A Guide To Sax, Dom, Jdom, Jaxp, And Trax
    The Koran (Holy Qur'an)
    Macromedia Flash 8 Bible
    Search Engine Optimization for Dummies
    YouTube Traffic
    PHP 5 for Dummies
    Harry Potter and The Chamber of Secrets
    Harry Potter and the Sorcerer's Stone
    The Pilgrim's Progress
    Wireless Hacks
    Flash Hacks. 100 Industrial-Strength Tips & Tools
    PayPal Hacks. 100 Industrial-Strength Tips and Tools
    Amazon Hacks
    Pdf Hacks
    The Da Vinci Code
    Google Hacks
    The Holy Bible
    Windows XP For Dummies
    Harry Potter and the Half-Blood Prince
    Seo Book
    Upgrading and Repairing Networks
    Macromedia Dreamweaver 8 UNLEASHED
    Windows XP Annoyances
    Windows XP Hacks
    Microsoft Windows XP Power Toolkit
    Teach Yourself MS Office In 24Hours
    iPod & iTunes Missing Manual
    PC Hacks 100 Industrial-Strength Tips and Tools
    PC Overclocking, Optimization, and Tuning - 2th Edition
    PC Hardware In A Nutshell 3rd Edition
    PC Hardware in a Nutshell, 2nd Edition
    Upgrading and Repairing PCs
    Google for Dummies
    MySQL Cookbook
    Teach Yourself Macromedia Flash 8 In 24 Hours
    PHP CookBook
    Sams Teach Yourself JavaScript in 24 Hours
    PHP5 Manual
    Free Games Paper Airplanes
    500 Juegos Gratis 500 Giochi Gratis 500 Jeux Gratuits 500 Jogos Gratis 500 Kostenlose Spiele