homepage Welcome to WebmasterWorld Guest from 54.204.215.209
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe and Support WebmasterWorld
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

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




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

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

 

tedster




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

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.

Paul




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

Sorry !.

I have corrected the url address now. Thank you.

www.sonyplaystation.fsnet.co.uk/product.htm

www.sonyplaystation.fsnet.co.uk/order.htm

tedster




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

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).

Paul




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

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 )
break;
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('</TABLE>');
document.write('<P>');

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('</SELECT>');
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('</SELECT>');
document.write('Tax: <INPUT TYPE="TEXT" NAME="tax" SIZE="7"><BR>');

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

document.write('<BR>');
document.write('</DIV>');
document.write('<CENTER>');
document.write('<P>');
document.write('<HR>');

//worldpay
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" >');

document.write('</FORM>');

Edited by: tedster

tedster




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

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.

Paul




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

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.

M_qty1=1
&M_price1=310.00
&M_ext1=310.00
&M_qty2=1
&M_price2=19.99
&M_ext2=19.99
&M_qty3=1
&M_price3=38.98
&M_ext3=38.98
&M_qty4=1
&M_price4=38.95
&M_ext4=38.95
&subtotal=407.92
&baseshipping=0
&M_shiptotal=0.00
&taxrate=0&tax=0.00
&grandtotal=407.92
&instId=22020
&cartId=1001
&amount=407.92
¤cy=GBP
&desc=Playstation+2+Products
&M_recipient=sales@sonyplaystation.fsnet.co.uk
&M_subject=Playstation+2+Products+Order
&submit=Secure+Payment+Checkout

[broke lines at each ampersand - tedster]

Edited by: tedster

tedster




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

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?

Paul




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

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 ?

tedster




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

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.

Paul




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

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

Paul

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved