Welcome to WebmasterWorld Guest from

Forum Moderators: incrediBILL

Message Too Old, No Replies

Java script shopping cart

My shopping cart won't output the product title to the form



1:31 pm on Feb 11, 2001 (gmt 0)

10+ Year Member

Can anyone tell me how to make this cart output the title of the goods. The web address for the cart is www.sonyplaystation.fsnet.co.uk/product.htm

The problem is on the www.sonyplaystation.fsnet.co.uk/order.htm page.

The title is defined in the array but then not output in the form. I have tried to do it but it mucks-up the table. I have been testing by saving the product.htm page and the order.htm page to disk then changing the form action to mailto: self@self.com.

Please note the site is live!

Many thanks

Edited by: Paul


6:42 pm on Feb 11, 2001 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Hi Paul, and welcome to the forums at Webmaster World.

I can't access your pages using those URLs -- as they stand, I get "cannot locate server". If I add a .com, the browser finds the server, but gets a 404. Also tried changing to https: but no go.


7:58 pm on Feb 11, 2001 (gmt 0)

10+ Year Member

Sorry !.

I have corrected the url address now. Thank you.




8:21 pm on Feb 11, 2001 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

OK, got it now.

I want to understand you correctly. Is the problem you face that the Title of the Goods doesn't output at all, or that it does output, but the output fouls up your layout table?

I ask, because it worked fine for me (I tested the first item, the PS2 console).


8:33 pm on Feb 11, 2001 (gmt 0)

10+ Year Member

Thanks for your interest.

The problem is that when the FORM is submitted the data sent does not include the product 'title'. The price, quantity and grandtotal come through fine but as it stands I have to use a unique price inorder to identify which product has been ordered. The problem relating to the table has been that when I have tried to insert an 'input title' type of command this has shunted the other data out of the table.

Here is the FORM cut from the www.sonyplaystation.fsnet.co.uk/order.htm page.

document.write('<form method="POST" name="BigForm" action="https://select.worldpay.com/wcc/purchase">');

for( var i=1; i<maxLineItems; i++ ) {
var rawCookie = GetCookie( "sku"+i );
if( rawCookie == null )
document.write( "<tr><td>"+GetUserSKUFromSKU(GetSKUFromCookie(rawCookie))+"</td>" );
document.write( "<td>"+GetTitleFromSKU(GetSKUFromCookie(rawCookie))+"</td>" );
document.write( "<td><input name=\"M_qty"+i+"\" onChange='UpdateExt("+i+")' size=2 value="+GetM_QtyFromCookie(rawCookie)+"></td>" );
document.write( "<td>"+currency+"<input name=\"M_price"+i+"\" onChange='UpdateExt("+i+")' size=5 value=''></td>" );
document.write( "<td>"+currency+"<input name=\"M_ext"+i+"\" onChange='UpdateExt("+i+")' size=7 value=''></td>" );
document.write( "<td>" );
document.write( "<a href=\"javascript:RemoveFromCart('"+GetSKUFromCookie(rawCookie)+"');OrderLink()\"><img src=\"images/delete.gif\" border=\"0\"></a>" );
document.write( "</td></tr>" );


document.write('SubTotal: <INPUT TYPE="TEXT" NAME="subtotal" SIZE="7" onChange="ComputeSubtotals()"><BR>');

document.write('Delivery: <SELECT NAME="baseshipping" onChange="ComputeSubtotals()">');

document.write('<OPTION value="0">Free 3-5 Days</OPTION>');

document.write('<OPTION value="10">First Class 1-3 Days</OPTION>');

document.write('Delivery Total: <INPUT TYPE="TEXT" NAME="M_shiptotal" SIZE="7" onChange="ComputeSubtotals()"><BR>');

document.write('Tax Rate: <SELECT NAME="taxrate" onChange="ComputeSubtotals()">');

document.write('<OPTION value="0">V.A.T.</OPTION>');

document.write('Tax: <INPUT TYPE="TEXT" NAME="tax" SIZE="7"><BR>');

document.write('Grand Total: <INPUT TYPE="TEXT" NAME="grandtotal" SIZE="9">');


document.write('<INPUT TYPE="HIDDEN" NAME="instId" value="22020">');

document.write('<INPUT TYPE="HIDDEN" NAME="cartId" value="1001">');
document.write('<INPUT TYPE="HIDDEN" NAME="amount" value="amount">');
document.write('<INPUT TYPE="HIDDEN" NAME="currency" value="GBP">');
document.write('<INPUT TYPE="HIDDEN" NAME="desc" value="Playstation 2 Products">');
document.write('<INPUT TYPE="HIDDEN" NAME="M_recipient" value="sales@sonyplaystation.fsnet.co.uk">');
document.write('<INPUT TYPE="HIDDEN" NAME="M_subject" value="Playstation 2 Products Order">');

document.write('<INPUT TYPE="submit" NAME="submit" value="Secure Payment Checkout" >');


Edited by: tedster


8:55 pm on Feb 11, 2001 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Paul, in your order page's code, the javascript takes care of writing the Product Name to the page, but I can't see any place in the code that it also gets declared as a value to be submitted when the form is submitted.


9:03 pm on Feb 11, 2001 (gmt 0)

10+ Year Member

Yes this is it ! I don't no how to do this. I guess it needs to be done within the loop which I guess is defined at the top of the form.

Here is the data I get if several items are currently ordered.


[broke lines at each ampersand - tedster]

Edited by: tedster


10:07 pm on Feb 11, 2001 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

I notice that the script you are using shows a copyright holder. I'd suggest going to the source for specific advice. One way or another, it looks like you are missing a line or two of code.

The thing is, without pulling this code apart totally, I'd be wary of introducing some kind of conflict. The value you need to pass on was in the cookie, and it was retrived by the javascript function GetSKUFromCookie. Now it needs to be written into the form.

I also noticed a comment at the top which talks about using WebDNA to fill in product information. Maybe that's a clue?


7:56 am on Feb 12, 2001 (gmt 0)

10+ Year Member

I have been back to the makers of the code/program but they only provide an auto responce e-mail which does not help at all and just suggests buying their $6,000 program. This is a big jump from the $50 I paid for this program taking into account I only need a small modification.

I do not know what webDNA is. Do you think this is an editing tool ?


12:15 am on Feb 13, 2001 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Sending the name and/or the SKU of the product is not a small modification -- it's a basic shopping cart function, IMO, and the code you have doesn't do it.

I'd get on them as best you can -- they should make good on your modest investment.

One last thought -- maybe go back to your original code, the way they provided it, and just make sure that something didn't get lost somewhere while you were setting things up? Seems like this functionality just has to be there.


6:54 pm on Feb 13, 2001 (gmt 0)

10+ Year Member

I have been back to the original code and the 'title' is still missing. I think this product came with a feature many other products now include. It's called 'built in obsolescence'

Thanks for taking a look. I think if my shop goes o.k. over the next month I will invest in a better cart. I have heard good things about 'Actinic Catalog 4' at www.actinic.co.uk

Thanks again



Featured Threads

Hot Threads This Week

Hot Threads This Month