How do I add buy buttons to an existing website with ezimerchant?

It is quite easy to add buy buttons to an existing site using ezimerchant Professional if you have some basic HTML skills.

Just create the products in ezimerchant and generate, as you normally would if you were using ezimerchant to manage your website. This will create all of the javascript files required for managing the shopping cart contents.

Next, put the following into your existing site to make it work: Put the following in the head of every page where you want to add buy buttons:

<SCRIPT language="javascript" type="text/javascript" SRC="eziproducts.js"></SCRIPT>
<SCRIPT language="javascript" type="text/javascript" SRC="ezimpro400.js"></SCRIPT>
Copy the following files to your web server (you will find them in C:\Program Files\ezimercpro\Build[YOUR MERCHANT ID]:
eziproducts.js
eziinfo.js
ezimpro400.js
Every time you change your products in ezimerchant, you will need to publish eziproducts.js and eziinfo.js as these contain your product data including prices, weights, etc. Then for every product, you need to add a buy button and price block. This will then keep the price management in ezimerchant. The following code shows a basic form which will allow products to be added to the cart:
<form method="GET" action="viewcart.htm" name="form_1" onSubmit="if 
	(addProductToCart(this,'','This website does not accept fractional quantities. Please type in a whole number',
	'fracqtyerrmsg.htm') == false) return false ;">
	<input src= "images/[YOURBUYBUTTON].jpg" name="Buy [YOUR PRODUCT NAME]"  
		alt="Buy [YOUR PRODUCT NAME]" type="image" border ="0"><br>
      <b>QTY:</b><input type="text" name="qty" maxlength="15" size="5" value="1">
      <input type="hidden" name="pid" value="[PRODUCT ID FROM EZIMERCHANT]"> 
</form>
Put the following where you want the price to be placed:
<script>document.write(getProductPrice("$","\,",2,".",false, true, [PRODUCT ID FROM EZIMERCHANT],
	"inc GST within Australia","inc GST within Australia","International Orders",1,true));</script>
<script>document.write(getPriceInfo([PRODUCT ID FROM EZIMERCHANT],"inc GST within Australia",
	"inc GST within Australia","International Orders",1,true));</script>
The qty is optional. If you prefer not to have a quantity field, you can remove it - it is optional. With this done, all you need to do is replace eziinfo.js and eziproducts.js if you change the price, name, weight, tax setting and so on. The changes will automatically be reflected in the cart. The last thing you will need to do is create a view cart page with the following elements: In the head:
<SCRIPT language="javascript" type="text/javascript" SRC="eziinfo.js"></SCRIPT>
<SCRIPT language="javascript" type="text/javascript" SRC="eziproducts.js"></SCRIPT>
<SCRIPT language="javascript" type="text/javascript" SRC="ezimpro400.js"></SCRIPT>
To show the Domestic / International buttons (optional):
<SCRIPT> document.write(getDomesticButton(1));document.write(getInternationalButton(1));</SCRIPT>
If you do use this, you will need to put cartdomestic_off.gif, cartdomestic_on.gif, cartinternational_off.gif, cartinternational_on.gif. You will find these in the C:\Program Files\ezimercpro\Buildxxxx\images directory (or you can use your own - just keep the filenames the same). To display the cart insert the following code in the location where you want the cart to appear:
<script>
var ShowExTax = false;
var ShowIncTax = false;
var ShowTaxAmount = true;
var ShowTaxPercent = false;

var FontColor1 = '#FFFFFF';
var FontFace1 = 'Arial';
var FontSize1 = '2';
var BGColor1 = '#0000FF';
var FontStyle1 = '<B>';
var FontStyleEnd1 = '</B>';

var FontColor2 = '#000000';
var FontFace2 = 'Arial';
var FontSize2 = '2';
var BGColor2 = '#eeeeee';
var FontStyle2 = '<B>';
var FontStyleEnd2 = '</B>';

var FontColor3 = '#000000';
var FontFace3 = 'Arial';
var FontSize3 = '2';
var BGColor3 = '#bbbbbb';
var FontStyle3 = '<B>';
var FontStyleEnd3 = '</B>';
</script>

<form name=ordercart ACTION="https://secure.ezimerchant.com/gts0450/customerserver/cs_ProcessOrder.asp
	?merchantid=[YOUR MERCHANT ID]" 
	onsubmit="if (event.keyCode == 0 || event.which == 0 || !bProcessCart) return false;" method=post>
   
<script>document.open();

document.write(getCart("$","\,",2,".",false, true,false,false,false,true,1,FontFace1, FontSize1,BGColor1,
	FontColor1,Array("Quantity", "Product Name", "Product Code", "Price<br>(Ex.Tax)", "Tax Rate", 
	"Tax Amount", "Price<br>(Inc.Tax)", "Sub-Total"),FontFace3,FontSize3,BGColor3,FontColor3,FontFace2,
	FontSize2,BGColor2,FontColor2,"Tax Total","Sub-Total","Click here to remove this product from the cart.",
	"Your Shopping Cart is empty","Pro400_eziMerchPro","images",
	"This website does not accept fractional quantities. Please type in a whole number","fracqtyerrmsg.htm",""));

document.close();</script>

</form>
You can change the settings in the top script block to change colours, fonts or show/hide columns. If you make changes in the "Shopping Cart Settings" section of ezimerchant, the viewcart.htm file of your generated site will have an updated script block with your changes..

HAVE A QUESTION?

need an answer?

e-commerce FORUMS

DISCUSS

We get the THUMBS UP!

VIEW TESTIMONIALS

feeling insecure?

EZIGUARD