Call us Toll-Free:
1-800-218-1525
Live ChatEmail us

 Sponsors

Shopping Cart Integration

Dawn Rossi, 10-10-2007
There are literally hundreds of eCommerce shopping cart solutions out there. If you need to integrate shopping cart functionality into your website you could go with anything from PayPal, Google Checkout, YahooStore, through XCart, OSCommerce, all the way to the smaller ones such as InstantEStore, GoECart, 1ShoppingCart etc.

When it comes to Shopping Cart Integration though, all of these solutions fall short. They all force you to compromise.

Here's what I mean by that -

Shopping Cart solutions can be categorized to three distinct types:

1. Open Source: XCart, OSCommerce, ZenCart

Pros: Full control. You can customize ANYTHING
Cons: Long setup time (days to weeks). Runs from your single server. No built-in redundancy, load balancing

These open source solutions are great if you really want full control over the shopping cart so that you can customize every single page and properly integrate it with your website. You're going to need to keep a dedicated engineer in-house to manage and tweak the code as needed.

If you don't expect more than 100 transactions per hour, these are great solutions. But once you start hitting really high load, the system will fail. Investing into your own clustering and load balancing doesn't make sense for most people.

2. Hosted Shopping Carts: PayPal, GoogleCheckout

Pros: Nothing to install, Instant setup & integration. Supports high load and unlimited transactions
Cons: Little to no customization. Separate domain. Who owns the customer?

If you have a PayPal "Add to cart" button on your website, the user is redirected to the PayPal website and is asked to signup with PayPal. You cannot customize the user experience and PayPal/Google will not share the user financial information with you.

While both PayPal and GoogleCheckout are popular payment options that you should definitely offer to your customers, most major websites also offer an "in house" payment options, where the user remains on your domain and doesn't get sent to a third party during the checkout process.

3. Managed Shopping Carts: YahooStores, GoECart, MonsterCommerce

Pros: Nothing to install, Instant setup. Nothing to integrate. Supports high load and unlimited transactions
Cons: Some customization using the provider's wizards and template system. Provider manages your entire website.

Managed Shopping Carts are actually managed websites. For example, if I'm Sony.com and I'd like to run my shopping cart with GoECart, I would setup a subdomain of Shop.Sony.com and let GoECart manage my domain.

I could customize -some- of the user experience using GoECart's templates. But what if I'd like to integrate Shop.Sony.com with Sony.com, so that whenever a visitor comes back to my main website after they abandoned their cart, I could display a message saying - "Hey welcome back, You have 2 items in your cart. Click here"? No can do.

Managed Shopping Carts offer no integration with your primary website.

--

When we set out to create the Software Projects Shopping Cart solution, we wanted to get the best of all worlds.

Specifically - we wanted to allow customers to keep complete control over their website with full customization while letting them use SoftwareProjects high performance infrastructure to process payments, keep track of customers, shopping carts, transactions etc while avoiding the need to install a complete open-source shopping cart solution that translates to high total cost of ownership over time.

And we did just that:

(a) The Software Projects Shopping cart runs on our platform. So you don't have to worry about fault tolerance, load balancing and all that good stuff.

(b) To your end-user, it would appear as if everything is running on your domain.

(c) You have full access to your source code and you never have to install any of ours on your server.

Here's how to integrate the Software Projects Shopping Cart with your website:

Step 1: Add these five lines of code to the top of every page of your website. You probably have a header page that is included by all other pages on your site. That would be the best place to stick this code in:


session_start
(); if (!empty($s)) $sessid2=$s;
if (
Strcasecmp(substr($sessid2,0,6),'sessid')!=0) { $ch = curl_init(); curl_setopt($ch,CURLOPT_URL, "http://softwareprojects.com/cart/");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); $sessid2 = curl_exec($ch); curl_close($ch);
} @
session_register("sessid2"); @setcookie("sessid2",$sessid2,time()+3600*24*365,"/");

This code generates a session ID (unless one already exists) so that visitors to your website can add items to their shopping-cart, leave your site, come back six months later and find all items are still in their shopping cart.

Step 2: Design your own "view cart", "category" and "product" pages.

You can use our templates, create new pages on your own or integrate snippets into your existing website (For example: You might want to feature a certain product on your 'About Us' page, or display the 'Top 10 Products' on your home page).

Once you're ready to incorporate a certain shopping cart module into your website, you call a script from your code:

Here's how to incorporate a "view cart" snippet:


$ch
= curl_init(); curl_setopt($ch,CURLOPT_URL, "http://softwareprojects.com/cart/viewcart?a=777&s=$sessid2".
"&d=".$HTTP_GET_VARS['d']."&q=".$HTTP_GET_VARS['q']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); echo curl_exec($ch); curl_close($ch);

And here's how to incorporate a "login" snippet:


$ch
= curl_init(); curl_setopt($ch,CURLOPT_URL, "http://softwareprojects.com/cart/login?a=777&s=$sessid2");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); echo curl_exec($ch); curl_close($ch);

Refer to the help section for a list of all available shopping cart snippets you can add.

And remember to replace the '777' number above with your Software Projects Account ID.

Adrian Singer, 07-31-2008
Update:

There's no longer a need to mess with curl(). As of version 3.0, the API comes with a wrapper class

See Shopping Cart API v3
Enjoyed this post?

Subscribe Now to receive new posts via Email as soon as they come out.

 Comments
Post your comments












Note: No link spamming! If your message contains link/s, it will NOT be published on the site before manually approved by one of our moderators.

About Us  |  Contact us  |  Privacy Policy  |  Terms & Conditions