Querystring Variables

SmithCart > Integration

SmithCart supports a number of different querystring operations to dynamically pass data into various pages in your store.

Contents



Introduction

The querystring is the part of the URL that contains data to be passed to SmithCart to perform a dynamic operation in the cart. This is useful if you have another portal page with products or catalog navigation and want to link to SmithCart.

The following querystring operations are supported in SmithCart:

  • Product List - Filter Products By Category
  • Product List - Filter Products By Department
  • Product List - Filter Products By Vendor/Registrant
  • Add to Cart - Single/Multiple Products
  • Add to Cart - Product and Quantity
  • Add to Cart - Variants
  • Add to Cart - By Sku
  • Add to Cart - By Serial Number
  • Add to Cart - Custom Fields
  • Add to Cart - Apply Coupon
  • Product Details - Products and Variants
  • Product Details - Custom Fields
  • Affiliate Tracking

[up to contents]



Product Listing

The product listing page is the first page when you navigate the page with the BuyNow module. Product listing pages are where information of multiple products is displayed and represent a vital point of an E-commerce store on which consumer decisions are made.

The Product Listing page supports the following querystring variables:

  • Filter Products By Category
  • Filter Products By Department
  • Filter Products By Vendor/Registrant

[up to contents]



Filter Products By Category

The product listing page of the cart allows you to filter products by category by passing the CategoryID or URL Keywords in the querystring. When the CategoryID or URL Keywords are passed in the querystring the products will be filtered by Category. This feature will allow you to create your own separate category page using the DNN Html module and rich text editor with links or images to filter your products.

The Category ID for each Category in your store is listed on the Manage Categories screen.

Example: http://www.yourdomain.com/Store?categoryid=1

The URL Keywords for each Category in your store are configured on the Edit Category screen.

Example: http://www.yourdomain.com/Store/cat/[URLKeywords]

For more information about the Edit Category screen, please see the Manage Categories KB article.

[up to contents]



Filter Products by Department

The product listing page of the cart allows you to filter products by department by passing the DepartmentID in the querystring. When DepartmentID is passed in the querystring the products will be filtered by department. Additionally, if you have the Category Module on the page, Categories will be filtered by Department. This feature will allow you to create your own separate department landing page using the DNN Html module with links or images to filter your products by department.

The Department ID for each Department in your store is listed on the Manage Department screen.

Example: http://www.mydomain.com/ProductList?departmentid=1

The URL Keywords for each Department in your store are configured on the Edit Department screen.

Example: http://www.yourdomain.com/Store/dept/[URLKeywords]

For more information about Departments, please see the Manage Departments KB article.

[up to contents]



Filter Products By Vendor/Registrant

The product listing page of the cart allows you to filter products by Vendor ID or Registrant by passing the “VendorID” in the querystring.

Example: http://www.mydomain.com/Default.aspx?vendorid=5

When the Vendor ID is passed in the querystring the products or gift registry will be filtered by vendor.

Please Note: This feature requires the Smith Vendor Marketplace module or Smith Gift Registry module.

[up to contents]



Add To Cart

SmithCart supports the following querystring operations to dynamically add items to your cart:

  • Adding a Single Product to the Cart
  • Adding a Product with Quantity to the Cart
  • Adding Multiple Products with Quantity to the Cart
  • Adding a Product with Variants to the Cart
  • Adding Product Variants with Quantities to the Cart
  • Adding Product Variants with User Entered Amounts to the Cart
  • Adding a Product to the Cart by Sku
  • Adding a Product with a Custom Field to the Cart
  • Passing a Coupon to the Cart
  • Adding a Product with Serial Number to the Cart
 

This feature will allow you to create your own separate listing page using an HTML module or add links on any other site to allow users to add Products to the Cart.

To find the URL to the cart page take the following steps:

  1. Navigate to the DNN page where the BuyNow module has been added.
  2. Click the Add To Cart or View Cart button.
  3. Copy the URL from the address bar.

[up to contents]



Single/Multiple Products

SmithCart supports adding products to your cart by passing the ProductID in the querystring.

Examples

Single Product: http://www.mydomain.com/Cart/Default.aspx?productid=1

Multiple Products: http://www.mydomain.com/Cart/Default.aspx?productid=1,2,3

When the ProductID is passed in the querystring the product(s) will be added to the Cart.

The Product ID for each Product in your store is listed on the Manage Products screen. For more information about Manage Products, please see the Manage Products KB article.

[up to contents]



Product and Quantity

SmithCart supports adding products with quantity to your cart by passing the ProductID and Quantity(qty) in the querystring.

When the ProductID and qty is passed in the querystring the product(s) and Quantity will be added to the Cart.

Examples

Single Product: http://www.mydomain.com/Cart/Default.aspx?productid=1&qty=2

Multi Product: http://www.mydomain.com/Cart/Default.aspx?ProductID=5,6,12,19,28&Qty=1,2,1,2,1

[up to contents]



Variants

SmithCart supports adding Products with Variants directly to your cart by adding Product ID and Variant ID in the querystring.

When the Product ID and Variant ID is passed in the querystring the product(s) and Variant(s) will be added to the Cart.

Examples

Single Product: http://www.mydomain.com/BuyNow/cart.aspx?Variants=1~3~5

Multi Product: http://www.mydomain.com/BuyNow/cart.aspx?Variants=1~3~5;14~34~35~38

With Quantity: http://www.mydomain.com/BuyNow/cart.aspx?Variants=1~2390;2~1&Qty=2,3

User Entered Amount: http://www.mydomain.com/BuyNow/cart.aspx?Variants=1~3&Price=50.00

The Product ID for each Product in your store is listed on the Manage Products screen. For more information about Manage Products, please see the Manage Products KB article.

The Variant ID for each Variant in your store is listed on the Manage Product Variants screen. For more information about Product Variants, please see the Product Variants KB article.

Please Note:

  • A semi colon is used to delimit Product IDs and the tilde is used to delimit Variant IDs. This format allows you to add multiple products and multiple variants and associate products with a specific set of variants.
  • In order to pass a user entered amount in the querystring you must have User Entered Amounts enabled in the product setup screen for the product you want to add.

[up to contents]



SKU

SmithCart supports adding products directly to your cart by passing the SKU in the querystring.

When a Product SKU is passed in the querystring to the cart page, the cart will look up the Product by SKU and add the Product to the cart.

Examples

Single Product: https://www.mydomain.com/BuyNow/cart.aspx?Sku=ABC123

With Quantity: https://www.mydomain.com/BuyNow/cart.aspx?Sku=ABC123&Qty=3

The Product SKU for each Product in your store is listed on the Manage Products screen. For more information about Manage Products, please see the Manage Products KB article.

[up to contents]



Serial Number

SmithCart supports adding products directly to your cart by passing the Serial Number in the querystring.

When a Product Serial Number is passed in the querystring to the cart page, the cart will look up the Product by Serial Number and add the Product to the cart.

The value you pass for serial number can be a license key or any string field generated from an external system. Upon successful order the serial number passed in the querystring is saved with the order detail record of the order and associated with a specific product ordered. After an order is completed the serial number is marked as Assigned so it is not used by another order and is viewable in the manage order detail screen.

Examples

By ProductID: http://www.mydomain.com/BuyNow/cart.aspx?ProductID=2&SerialNumber=123AE894582

By Sku: http://www.mydomain.com/BuyNow/cart.aspx?Sku=ABC123&SerialNumber=123AE894582

The Product Serial Number for each Product in your store is listed on the Product Serial Number Mangement screen. For more information about Product Serial Numbers, please see the Product Serial Numbers KB article.

[up to contents]



Custom Fields

SmithCart supports adding products directly to your cart by passing a Custom Field in the querystring.

Example

http://www.mydomain.com/BuyNow/cart.aspx?ProductID=1&tbfield=Project99

The tbfield passed in the url will be added to the end of the product name similar to how product variants are added to the cart. If the same base product is added to the cart but with different values in the tbfield, the products will show as separate products (line items) in the cart and invoice.

[up to contents]



Apply Coupon

SmithCart supports adding products directly to your cart and applying a Coupon by passing a Coupon Code in the querystring. All of the querystring operations described above also support passing a coupon code to the cart in the querystring.

When coupon code is passed, the cart will look up the coupon code and apply the appropriate discount you have defined. Coupon codes can apply to entire order or to a specific product.

Please Note:In order to pass a Coupon Code in the querystring you must have Show Coupons or Hide Coupons enabled in the Manage Coupons screen. For more information about Coupons, please see the Coupons KB article.

Examples

Single Product: http://www.mydomain.com/BuyNow/cart.aspx?ProductID=2&Coupon=50dollarsoff

Multi Product: http://www.mydomain.com/BuyNow/cart.aspx?ProductID=5,6&Coupon=50dollarsoff

Variants: http://www.mydomain.com/BuyNow/cart.aspx?Variants=1~3~5&Coupon=50dollarsoff

By Sku: http://www.mydomain.com/BuyNow/cart.aspx?Sku=ABC123&Coupon=50dollarsoff

[up to contents]



Product Details Page

The Product Details module supports the following querystring variables:

  • ProductID
  • ProductID and VariantID
  • ProductID and Multiple VariantID’s
  • Custom Textbox field (tbfield)

For more information on the Product Details module see the Product Detail Module KB article.

[up to contents]



Products and Variants

The Product Details module allows you to pass the Product ID in the querystring

When the Product ID is passed in the querystring the Products Details page will be loaded with the Product information associated with the Product ID passed in the querystring.

Examples

Product: http://www.yoursite.com/productdetails/Default.aspx?productid=1

With Variant: http://www.yoursite.com/productdetails/Default.aspx?productid=1&variantid=4

Multi Variant: http://www.yoursite.com/productdetails/Default.aspx?productid=1&variantid=4&variantid=7

[up to contents]



Custom Field

The product details page supports linking directly to the product details page by passing the product id and a custom textbox value in the querystring.

Passing the “tbfield” querystring will auto populate the product details page custom textbox field. To turn on the display of the product details page custom textbox field navigate to the product details module settings custom textbox field section and check the box titled Show Custom Textbox.

Next, you will need to go to the product setup screen and check the box titled “Show Custom Fields” to turn on the display of custom fields at the product level.

Example

http://www.yoursite.com/productdetails/Default.aspx?productid=1&tbfield=Project99

[up to contents]



Affiliate Tracking

SmithCart supports passing the AffiliateID in the querystring to any page in your portal that you have added the Smith Affiliate Tracking module to. For more information on the Smith Affiliate Tracking module see the Affiliate Tracking Module KB article.

When the affiliate id is passed in the querystring to your store and an order is successful, SmithCart will save the affiliate id with the order giving you the ability to track affiliate sales and pay out commissions.

Example

http://www.mydomain.com/Default.aspx?AffiliateId=27