Online Shop and Cart
This is gCart, a shopping cart which is part of a Grails application. Here it is integrated with an online shop using PayPal for payment processing. This example runs in a PayPal sandbox, so to give it a full workout you will have to do the following:
- Go to the PayPal Sandbox.
- Sign up using your email address. It's free.
- Click the link in the email address confirmation email PayPal will send you. You will be taken to the sandbox site.
- Now sign in with your email address and password. You are now in your sandbox account.
- While in your sandbox account create a buyer account using a fake email address and new password. Gift yourself an adequate amount of fake money. Make a note of the fake credit card details with which they will issue you.
- While staying signed in to your PayPal sandbox open a new tab in the same browser (you should really have Online Shop open in a different tab and can just go to that) and go to Online Shop.
- You can now buy to your heart's content. You should be seamlessly transferred between Online Shop and PayPal. As an aside, a postcode consists of three or four digits.
You will see that items for sale are organized in categories. In this example the categories are single deep, but with a few changes I can make them so there can be nested categories to any number of levels. You can browse the categories and directly add from there to your shopping cart, or show one item in detail, maybe with an image and full description, and add it from there to your shopping cart.
Your shopping cart will always show, whether you are viewing a category or an item in detail. It will be instantly updated without a page reload when you add any number of items to your cart from the categories view. From the details view you will be taken back to the category you have been viewing if you add that item to your shopping cart. That item will then also show in your shopping cart. Removing or updating items from or in your shopping cart results in a page reload. Again, you will be taken to the categories you have last viewed or are still viewing.
There is no need to join or sign in to buy from this shop. If anyone wants to try it from an administrators point of view, email me at admin at databaseapplications spot com stop au and I will enter you as an administrator and email you a username and password. That way you can add categories and items and change them and see a few things casual users cannot see.
This shop can be extended in many ways. The following are some examples:
- Add images for the articles and categories.
- Have an infinite number of sub categories for every category.
- Inventory management - don't sell more of an article than you have. Get an email when an article is running low.
- Return customers can log in so as not to have to enter their details again. They can keep their own details up to date.
- Use the shop to sell online documents. It already gets PayPal Instant Payment Notifications and responds to that.
- Sell something on one of several forms of recurring payment plan.
- Obviously, have your own aesthetic design and your own branding.
Whether the user clicks on the link at PayPal to come back to Online Shop, or not, the sale is completed as Online Shop recieves Instant Payment Notification feedback from PayPal and writes that to its database.
There you have it - an online shop that is easy and fast to use, easy and fast to maintain and integrated with PayPal so you don't need to take care of credit card handling. The money just turns up in your bank account.