Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

Emailing Shopping Cart Contents

Posted 18 Apr 2002 12:36:02
1
has voted
18 Apr 2002 12:36:02 justin coutange posted:
Hi all,

I'm having problems emailing the content of my shopping cart to myself (more accurately creating a string from the OrderItems in a shopping cart). I am using the Robert Paddock 'Place cart into a string' extension. (page 304 of the 'Friends of ED - Foundation Ultradev 4 book)

I am getting the error Object 'Mycart1' not found, or sometimes 'The page cannot be displayed' (depending on what I do to the code!!!)

Has anyone else had problems with this?

thanks for any help

Justin

Replies

Replied 18 Apr 2002 13:20:41
18 Apr 2002 13:20:41 justin coutange replied:
Think I've solved this now. I am using a cart named MyCart, which in the code creates

For MyCart1__i=0 to MyCart.getItemCount()-1...
etc

I modified the code that was created to be exactly like the book (i.e For UCCart1__i=0 to UCCart1.getItemcount()-1... etc)

and now it works! Looks like the extension is flawed. If you put the name of your cart in it won't work, unless your cart happens to be called UCCart!

oh well onwards to encrypting it all now...

Justin
Replied 25 Apr 2002 20:15:46
25 Apr 2002 20:15:46 Igor B replied:
I have a problem too. UCcart is up and running but I don't know how to mail the content of the cart to my emailaddress.

Do you how I can pull this of? (my server allows jmail and aspmail....don't know how to use it though)

Thanx

Replied 25 Apr 2002 22:47:51
25 Apr 2002 22:47:51 justin coutange replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
I have a problem too. UCcart is up and running but I don't know how to mail the content of the cart to my emailaddress.

Do you how I can pull this of? (my server allows jmail and aspmail....don't know how to use it though)

Thanx
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Okay, I did it by using the FoundationUltraDev extension available from friendsofed. That has a 'place cart into string function'. That basically puts all the cart items into a string, which is named mail_cart. (careful using the extension... see post above!)

Then I used aspemail to create an email where the mail.body = mail_cart.

For code example check out: www.aspemail.com/codesample.html

Okay you can go to town by including in the body data from a form and also stuff from RecordsSets i.e the order details (like date or ordertotal, which are stored in the db).

I put all aspemail code in an if statement:

<pre id=code><font face=courier size=2 id=code> If request(formfield) = &lt;&gt; then... send email </font id=code></pre id=code>
If the formfield is not empty (i.e someone has just finished entering the form) create and send the email.

The form just submits itself and after sending the email, redirects to a thankyou for ordering page.

I hope that helps. If you need more help I'll try and make it more detailed if you want...

I still haven't got the email encrypted though (cos I want to send credit card details with the order...) so aspemail might not be the best way of doing this. I'm going to have a look at aspencrypt...

Reply to this topic