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.
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:
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">
The quantity to be purchased. This can only be a whole numerical value.
Example: <input type="hidden" name= "intQty" value="1">
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.
Click Here To Buy Product Widget
<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.
<a href="http://www.yourdomain.com/index.asp?PageAction=ADDPRODTOCART&ProdID=23&intQty=1&Click Here To Buy Product
Widget
RemoteCaller=index.asp?PageAction=CARTDETAILS" target="_blank"></a>
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.
Product Widget
Product Description: My Products Description Here
<buy button here>
<form method="POST" name="frmBuyProduct23" action="index.asp?PageAction=ADDPRODTOCART">Product Widget
<p></p>Product Description: My Products Description Here
<p></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>
Product Widget
Product Description: My Products Description Here
Qty To Order: <qty box>
<buy button here>
<form method="POST" name="frmBuyProduct23" action="index.asp?PageAction=ADDPRODTOCART">Product Widget
<p></p>Product Description: My Products Description Here
<p></p>Qty To Order:
<p><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:
<input type="hidden" name="RemoteCaller" value="index.asp?PageAction=CartDetails">