Printer Friendly Version Print this thread
Email this thread to a friend eMail this thread to a friend
Featured Web Site Template

Hundreds More at Free Site Templates.com!

Web Site Partners
Sponsored Links
Jet City Software
 
Whos Here ?
Reflects user activity within the last 5 minutes
Moderator(s): g1smd
Member Message

mark_battista
Joined: Mar 07, 2006
# Posts: 31

View the profile for mark_battista Send mark_battista a private message

Posted: 2007-Nov-21 20:18
Edit Message Delete Message Reply to this message

Hi I run a rug retail website and we have a romancart checkout system installed that does everything we need however a lot of our rugs are available in custom sizes. What I need is some help to create maybe like a form type thing where a user enters the length and width of a rug that they require which then calculates length x width x cost per square metre to give them an actual price and then a button that they can press to add that rug code and price to the shopping cart. Help much appreciated, thanks in advance.




animated3d
Joined: Dec 22, 2005
# Posts: 444

View the profile for animated3d Send animated3d a private message

Posted: 2007-Nov-21 21:39
Edit Message Delete Message Reply to this message

you would need a cgi script on your site to make that calculation, maybe you can download it somewhere and adjust it to your needs or make one specifically for your own site, they are usually coded with perl,asp,php etc..



mark_battista
Joined: Mar 07, 2006
# Posts: 31

View the profile for mark_battista Send mark_battista a private message

Posted: 2007-Nov-21 21:44
Edit Message Delete Message Reply to this message

ok I have this, it works ok, the problem is I can't get it to submit the result to my shopping cart

<form action=http://www.romancart.com/cart.asp method=post>
<input type=hidden name=storeid value=16144>
<input type=hidden name=quantity value=1>
<tr>
<td valign=top bgcolor="#eeeeee" class="padded"><table border="0" cellspacing="0" cellpadding="0" class="choicebox" width="100%">
<tr>
<td align="center" width="50%" id="boxleft" name="boxleft" class="choiceoffleft">&nbsp;</td>
</tr>
</table>
<div name="custompricing" id="custompricing" class="TG_hidden">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="pricingbox"><script language="JavaScript" type="text/JavaScript">

<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"wink)>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function KW_getVal(o){ //v1.2
var retVal="0";if (o.type=="select-one"wink
{retVal=(o.selectedIndex==-1)?0:o.options[o.selectedIndex].value;}
else if (o.length>1){for (var i=0;i<o.length;i++) if (o.checked) retVal=o.value;
} else if (o.type=="checkbox"wink {retVal=(o.checked)?o.value:0;} else {
retVal=Number(o.value)}return parseFloat(retVal);
}

function KW_calcForm() { //v1.2
var str="",a=KW_calcForm.arguments; for (var i=3;i<a.length;i++)
str+=(a.indexOf("#"wink==-1)?a:KW_getVal(MM_findObj(a.substring(1)));
t=Math.round(a[1]*eval(str))/a[1];tS=t.toString();if(a[2]>0){tSp=tS.indexOf("."wink;
if(tSp==-1) tS+=".";tSp=tS.indexOf("."wink;while(tSp!=(tS.length-1-a[2])){tS+="0";
tSp=tS.indexOf("."wink;}} MM_findObj(a[0]).value=tS;
}
//-->

</script>
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td colspan="2"><p> Specify the size of the bespoke rug you wish to order below, then press the calculate button. </td>
</tr>

<tr>
<td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td nowrap>Width (cm)</td>
<td nowrap><input type=hidden name=catfactor value="135">
<input type=text size=5 name=rugwidth></td>
<td nowrap>Length (cm)&nbsp;&nbsp;&nbsp;&nbsp;
<input type=text size=5 name=ruglength>
&nbsp;&nbsp;&nbsp;
<input name="button" type="button" onClick="KW_calcForm('price',100,2,'(','(','#rugwidth','*','#ruglength',')','/','10000',')','*','135')" value="Calculate"></td>
</tr>
<tr>
<td nowrap>£ </td>
<td nowrap><input type=text size=5 name=price value="" disabled></td>
<td nowrap>&nbsp;</td>
</tr>
<tr>
<td align="left" nowrap colspan="3"><input type=submit value='Add to Basket'>
<input type=hidden name=productid value="1624">
<input type=hidden name=cat value="0">
</form>


You are not permitted to post messages in this forum or topic, because of one or more of the following reasons:
  1. You have not yet logged in, or registered properly as a member
  2. You are a member, but no longer have posting rights.
  3. This is a private forum, for which you do not have permissions.

If you are a recent member, it's possible that you simply have not yet confirmed your account. Please check your email for a message entitled 'JimWorld Forums: Confirm Your Account' and follow the instructions contained within.

If you cannot find this message, click here to Re-Send it.

If you are still experiencing problem, please read the Login Assistance Article for some advice on what may be causing your login not to work properly.

Switch to Advanced Editor and ... Create a New Topic or Reply to this Thread

New posts Forum is locked
© 1995  ·  iWeb, Inc  ·  DBA JimWorld Productions