RL Joneson
08-18-2008, 04:39 PM
Not sure if i should have posted this in the MYSQL forum but here it goes.
I'm a designer by trade, but have recently started to train myself on backend stuff for sites. I'm not doing too bad either. I have a simple store I set up DWCS3 and had manually created each product description page for each item (:eek:)
After learning basics of record sets and using myphpadmin, i was able to set up a Users table for logging in, and an Events page that the admin can update, insert, and delete records on, once logged in. Works like a charm!
Now my goal is to tackle the product pages. I want to set up a dynamic page to display each product's information on, as well as an "Add to Cart" Paypal button.
The first part of this I'm confident in handling. I'll set up a table with an auto-inc id, product id, name, description, price, etc. And I will be using the Record Set tools in DWCS3 to add, retrieve, and display these with no trouble at all.
The problem I'm going to run into is how to dynamically create a Paypal button so that it is unique to the product displayed, with the correct product id and pricing.
As of now, I've been using WebAssist's "Add to Cart" extension that writes the code for me by having me input the details in it's GUI. It opens a new window and adds the item to the paypal cart on their remote site. More on the extension and paypals cart feature:
http://www.webassist.com/professional/products/productdetails.asp?PID=118
So by doing it this way, I could create fast product pages dynamically, but i would have to go back and add a custom "cart" button to each page. So what's the point right!?!?!
Here is the code that the PayPal extension plops in. I would like to set this up dynamically. Any help would be appreciated. But remember, i'm a designer just getting into backend stuff so go easy on me! ;)
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<table><tr><td><input type="hidden" name="on0" value="Size">
<span class="contact">Size</span></td>
<td><select name="os0" class="contact">
<option value="Small 4’7-5’3">Small 4’7-5’3<option value="Medium 5’2-5’10">Medium 5’2-5’10<option value="Large 5’10-6’6">Large 5’10-6’6</select>
</td></tr><tr><td><input type="hidden" name="on1" value="Color">
<span class="contact">Color</span></td>
<td><select name="os1" class="contact">
<option value="Royal Blue">Royal Blue<option value="Pink">Pink<option value="Blasted Black">Blasted Black<option value="Violet">Violet<option value="Red">Red<option value="Aqua">Aqua<option value="Forrest Green">Forrest Green<option value="Toxic Green">Toxic Green<option value="Lime Yellow">Lime Yellow</select>
</td></tr></table>
<br>
<input type="image" src="http://images.paypal.com/images/x-click-but22.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="info@prettyhurt.com">
<input type="hidden" name="item_name" value="Knight Crutches">
<input type="hidden" name="item_number" value="CLKNT016">
<input type="hidden" name="amount" value="170.00">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="return" value="http://prettyhurt.com/success.html">
<input type="hidden" name="cancel_return" value="http://prettyhurt.com/cancel.html">
<input type="hidden" name="logo_custom" value="http://images.paypal.com/images/x-click-but22.gif">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="bn" value="PP-ShopCartBF">
</form>
I'm a designer by trade, but have recently started to train myself on backend stuff for sites. I'm not doing too bad either. I have a simple store I set up DWCS3 and had manually created each product description page for each item (:eek:)
After learning basics of record sets and using myphpadmin, i was able to set up a Users table for logging in, and an Events page that the admin can update, insert, and delete records on, once logged in. Works like a charm!
Now my goal is to tackle the product pages. I want to set up a dynamic page to display each product's information on, as well as an "Add to Cart" Paypal button.
The first part of this I'm confident in handling. I'll set up a table with an auto-inc id, product id, name, description, price, etc. And I will be using the Record Set tools in DWCS3 to add, retrieve, and display these with no trouble at all.
The problem I'm going to run into is how to dynamically create a Paypal button so that it is unique to the product displayed, with the correct product id and pricing.
As of now, I've been using WebAssist's "Add to Cart" extension that writes the code for me by having me input the details in it's GUI. It opens a new window and adds the item to the paypal cart on their remote site. More on the extension and paypals cart feature:
http://www.webassist.com/professional/products/productdetails.asp?PID=118
So by doing it this way, I could create fast product pages dynamically, but i would have to go back and add a custom "cart" button to each page. So what's the point right!?!?!
Here is the code that the PayPal extension plops in. I would like to set this up dynamically. Any help would be appreciated. But remember, i'm a designer just getting into backend stuff so go easy on me! ;)
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<table><tr><td><input type="hidden" name="on0" value="Size">
<span class="contact">Size</span></td>
<td><select name="os0" class="contact">
<option value="Small 4’7-5’3">Small 4’7-5’3<option value="Medium 5’2-5’10">Medium 5’2-5’10<option value="Large 5’10-6’6">Large 5’10-6’6</select>
</td></tr><tr><td><input type="hidden" name="on1" value="Color">
<span class="contact">Color</span></td>
<td><select name="os1" class="contact">
<option value="Royal Blue">Royal Blue<option value="Pink">Pink<option value="Blasted Black">Blasted Black<option value="Violet">Violet<option value="Red">Red<option value="Aqua">Aqua<option value="Forrest Green">Forrest Green<option value="Toxic Green">Toxic Green<option value="Lime Yellow">Lime Yellow</select>
</td></tr></table>
<br>
<input type="image" src="http://images.paypal.com/images/x-click-but22.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="info@prettyhurt.com">
<input type="hidden" name="item_name" value="Knight Crutches">
<input type="hidden" name="item_number" value="CLKNT016">
<input type="hidden" name="amount" value="170.00">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="return" value="http://prettyhurt.com/success.html">
<input type="hidden" name="cancel_return" value="http://prettyhurt.com/cancel.html">
<input type="hidden" name="logo_custom" value="http://images.paypal.com/images/x-click-but22.gif">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="bn" value="PP-ShopCartBF">
</form>