Shopdaddy.com Web Services


 Adding Items to the Cart

Place links anywhere in your website that send requests to shopman.htm to add, set, delete, or review items in the cart. The content of the links may contain the following name/value pairs :

  • func=add|set|del indicates that item quantity should be incremented by one, set to a specified value, or set to zero.
  • code= specifies an SKU for the item
  • price= the price for the item
  • desc= the description of the item
  • quan= the quantity added or set
  • avail= equal to 1 if the maximum allowable ordered is one. If your site has primarily one-of-a-kind items, you can set the default avail for your site to 1 and not have to specify for each item. This would be done with funcArgs["avail"] = "1"; in shopman_head.js
  • lang=de|en|es|fr|it|pt|se
    Links to the cart can set the inital language being displayed. If the visitor changes their language preference, it over-rides subsequent links.
  • url= is the address of the page that displays the item and contains this "add to cart" link (ie. the order page). The description of each item, when displayed by the shopping cart manager (shopman.htm), is a text link back to the page specified by this argument. The customer can return to order pages by clicking the description of any ordered item.
  • url=no if no address (URL) will be supplied for link back to order page.

A complete link for an item might look like this

<a href="/sc/shopman.htm?
func=add&code=xt345b&price=245.00&desc=Custom+Item&quan=1
&avail=1&url=/pages/thispage.htm#customitem">
Add Custom Item</a>

If you would like to specify a hash location in the "url=" value for referback to a specific location on the page (like #customitem above), then "url=" must come last in the string of name/value pairs.

URL Encoding

If your descriptions or codes may contain other than alphanumeric characters, then remember to urlencode them. With PHP, use the "urlencode" function. With JavaScript, use the "escape" function.

If using the javascript "escape" function in your page, also string replace the "@" to "%40" for compatibility with future browsers.