Shopping Cart Querystring Parameters
Overview:
External web sites can link into several ordering pages in the cart ordering process, either to view product catalog information, view the cart, or to add items to the cart. Much of the behavior of the cart will be determined by the querystring parameters passed in on the first visit to the ordering process, so it is important that all necessary parameters are passed in on every external link into the SOLO Server ordering process.
Once you have Generated an Ordering Link from the Store / Generate Ordering Links or Store / Create a New Order/Cart pages, you can append the querystring parameters to the URL.
Author Catalog Page (Author.aspx)
The author catalog page lists out all products available to new customers for a given author with links to the product details page for each. In addition, the page can optionally filter the product list by category. The page supports the following querystring parameters:
- AuthorID - The AuthorID to display products for.
- CategoryID - The CategoryID to filter by.
Only one of these is required, but it is best practice to always pass the AuthorID regardless so no errors occur should a category be deleted.
Product Details Page (Product.aspx)
The product details page displays details on a specific product, with links to the product option details page for each. If only a single option is available on the product, the page will automatically redirect to the product option details page for that option. The page requires the following querystring parameter:
- ProductID - The ProductID of the product to display.
Product Option Details Page (ProdOption.aspx)
The product option details page displays details on a specific product option, as well as offering a form allowing the user to specify a quantity and add the item to the cart. If a EULA is defined on the product, the user will first be taken to the license agreement page before the item can be added to the cart, otherwise, the item will be added directly to the cart. The page requires the following querystring parameter:
- ProdOptionID - The Product Option ID to display.
License Agreement Page (LicenseAgreement.aspx)
For products with a EULA specified, this page displays the license agreement and prompts the customer to accept the agreement before adding the item to the cart. If no EULA is specified, the page will automatically redirect to the cart page and add the item to the cart. The page requires the following querystring parameter:
- ProdOptionID - The Product Option ID to display the EULA for.
Shopping Cart Page (Cart.aspx)
The shopping page can be linked in numerous ways to perform different actions such as:
- Displaying the cart
- Initiating checkout
- Adding an item to the cart simple)
- Adding an item to the cart advanced)
- Applying a priority code to the cart
- Clearing the cart
- Performing multiple actions
- Returning to an existing cart
The next few sections will outline linking to the cart page in each of these instances. Though this is not required in all instances, it is highly recommended that regardless of how the cart page is being call, you should include the following querystring parameter AT ALL TIMES:
- AuthorID - The AuthorID to create the cart for if no cart is found. If this is not available and an existing cart is not found for the customer, the system has no way of determining where to route the customer to create a fresh cart. In these cases, they will be offered a link back to a page listing all authors where they can select an author and start a fresh cart.
Displaying the Shopping Cart
To simply display the cart and perform no other actions, simply call the page with the following required querystring parameter:
- AuthorID - The AuthorID to create the cart for if no cart is found.
Initiating Checkout
To initiate checkout, call the cart as if displaying it, but add the following additional querystring parameter:
- checkout=true
Adding an Item to the Cart (Simple)
To add an item to the cart, use the following querystring parameters:
- action=add - Instructs the cart you are trying to add an item
- actiondata0 - ProdOptionID to add to the cart
So, to add ProdOptionID 1234 to the cart, use the following querystring:
- action=add&actiondata0=1234
Adding an Item to the Cart (Advanced)
The actiondata0 parameter described above can also accept a comma separated list of additional data regarding the item to be added. The additional fields are as follows:
- Quantity - Quantity to add to the cart
- UpsellProdOptionID - ProdOptionID to tie the item to for an upsell discount. This is generally not used when linking externally to the cart - it is used internally by the cart when adding upsells. Simply pass a 0 to not specify an UpsellProdOptionID.
- UpgradingFromLicenseID - LicenseID to tie the new license to by setting the UpgradeFrom field to during order processing. Pass a 0 to not specify an UpgradingFromLicenseID.
- CustomData - Custom data string to store on the license. This advanced option and is generally not used.
- RuleLicenseID - If the item being added is subject to upgrade/renewal rules, the LicenseID to verify the rules against. Pass a 0 to not specify a RuleLicenseID.
- Advanced Fields - Additional fields are available for advanced implementations. Documentation for these fields is available upon request. Please contact us with additional information on any advanced needs for further information.
The fields must be passed in this order, but you can omit fields from the end that are not needed. For example, to specify a quantity of 4 when adding an ProdOptionID 1234 to the cart, use the following querystring:
- action=add&actiondata0=1234,4
To also specify a CustomData field of "ExampleCustomData", the querystring would be:
- action=add&actiondata0=1234,4,0,0,ExampleCustomData
Applying a Priority Code to the Cart
Applying a priority code to the cart is similar to adding an item to the cart. To apply a priority code, use the following querystring parameters:
- action=applyprcode - Instructs the cart you are trying to apply a priority code
- actiondata0 - Priority code to apply
So, to apply priority code EXAMPLE to the cart, use the following querystring:
- action=applyprcode&actiondata0=EXAMPLE
Clearing the Cart
To clear all items from the cart, pass the following querystring parameters:
- action=clear - Instructs the cart you want to clear all items
- actiondata0 - Simply pass this as a blank value - this is required for compatibility with multiple actions described in the next section.
Performing Multiple Actions
Multiple actions can be performed in a single call to the cart page - for example, two items can be added and a priority code can be applied with one link to the cart. This is accomplished by specifying multiple actions in order in the querystring. The "0" in the actiondata0 parameter described above is actually a zero-based index which can be changed to support multiple sets of "actiondata" for multiple actions. To string several actions together, simply specify each action followed by its actiondata, incrementing the index on "actiondata" for each action. For example, the add both ProdOptionID 1234 and 5678 as well as apply priority code EXAMPLE in a single call, the querystring would be as follows:
- action=add&actiondata0=1234&action=add&actiondata1=5678&action=applyprcode&actiondata2=EXAMPLE
Returning to an Existing Cart
To return to an existing cart, pass the following querystring parameters:
- cart=exist - This flag indicates a return to an existing cart.
- CartID - The CartID to return to
- Password - The customer password. This is optional in cases where there is no customer associated with the cart, but required when a customer is already associated with the cart for security reasons.
Initialization Querystring Parameters
In addition to the querystring parameters specific to each page outlined above, numerous additional optional querystring parameters can be passed to any of the cart pages when initializing a new cart. Note that these parameters will only be considered when creating a new cart - they are ignored if a cart already exists, so if you opt to use these they should included in ALL links into the cart. These optional parameters are as follows:
- MallID - Reserved for future use.
- DistributorID - The Distributor ID to be associated with the order.
- Source - The order source. This can be any string up to 50 characters in length. If passed in, this will be stored on the cart and saved on the invoice upon checkout. In addition, the "How did you hear about us?" drop down and text box will not be displayed on the registration page. Be sure to URLEncode this value before adding to a querystring.
- Promo - The promo code. This can be any string up to 50 characters in length, and is used to supplement the source for additional tracking functionality. If passed in, this will be stored on the cart and tied to the invoice upon check out. Be sure to URLEncode this value before adding to a querystring
- ReturnPage - A URL to return to from the continue shopping button which will override the continue shopping URL defined on the cart options. Be sure to URLEncode this value before adding to a querystring.
- Single - A true/false value determining whether to run the cart in single order mode (assumed false if omitted).
- UserPONumber - A PO Number to pass on to the invoice during order processing.
- NoPayPal - A true/false value which when included will cause the paypal payment option to be hidden (assumed false if omitted).
- NoMailInst - A true/false value which when included will cause the by mail payment option to be hidden (assumed false if omitted).
- NoPhoneInst - A true/false value which when included will cause the by phone payment option to be hidden (assumed false if omitted).
- ARedir - A true/false value which determines whether the login screen is bypassed for customers with no customer cookie (assumed false if omitted).
- NoPrCode - A true/false value used to determine whether to display the priority code entry field on the cart page (assumed false if omitted).
- RegisterRedirect - A custom page to redirect to during the checkout process after the customer has registered. This is an advanced option. The path to the page is relative to the root of the author custom directory, and does not support querystring parameters. Be sure to URLEncode this value before adding to a querystring.
- CompletionRedirect - A custom page to redirect to after the order has successfully processed instead of the standard thank you page. This is an advanced option. The path to the page is relative to the root of the author custom directory, and does not support querystring parameters. Be sure to URLEncode this value before adding to a querystring.
Auto Login Querystring Parameters
Similar to the initialization querystring parameters, the cart also supports auto login querystring parameters which can be used to automatically log in a customer or distributor to the cart. Like the initialization parameters, these parameters will only be considered when creating a new cart - they are ignored if a cart already exists. These parameters are as follows:
- CustomerID/Password - Pass these values to automatically log in the customer by CustomerID/Password.
- Email/Password - Pass these values to automatically log in the customer by Email/Password.
- DUserID/DPassword - Pass these value to automatically log in a distributor by UserID/Password and set the cart to Distributor Mode.
Forcing Creation of a new Cart
To force creation of a new cart, simply pass cart=new in the querystring.