Topic: Product Management
Last Updated On: August 14, 2006
Applies to: MC Storefront Software, versions 4.0+

Summary

In v4.x MonsterCommerce includes the ability to use certain types of remote scripting. Remote scripting is very useful in places where you want to have static html pages with product images and the buy button as well as allow other sites to post to your store to purchase a product. Remote scripting can be used from any site on the web.

There are multiple ways to post this information back to a store. The 2 most widely used applications of Remote Scripting are outlined in this QuickGuide.


Things to Remember when using Remote Scripting

When using Remote Scripting to add a product to the cart of your MonsterCommerce store, there are a few things that must exist within the pages outside of the MonsterCommerce store. If the instructions in this QuickGuide are not followed, your customers will likely receive errors when trying to purchase a product.

The following are things to keep in mind when using Remote Scripting:

  • There is no validation of the product information when adding to the cart as there is when selecting a product from within the MC storefront
  • Before reporting bugs with remote scripting be sure to check the Remote Scripting post to ensure that all guidelines for a proper remote script post are being followed

Variables For Remote Scripting

ProdID

The ID of the product. This can only be for one product, you cannot use the same script for two different products.
Example: <input type="hidden" name= "ProdID" value="23">

intQty

The quantity to be purchased. This can only be a whole numerical value.
Example: <input type="hidden" name= "intQty" value="1">

Simple Link Method

The easiest way to use Remote Scripting is with a simple link. The Product ID and quantity to purchase are set by the Store Administrator and included within the link.

Storefront Appearance:

Click Here To Buy Product Widget

Code:

<a href="http://www.yourdomain.com/index.asp?PageAction=ADDPRODTOCART&ProdID=23&intQty=1" target="_blank">Click Here To Buy Product Widget</a>

If you wish to control which page loads after a remotely scripted item is added to the shopping cart, your link will need to be modified slightly.

Code:

<a href="http://www.yourdomain.com/index.asp?PageAction=ADDPRODTOCART&ProdID=23&intQty=1&
RemoteCaller=index.asp?PageAction=CARTDETAILS" target="_blank">
Click Here To Buy Product Widget</a>

Form Post Method

Form Posts are another way to use Remote Scripting. There are two common options for the Form Post method, including a method to let the customer determine the quantity of a product to purchase.

Form Post Option 1

Storefront Appearance:

Product Widget
Product Description: My Products Description Here
<buy button here>

Code:

<form method="POST" name="frmBuyProduct23" action="index.asp?PageAction=ADDPRODTOCART">
<p>
Product Widget</p>
<p>
Product Description: My Products Description Here</p>
<p><input type="submit" value="Click To Buy Product"></p>
<input type="hidden" name= "intQty" value="1">
<input type="hidden" name= "ProdID" value="23">
</form>

Form Post Option 2

Storefront Appearance:

Product Widget
Product Description: My Products Description Here
Qty To Order: <qty box>
<buy button here>

Code:

<form method="POST" name="frmBuyProduct23" action="index.asp?PageAction=ADDPRODTOCART">
<p>
Product Widget</p>
<p>
Product Description: My Products Description Here</p>
<p>
Qty To Order: <input type="text" name="intQty" size="3"></p>
<p><input type="submit" value="Click Here To Buy Product"></p>
<input type="hidden" name="ProdID" value="23">

To control the page that loads once the product is added, you will add this line to the bottom of your form:

Code:

<input type="hidden" name="RemoteCaller" value="index.asp?PageAction=CartDetails">

Top