Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Submit shopping cart via e-mail??? 1

Status
Not open for further replies.

Ladyborg

Programmer
May 11, 2002
208
0
0
US
I have built a shopping cart with the shopping cart extension with UD4. It is database-driven, but my clients are rather non-computer literate so rather than insert it into the database, I would like to just have the information e-mailed directly to them. I tried the e-mail script by Peacock Extension Suite, but it didn't work.

Any thoughts and help would be appreciated. Ladyborg
"Many of life's failures are people who did not realize how close they were to success when they gave up." [Thomas A. Edison]
 
[tt]
So, what's being stored in the database? nothing?
You may consider using the database at all costs.
[tt]"A Successful man is one who can build
a firm foundation with the bricks
that others throw at him"
[/tt]

banana.gif
rockband.gif
banana.gif
 
Tony,

The database contains all the information I need for the asp catalog pages, but since my client isn't computer knowledgeable (nor are any of his staff), the easiest thing would be for the cart contents to be e-mailed to him.

Any idea how that can be done? Ladyborg
"Many of life's failures are people who did not realize how close they were to success when they gave up." [Thomas A. Edison]
 
[tt]
When you say that you want to send them the shopping cart, what exactly are you refering to?

I'm assuming you're sending the results of the transcaction and since we know they are stored in the database, have them login and (if you're using cookies) redirect them to select whatever transcation they just processed and when they submit you pull the corresponding data for the transcation emailing it.

[tt]"A Successful man is one who can build
a firm foundation with the bricks
that others throw at him"
[/tt]

banana.gif
rockband.gif
banana.gif
 
Thanks, that's a good idea. I wasn't actually going to store them in the db since they weren't going to be able to access it themselves, but I like your idea.

I appreciate your help.
Thanks again. Ladyborg
"Many of life's failures are people who did not realize how close they were to success when they gave up." [Thomas A. Edison]
 
TonyU,
I have the exact same situation as Ladyborg, but obviously have less programming ability as her. Can please elaborate on

have them login and (if you're using cookies) redirect them to select whatever transcation they just processed and when they submit you pull the corresponding data for the transcation emailing it.

I can send the cart contents to a database but how can I set it up that store owner can receive the order information?

Thanks for your help I'm in real bind. I am currently submitting the cart contents by a cgi formamil script but of course the longer orders get cut off. I really need help. Thanks.

 
[tt]
Let's break it down a bit step by step...(in a nut shell)

Client\User(s) comes to site and registers in order to execute a transcation(s).

Obviously, in order to track these transactions one must insert into the database vital information not only about what the transcation entail but also the user.

Let's assume I come
Username = TonyU
Password = password

to your site and purchase something then I want the transcation to be email to me as ladyborg explained.

What I would do is:

[ul][li]Have the user login.[/li] [li]Provide them with a link to select all transactions only visible to them.[/li][li]Email information you already know.[/li][/ul]

The entire transcation will revolve around the transaction Number.

By the user logging in and you checking the username and password you already know whom he is and what transactions hi\she has made.

Then on the email processing page, all you'll be doing is
emailing all information from the table where the username and password and transaction number match

Hope it made sense...


[tt]"A Successful man is one who can build
a firm foundation with the bricks
that others throw at him"
[/tt]

banana.gif
rockband.gif
banana.gif
 
Tony U
Your time line of events for an order makes sense. But I guess I am looking for more specific (coding) help. The users that are using my site do not have to enter a usernam and password instead they fill all that info into a form at the time of checkout (once they have selected all that they want to buy). When they click to submit their order the contents of their cart is transferred to an Orders table where it is identified by a unique number. Ex 513.

I receive an email with all the persons info like name and address etc. and a hidden form field telling me their unique ID for the orders table is 513. How can I automate the process of pulling all the records with the ID 513 from the Orders table and have them emailed to me?

Am I doing this totally a$$ backwards? Or is it possible to do it as I have described?

I thank you very much for your help.
 
I don't see why you'd NEED a login necessarily - as long as you have some other way of knowing who placed the order by asking them for their e-mail address before submitting their order.

In your case, since you already have the items emailed to you, why can't you have the same information put into individual hidden fields (example one each for prodid, size, color, etc.) and have all THOSE hidden fields also included in the e-mail? That is what I wanted to do with my shopping cart, but so far I haven't been successful. I also created one additional hiddenfield which contained dashes or something like -----------> or "NEXT ITEM:", I thought I would use that to separate the cart items in the automated emails. It seemed possible with the PES email form extension I mentioned above, but didn't work for some reason.

I'm trying to get my own Order table function working, so far haven't been able to get the insert record to work. Once I do that, how do I set an automated e-mail letting you know an order was placed like the one you have? Ladyborg
"Many of life's failures are people who did not realize how close they were to success when they gave up." [Thomas A. Edison]
 
[tt]
Here's a coding sample of the email page you could use or give an idea on how to do it.

Create a recordset on your email page (this one)
only requesting data where id number = 513 (the variable number)

<%

Dim objMsg, strFrom, strTo, strSubject, strBody, lngImportance
strFrom = recordset(&quot;usernameemail&quot;)
strTo = &quot;you@isp.com&quot;
strSubject = &quot;Transaction record &quot; & recordset(&quot;id&quot;) etc
strBody = recordset(&quot;transaction&quot;) field

Set objMsg = Server.CreateObject(&quot;CDONTS.NewMail&quot;)

objMsg.From = strFrom
objMsg.To = strTo
objMsg.Subject = strSubject
objMsg.Body = strBody
'objMsg.Importance = lngImportance
'OBJmSG.AttachFile = strFile
objMsg.Send

Set objMsg = Nothing
%>

[tt]&quot;A Successful man is one who can build
a firm foundation with the bricks
that others throw at him&quot;
[/tt]

banana.gif
rockband.gif
banana.gif
 
AH HA Success finally. After many frustrating hours (days) it works. Below I will describe my trials and tribulations of making a Shopping Cart system with emailed orders work Using Power Climb's Ultra Dev Shopping Cart Addon. From the number of other questions I've seen about this product I figure that many other people are having this problem too.
I first built a shopping page and a cart page with the PowerClimb addon ( ). This is fairly straight forward and they have good help files. My problem came when I wanted people to be able to email me their orders from the cart page.

I had my order function working completly with a simple form that's action passed the collected data (name etc.) & the contents of the cart (dynamically created hidden form fields)to a premade CGI formmail script.
Here is the script to make a hidden field.
<INPUT TYPE=&quot;hidden&quot; NAME=&quot;ItemNum_<% =(UCCart1__i) %>&quot; VALUE=&quot;<%=(UCCart1.GetColumnValue(&quot;ProductID&quot;,UCCart1__i))%>&quot;>
But the problem was on larger orders (could be 2000 + characters) they were getting cut off in the email I would receive. Not sure if part of the form or the address line of the browser causes this, hopefully someone can enlighten me.

So I was finally able to contact my hosting company. They told me they used CDOSYS for their email server (first step towards success). They supplied me with a simple sample form that you can email a form using CDOSYS. The sample form has two parts (two asp pages). The first would be my cart page (cart.asp) I made. The second was the actual page that does the emailing(email.asp). I just made this my thank for your order page. On the email.asp page I also included a script block that is available from PowerClimb's website ( I edited mine as seen below). It pulls the the contents from the cart and saves them to one variable called CartData. It works with functions already included in the Ultra Dev Cart you download. I added in the html code like <br> so that it would display nicely in an email.

<% Dim CartData
UC_rowDelim = Chr(13) & Chr(10) & Chr(13) & Chr(10)
UC_colDelim = Chr(13) & Chr(10)
CartData = &quot;&quot;
for jRow=0 to UCCart1.GetItemCount() -1
if (jRow <> 0) Then CartData = CartData & UC_rowDelim
CartData = CartData & &quot;ID Num: &quot; & _
UCCart1.GetColumnValue(&quot;ProductID&quot;,jRow) & UC_colDelim & &quot;<br>&quot;
CartData = CartData & &quot;Plant name: &quot; & _
UCCart1.GetColumnValue(&quot;Name&quot;,jRow) & UC_colDelim & &quot;<br>&quot;
CartData = CartData & &quot;Quantity: &quot; & _
UCCart1.GetColumnValue(&quot;Quantity&quot;,jRow) & UC_colDelim & &quot;<br>&quot;
CartData = CartData & &quot;Price: $&quot; & _
UCCart1.GetColumnValue(&quot;Price&quot;,jRow) & UC_colDelim & &quot;<br>&quot;
CartData = CartData & &quot;Total: $&quot; & _
UCCart1.GetColumnValue(&quot;Total&quot;,jRow) & UC_colDelim & &quot;<p>&quot;

CartData = CartData & UC_rowDelim
Next
%>

I placed the CartData script block just before the CDOSYS code. which part of is seen below.

<%
'Gets values from form on previous cart page
Ffname=request(&quot;fname&quot;)
Flname=request(&quot;lname&quot;)
Faddress=request(&quot;addressl&quot;)
Fcity=request(&quot;city&quot;)
bodyofemail=CartData 'put cart contents into body of email

Set objConfiguration = CreateObject(&quot;CDO.Configuration&quot;)
Set objFields = objConfiguration.Fields
With objFields
.Item(cdoSendUsingMethod) = &quot;Talk to your Hosting Company&quot;
.Item(cdoSMTPServerPort) = &quot;Talk to your Hosting Company&quot;
.Item(cdoSMTPServer) = &quot;Talk to your Hosting Company&quot;

.Update
End With
Set objMessage = CreateObject(&quot;CDO.Message&quot;)
With objMessage
Set .Configuration = objConfiguration
.From = &quot;whoever&quot;
.To = &quot;your email address&quot;
.Bcc = &quot;anyone&quot;
.Subject = &quot;Test email&quot;

Below I combine all the person's info with the contents of their cart, I can add standard html to format the finished email.

.HTMLBody = &quot;<html><body>&quot; & Ffname &&quot; &quot; & Flname &&quot; <br> &quot; & Faddress &&quot; &quot; & Fcity &&quot; <br> The Following is their order: <br> &quot;& bodyofemail & &quot;</body></html>&quot;
.AutoGenerateTextBody = False
.TextBody = &quot;&quot;
.Send
End With
set objMessage =nothing
%>

P.S. there is more to the CDOSYS email script but it is best to contact your web hosting company for a sample script or there are lots of samples on Tektips for using CDONTS (very similar).

When this page is loaded the cart contents are automatically pulled along with their personal info and email to me or whoever. And all the user sees is a pretty thank you page. And because the cart values are created and sent on the same page there is no size limitation.

I hope this helps somebody. I may have yacked on here to long but if I could have found a message like this I would have saved many hours if not days. And forgive me if I have misqouted any technical things wrong, I am still very much an amatuer that is flying high on success.

TL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top