Friday, April 30, 2010

ezSHOP - A PayPal Shopping Cart For Your Google Site


On my previous posting, I have demoed using the Google Spreadsheet to manage the PayPal shopping cart on Google Site. However, the back-end server was an Amazon EC-based PHP agent. Now I have ported the server to Google App Engine which users can just use their Google authentication  login to finish the setup without giving away their passwords.

To begin the store setup you need to prepare your items on the Google Spreadsheet, you can see the example spreadsheet here. Make sure your spreadsheet has the same headers (case sensitive), the sku, title, price, picture url fields are required, all others are optional.

To start the set up go to  ezshop411.appspot.com

You need to have a Google account (Gmail or Google Apps account) to start. Once you login, you will be bringing to the User Preference page. Your nick name will be your Google account id and the email will be your Google Email. The following two fields asking for an additional Google account which should have minimum READ access right for the spreadsheet you gonna use for the store. You can enter the same account information as your original one, however, for the security, we recommend use different Google account.
Once all information filled out, click at the Update button to save them. Now click at "Main" button you start the build-up. The main page already load all your Google Spreadsheet files' name from your site for you to choose to generate the token to create the PayPal store.
user preference settings


Once you decide which file to use just click at "Add" button to create one store Gadget list. It will show you the time it was created and the store Gadget URL which you will need to use it when add the store gadget to your Google Site. You can also remove the listing by clicking at "Delete" button. The deleting will not delete your spreadsheet on your Google Doc, however, if you have any Gadget using this token to access the store information will stop to function. If you click at the name of the list it will show you the spreadsheet in CSV format, you can use the feature to double check if you choose the right file.

Now, open the Google Site, select the site you want to add the ezSHOP store, choose the PAGE you want to add the store Gadget, click at "Edit page" button. Once you are in EDIT mode, go to the section where you want to add the Gadget, then click at "Insert" button, choose "More gadgets"

A new window will pop out -

Click at "Add gadget by URL" on the left-hand side.

Type in the URL which you copy from your main page's Gadget URL then click at "Add" button.

A Gadget setup screen will be displayed as above. Gave the Gadget the proper width and height, make sure you check the "include a scroll-bar on gadget when necessary". Click "OK" to finish setup.
You can always come back to edit the Gadget setting by clicking at "Properties" of the Gadget.
Once you save the PAGE from EDIT mode, you should be able to see the store items listing right away. The current released version only supports PayPal "Buy Now" button. I will add the PayPal shopping cart function for the next release. Once customer click at "Buy Now" button, a PayPal payment page will show up and customer can fill up the information to complete the transaction!
There are some other issues like shipping charge, sales tax, inventory control... etc. You will need to go to your PayPal account page to  set up correctly. Some of the functions can be done programmatically through PayPal API, we will discuss these more details in the future releases.

Above is the sample spreadsheet we used to do the demo, you can download it and upload it to your Google Doc to test this ezSHOP Gadget.


********************************************************
NOTE:
This Gadget only works under HTTP not HTTPS since there is PayPal service url link within the HTML codes, unfortunately, now Google Sites default URL only allows HTTPS, like https://sites.google.com/a/.... therefore, you have to map your own domain host name to the Google SITES to use HTTP, for example, create a host named "store" under your Domain, so http://store.yourdomain.com will be your url. To map your domain host to Google Sites just go to "Manage Site" and choose "Map this site" button to proceed. Only done, you can see the Gadget under you own domain url page.

15 comments:

  1. This is great. Have been looking for this functionality. Wish that more custom fields could be added such as category, and being able to sort on fields on the display page. Well done.

    ReplyDelete
  2. Dear Horace. I'm very einterested in using this applet.
    The problem is that I've got a little confused when it started to ask me paswords and i've mistaken myself a few times, especially with the Google apps pasword (At that time I did not reed your post yet) And now I just can't acces anymore... What can I do?

    ReplyDelete
  3. Reciclone,

    Did you solve your problem yet?

    I do have problem with some Google Apps accounts creating the Gadget, I will recommend you use GMAIL account to login and create the gadget if your application (spreadsheet) is under a different Google Apps ID, then make this spreadsheet sharable with the Google Gmail account, and use the Gmail account to generate the Gadget.

    Let me know if you still have problem. The next version of this PayPal shopping cart is coming out soon which will offer more functions and customized settings.


    Horace Lin

    ReplyDelete
  4. Thanks alot Horace! I've finally solved my problem...
    Congratulations it is great!

    ReplyDelete
  5. can we change the layout of gadget. i mean other than horizontal layout, can it be vertical without the lines...??

    ReplyDelete
  6. Rajat,

    Sorry! Not for the current version! Please wait for the next release which you will have more power to control the layout.

    ReplyDelete
  7. Thanks for writing this and making it available. I have been looking for a way to do this for ages.

    I am stuck at the point where you add the gadget and insert the token id.
    It doesn't seem to be loading my Google Docs inventory spreadsheet. All I see are the headings:
    Photo, sku, description, name & Price. None of my inventory items are showing up.

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
  9. now,show below code when login:
    "Traceback (most recent call last):
    File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 634, in __call__
    handler.get(*groups)
    File "/base/data/home/apps/ezshop411/2.346901486099459143/bookmarksbin.py", line 154, in get
    self._displayBookmarksPage()
    File "/base/data/home/apps/ezshop411/2.346901486099459143/bookmarksbin.py", line 68, in _displayBookmarksPage
    f = spreadsheet.SimpleCRUD(id, fspass)
    File "/base/data/home/apps/ezshop411/2.346901486099459143/spreadsheet.py", line 25, in __init__
    self.gd_client.ProgrammaticLogin()
    File "/base/data/home/apps/ezshop411/2.346901486099459143/gdata/service.py", line 793, in ProgrammaticLogin
    raise BadAuthentication, 'Incorrect username or password'
    BadAuthentication: Incorrect username or password" [ezsh0]

    [ezsh0]: http://ezshop411.appspot.com/ ""

    ReplyDelete
  10. I love the idea of a paypal shop gadget for google, but no way am I giving you all my passwords.

    ReplyDelete
  11. I'm looking for basket functionality i.e. putting more than one item into a basket (then deleting ones that aren't wanted) and then paying for all the items I want at the same time.

    This code seems to use buy now type buttons i.e. buying each item individually.

    ReplyDelete
  12. it doesnt populate for me I don't understand? why it's not working...

    ReplyDelete
  13. This Gadget only works under HTTP not HTTPS since there is PayPal service url link within the HTML codes, unfortunately, now Google Sites default URL only allows HTTPS, like https://sites.google.com/a/.... therefore, you have to map your own domain host name to the Google SITES to use HTTP, to map your domain to Google Sites just go to "Manage Site" and choose "Map this site"

    ReplyDelete