YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

Data driven coldfusion cart Options
Ms Reba
#1 Posted : Tuesday, September 23, 2003 1:21:04 AM
Rank: Starting Member

Groups: Registered

Joined: 9/23/2003
Posts: 10
Location: ,
I am potentially selling 100's of different items that are dynamically displayed from a database. How do I create the "Buy Now" buttons dynamically? It seems from what I have read that I need to create one button for each item. Can I pass hidden inputs that contain coldfusion variables to the PayPal check out and have an itemized list of items from the cart? I don't think I can as far as I can tell so I am trying to figure out how one can purchase multiple items and see the details once it reaches PayPal. Can anyone help me? Live well, laugh often, love much AND "Pay it forward"
Sponsor  
 
EliteWeaver
#2 Posted : Tuesday, September 23, 2003 1:43:43 AM
Rank: Starting Member

Groups: Registered

Joined: 10/22/2002
Posts: 239
Location: ,
Yes that's possible and if you already have a cart you can "upload" the contents directly to PayPal!

More info: https://www.paypal.com/c...ckout-outside#methodtwo

If not then you just need to develop your script to generate the appropriate "buy now" or "add to cart" buttons for each item.

Don't forget to look at IPN if you need to verify each sale after it has gone through!


Regards,
Marcus
Ms Reba
#3 Posted : Tuesday, September 23, 2003 1:07:29 PM
Rank: Starting Member

Groups: Registered

Joined: 9/23/2003
Posts: 10
Location: ,
Please bare with my ignorance. I do have a "cart". Once the client is finished shopping I want to pull the "items ordered" out of my database. With the following code, do I understand correctly that I am now "uploading" it to a database at PayPal?

<!---So if I add the extra input tags:--->
<form action="https://payapl.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1".
<input type="hidden" name="business" value="myaccount@domain.com">
<!---To:--->
<cfoutput query="getMyCart">
<input type="hidden" name="item_number" value="#Product_id#">
<input type="hidden" name="quantity" value="1">
<input type="hidden" name="item_name" value="#Product_id#">
<input type="hidden" name="amount" value="#Price#">
<input type="image" src="http://images.paypal.com/images/x-click-butcc.gif" name="submit">
</form>
</cfoutput>

If I am understanding this correctly, this will get me started in the right direction.






Live well, laugh often, love much AND "Pay it forward"
Ms Reba
#4 Posted : Tuesday, September 23, 2003 2:17:39 PM
Rank: Starting Member

Groups: Registered

Joined: 9/23/2003
Posts: 10
Location: ,
cont...
Once I pull the "ordered items" out of my database, do I need to use a <cfloop> of some kind? I guess I wish I could have the process explained to me step by step (server side and client side) in greater detail. I keep reading all these different forums and I am getting more confused. YIKES!

Live well, laugh often, love much AND "Pay it forward"
Ms Reba
#5 Posted : Tuesday, September 23, 2003 4:33:00 PM
Rank: Starting Member

Groups: Registered

Joined: 9/23/2003
Posts: 10
Location: ,
I think I'm making this harder than it should be. Let me ask this and I know this is stupid but:

Okay so I use hidden inputs and pass the order info using

<input type="hidden" name="amount" value="#TotalP#">

is it right to think that obviously PayPal can read the coldfusion variable #TotalP#? I was thinking that they had to have a .cfm file to read it. Or maybe they have code testing to see what file extension it is and then route it properly and then process the code? I guess I just need to understand what's going on.

Anymore comments greatly appreciated.

Live well, laugh often, love much AND "Pay it forward"
EliteWeaver
#6 Posted : Wednesday, September 24, 2003 6:52:10 AM
Rank: Starting Member

Groups: Registered

Joined: 10/22/2002
Posts: 239
Location: ,
Hi -

Yes you will need to "loop" the contents into your cart prior to uploading it to PayPal but you will need to display each item as so:

item_name_x, item_number_x, amount_x etc...

Where x = an incremental number starting from 1

Marcus
ress
#7 Posted : Tuesday, January 13, 2004 11:35:25 PM
Rank: Starting Member

Groups: Registered

Joined: 1/13/2004
Posts: 2
Location: ,
Searched the board and nothing on this.

I am using ColdFusion MX on my site and my problem is the following:



you have a page that is created dynamically from a database and SQL query which shows all the products within the database, let's call this the product page. When you click on one of the products titles or image, it takes you to a second dynamically constructed page with more specific info on that item, let's call this the detail page.

Now obviously, the "URL.recordid" is a big part of this whole thing to work so that the item selected from your products list is the right one to show up in the details page.

But when one creates a purchase button and/or shopping cart through paypal, they give you code such as the following -

Add to Cart Button

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<p>
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="fangear@fangear.ws">
<input type="hidden" name="item_name" value="Inhumanoids">
<input type="hidden" name="amount" value="20.00">
<input type="hidden" name="image_url" value="https://www.fangear.ws/FanGearImages/images/cartlogo.gif">
<input type="hidden" name="cn" value="Fellow Fan">
<input type="hidden" name="currency_code" value="USD">
<input type="image" src="http://www.fangear.ws/FanGearImages/images/getbutton.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="add" value="1">
</p>
</form>

and

View Cart Button

The HTML code below contains your "View Cart" button. Copy the code and paste it onto your webpage. When your customers press the button, they will be taken to a webpage listing the items they will purchase from you.

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="fangear@fangear.ws">
<input name="submit" type="image" src="FanGearImages/images/SubPagesCartButton.gif" alt="Make payments with PayPal - it's fast, free and secure!" width="58" height="31" border="0">
<input type="hidden" name="display" value="1">
</form>

When you look over the code, you realize that it can not be used with dynamically created pages. The code works if you physically placed a button for each item, i.e. . . . not dynamically created page.

How can I have the PayPal generated button notice what the dynamiclly selected product is so that when a customer adds it to his or her cart, it is the correct product??????????

Right now, no matter what item I select, the button places what I have manually typed in to it's hidden fields, . . . can that info be creatred dynamically?

any help.
salioto
#8 Posted : Wednesday, December 21, 2005 7:23:03 AM
Rank: Starting Member

Groups: Registered

Joined: 12/21/2005
Posts: 5
Location: ,
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by ress
[br]Searched the board and nothing on this.

I am using ColdFusion MX on my site and my problem is the following:



you have a page that is created dynamically from a database and SQL query which shows all the products within the database, let's call this the product page. When you click on one of the products titles or image, it takes you to a second dynamically constructed page with more specific info on that item, let's call this the detail page.

Now obviously, the "URL.recordid" is a big part of this whole thing to work so that the item selected from your products list is the right one to show up in the details page.

But when one creates a purchase button and/or shopping cart through paypal, they give you code such as the following -

Add to Cart Button

&lt;form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"&gt;
&lt;p&gt;
&lt;input type="hidden" name="cmd" value="_cart"&gt;
&lt;input type="hidden" name="business" value="fangear@fangear.ws"&gt;
&lt;input type="hidden" name="item_name" value="Inhumanoids"&gt;
&lt;input type="hidden" name="amount" value="20.00"&gt;
&lt;input type="hidden" name="image_url" value="https://www.fangear.ws/FanGearImages/images/cartlogo.gif"&gt;
&lt;input type="hidden" name="cn" value="Fellow Fan"&gt;
&lt;input type="hidden" name="currency_code" value="USD"&gt;
&lt;input type="image" src="http://www.fangear.ws/FanGearImages/images/getbutton.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"&gt;
&lt;input type="hidden" name="add" value="1"&gt;
&lt;/p&gt;
&lt;/form&gt;

and

View Cart Button

The HTML code below contains your "View Cart" button. Copy the code and paste it onto your webpage. When your customers press the button, they will be taken to a webpage listing the items they will purchase from you.

&lt;form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"&gt;
&lt;input type="hidden" name="cmd" value="_cart"&gt;
&lt;input type="hidden" name="business" value="fangear@fangear.ws"&gt;
&lt;input name="submit" type="image" src="FanGearImages/images/SubPagesCartButton.gif" alt="Make payments with PayPal - it's fast, free and secure!" width="58" height="31" border="0"&gt;
&lt;input type="hidden" name="display" value="1"&gt;
&lt;/form&gt;

When you look over the code, you realize that it can not be used with dynamically created pages. The code works if you physically placed a button for each item, i.e. . . . not dynamically created page.

How can I have the PayPal generated button notice what the dynamiclly selected product is so that when a customer adds it to his or her cart, it is the correct product??????????

Right now, no matter what item I select, the button places what I have manually typed in to it's hidden fields, . . . can that info be creatred dynamically?

any help.
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">
salioto
#9 Posted : Wednesday, December 21, 2005 7:28:13 AM
Rank: Starting Member

Groups: Registered

Joined: 12/21/2005
Posts: 5
Location: ,
Hi, does anyone have the answer to this? I've tried the Coldfusion script that PayPal provides, but it doesn't address the dynamic buttons and it seems designed to work with the "buy now" buttons instead of the "add to cart" buttons.

I saw an .ASP solution at paypalhacks.com, but I would love the Coldfusion version.

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by salioto
[br]<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Originally posted by ress
[br]Searched the board and nothing on this.

I am using ColdFusion MX on my site and my problem is the following:



you have a page that is created dynamically from a database and SQL query which shows all the products within the database, let's call this the product page. When you click on one of the products titles or image, it takes you to a second dynamically constructed page with more specific info on that item, let's call this the detail page.

Now obviously, the "URL.recordid" is a big part of this whole thing to work so that the item selected from your products list is the right one to show up in the details page.

But when one creates a purchase button and/or shopping cart through paypal, they give you code such as the following -

Add to Cart Button

&lt;form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"&gt;
&lt;p&gt;
&lt;input type="hidden" name="cmd" value="_cart"&gt;
&lt;input type="hidden" name="business" value="fangear@fangear.ws"&gt;
&lt;input type="hidden" name="item_name" value="Inhumanoids"&gt;
&lt;input type="hidden" name="amount" value="20.00"&gt;
&lt;input type="hidden" name="image_url" value="https://www.fangear.ws/FanGearImages/images/cartlogo.gif"&gt;
&lt;input type="hidden" name="cn" value="Fellow Fan"&gt;
&lt;input type="hidden" name="currency_code" value="USD"&gt;
&lt;input type="image" src="http://www.fangear.ws/FanGearImages/images/getbutton.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"&gt;
&lt;input type="hidden" name="add" value="1"&gt;
&lt;/p&gt;
&lt;/form&gt;

and

View Cart Button

The HTML code below contains your "View Cart" button. Copy the code and paste it onto your webpage. When your customers press the button, they will be taken to a webpage listing the items they will purchase from you.

&lt;form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"&gt;
&lt;input type="hidden" name="cmd" value="_cart"&gt;
&lt;input type="hidden" name="business" value="fangear@fangear.ws"&gt;
&lt;input name="submit" type="image" src="FanGearImages/images/SubPagesCartButton.gif" alt="Make payments with PayPal - it's fast, free and secure!" width="58" height="31" border="0"&gt;
&lt;input type="hidden" name="display" value="1"&gt;
&lt;/form&gt;

When you look over the code, you realize that it can not be used with dynamically created pages. The code works if you physically placed a button for each item, i.e. . . . not dynamically created page.

How can I have the PayPal generated button notice what the dynamiclly selected product is so that when a customer adds it to his or her cart, it is the correct product??????????

Right now, no matter what item I select, the button places what I have manually typed in to it's hidden fields, . . . can that info be creatred dynamically?

any help.
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">
golu
#10 Posted : Tuesday, June 23, 2009 9:32:52 AM
Rank: Starting Member

Groups: Registered

Joined: 6/23/2009
Posts: 2
Location: ,
is it right to think that obviously PayPal can read the coldfusion variable #TotalP#? I was thinking that they had to have a .cfm file to read it. Or maybe they have code testing to see what file extension it is and then route it properly and then process the code? I guess I just need to understand what's going on.Awesome. just awesome...i haven't any word to appreciate this post.....Really i am impressed from this
post....the person who create this post he is a great human..thanks for shared this with us.i found this informative and interesting blog.. <a href="http://www.betting-blackjack.net"> betting in blackjack</a>

http://www.betting-blackjack.net
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFVision Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.3 | YAF © 2003-2009, Yet Another Forum.NET
This page was generated in 0.563 seconds.