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

 Sponsors

SoftwareProjects Shopping Cart Guidelines

Adrian Singer, 08-01-2008
When SoftwareProjects set out to create The Perfect Shopping cart, we had three primary goals:

* It had to be 100% fully customizable
* Easy to setup
* Robust & Scalable, regardless of your website hosting solution

A few years later, the SoftwareProjects shopping cart is now deployed by more than 3,000 sites. Every single day, another business is ditching their 1ShoppingCart, UltraCart, XCart or OSCommerce platform, switching to SoftwareProjects.

It turns out we got most of it right.

With the back-end running in SoftwareProjects data centers and the front-end running on your site, you get full control over the user shopping experience. Changing the process flow, adding one-time-offers or creating new payment options, is super easy.

But with all this power and flexibility, there are a few simple guidelines you should follow, to avoid messing things up.

This guide will cover all the things you should pay attention to, when integrating the SoftwareProjects shopping cart with your site.

Installation

1. Login to your SoftwareProjects account, click on the 'Product Manager', then click on the 'Settings' link on the left, complete all fields and follow the instructions, to copy spicart.php to your server's main directory.

The spicart.php file is dynamically generated with your SoftwareProjects account ID, password and settings. Do NOT share this file with others.

2. Include this line on every single one of your pages, at the top of the page (before any output is sent to the user):


// Include the SoftwareProjects shopping cart
require_once($DOCUMENT_ROOT."/spicart.php");

3. Include this line on every single one of your pages, at the bottom of the page (right before the closing
tag):


// Track everything
track();

Avoid Using HTTP 301/302 Redirects on home page

You should avoid using HTTP 301/302 redirects on the home page of your shopping cart or sales process.

This is very important.

As soon as a new user visits your site, the SoftwareProjects shopping cart (spicart.php) saves information in cookies about where the user came from, referring affiliate id, sid tags and more.

Using a redirect prevents this information from getting properly stored. HTTP protocol does not allow saving cookies when the response is a 301/302 redirect.

As an example, this is wrong:

index.php:

// Include the SoftwareProjects shopping cart
require_once($DOCUMENT_ROOT."/spicart.php");

// Do something
// ...

// Redirect
Header("Location: hello.php");

The reason the code below is wrong is because the redirect at the bottom, blocks the ability of spicart.php to save information into a cookie about the referring webpage and affiliate.

The first time spicart.php will be able to save this information is under hello.php and by that time, the referrer would appear to be "index.php" with no affiliate ID, instead of the original real referring site.

Note: It is okay to use redirects on any page following your front-page, because by that time, cookies are already stored on the end-user's machine.

Stick to a Single domain name

SoftwareProjects Shopping cart saves all cookies under -your- domain. You should keep the entire shopping process flow under a single domain.

Redirecting the user to a different domain, even if you have the SoftwareProjects Shopping cart installed on the new domain, will result in losing all information about referrer, affiliate id, sid tags etc.

Secure Pages (https://)

If you have certain pages on your website that you'd like users to access via https:// (For example: the checkout page), you don't have to manually redirect the user to your secure domain.

All you have to do is let the SoftwareProjects shopping cart know which pages need to be secure. The cart will take care of automatically redirecting the user to https:// if the page was accessed via http://

To do that, just add $SECURED_PAGE=1 at the top of every page that needs to be secure.

For example:


// This page needs to be secure
$SECURED_PAGE = 1;
// Include the SoftwareProjects shopping cart
require_once($DOCUMENT_ROOT."/spicart.php");

Reserved Variable Names

Avoid using these variable names in your PHP scripts, as they are used by the SoftwareProjects shopping cart:

aff_id
sid
sessid2
referrer

Absolute URLs are bad

This rule is a general guideline you should follow to make future migration of your site and duplicating existing process flows, easy and fun.

This is bad:


<form name=myform action='http://www.mydomain.com/signup.php'>
</
form>


This is good:


<form name=myform action='signup.php'>
</
form>


Product-level Tracking

The SoftwareProjects shopping cart has the ability to track your traffic, sales, conversion rates, ROI and net profit on a per affiliate, SID code and product level basis.

Affiliate and SID tracking is automatic. There's nothing you have to do to make it work.

Product-level tracking requires your attention to make it work.

If you're using a shopping-cart style site, where the user is presented with dozens of products to choose from, clicks 'Add to cart' and checks out at the end, you can skip this part. Product-level tracking will work automatically for you.

However, if you're an info marketer, or if your website follows the style of selling individual products on each page, you need to tell the shopping cart which product is displayed on every single sales landing page.

For example, let's assume you have a website where you're selling two products - "Boston Red Sox Ticket" and a "Flip Camera".

You created two landing pages: bostonredsox.php and flipcamera.php

To activate product-level tracking, you have to add a line at the top of each file, right before including spicart, specifiyng the SoftwareProjects product codename that is being offered on the page:

bostonredsox.php

// This is the boston red sox product
$product_codename = "bostonredsoxticket";
// Include the SoftwareProjects shopping cart
require_once($DOCUMENT_ROOT."/spicart.php");

flipcamera.php

// This is the boston red sox product
$product_codename = "flipcamera";
// Include the SoftwareProjects shopping cart
require_once($DOCUMENT_ROOT."/spicart.php");
 

To determine the codename for your products, click on the Product Manager, select an individual product and the product-codename will be displayed at the top right corner.

Use the API wrapper class

With the release of version 3.0 of the SoftwareProjects shopping cart API, all common functions are now wrapped with easy to use PHP functions.

If you've integrated the SoftwareProjects shopping cart with your website prior to July 2008, your scripts are probably filled with ugly looking curl() calls. This used to be the only way you could interface with the API.

The API wrapper class will help you clean your code, avoid any future compatibility problems and generally runs faster. Replace all curl() calls with calling the API functions directly.

Adrian Singer, 08-01-2008
Questions? Comments? Things on your wish list?

Or maybe you're just having a hard time getting something done right --

With 3,000 successful deployments of the SoftwareProjects shopping cart, it's more than likely someone have already gone through implementing that unique shopping experience you're after.

Please post your question here or contact us directly and we'll be happy to help.
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