Click to See Complete Forum and Search --> : Altering Paypal Code


RobertF
05-29-2008, 03:07 PM
<!-- START ORDER TABLE 2 -->
<TABLE cellpadding="0" cellspacing="0" border="0" class="gallerytext"><tr><td valign="top">

<a href="javascript:ViewImage('gallery/eroticpinupartforsale/professional1withcopyrightlarge.jpg')"><img src="gallery/eroticpinupartforsale/professional1withcopyrightsmall.jpg" border="0" class="Galborder"></a><br>

<table cellpadding="0" cellspacing="0" border="0"><tr><td>

<!-- START PAYPAL FORM Renata Rae (Inverse) -->
<form target="paypal" method="post" action="https://www.paypal.com/cgi-bin/webscr" class="cartmargin">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="forbescreatives@hotmail.co.uk">
<input type="hidden" name="item_name" value="Product Renata Rae (inverse)">
<input type="hidden" name="amount" value="14.99">
<input type="hidden" name="return" value="http://www.forbescreatives.com/thanks-payment.htm">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="quantity" value="1">
<input type="hidden" name="add" value="1">



<!-- OPTIONS DELETE TO REMOVE -->
<input type="hidden" name="on0" value="Fantasy Erotic, Digital print of the 'Renata Rae' original painting">
<select name="os0" class="cartdropdown">
<option value="A2">A2 Size Poster</option>
<option value="A1">A1 Size Poster</option>
<option value="A0">A0 Size Poster</option>
</select><br>


I need the above code altered inorder to have the price change when an option is selected and the paypal button hit?

To have a better understanding of what i mean check my site below:

http://forbescreatives.com/pinuperoticartforsale.htm

Scroll to the second picture where you see a drop down list.

Nomatter what option the user chooses if they press the paypal button, it always shows the same price....How do i change the above code to get around the problem?

bluestartech
05-29-2008, 03:41 PM
you could use some javascript to change the price:

firstly add following to form tag:

name="paypal"

then in the dropdown:

<select name="dropdn" onchange="update_price();">
<option value="10">Cost $10</option>
</select>

then use script such as follows

<script>
function update_price() {

document.forms.paypal.amount.value = document.forms.cost_form.dropdn.value;
}
</script>

this is a rough and ready solution but the basics are here for what u need

RobertF
05-30-2008, 08:57 AM
I found this code....

<!-- THE FOLLOWING OPTION WILL CHANGE THE PRICE -->

<select name="amount" style="width:180px;font:9px;margin-top:4px">
<option value="24.99">A0 Digital Print £24.99</option>
<option value="19.99">A1 Digital Print £19.99</option>
<option value="14.99">A2 Digital Print £14.99</option>
</select><br>

From here
http://www.allwebco-templates.com/support/S_paypal_selection.htm

You can see it on my website...Look at the Renata Rae (inverse) drop down box.
http://forbescreatives.com/pinuperoticartforsale.htm

It works - the prices changes but their's a glitch! I can only use 3 options!!! Which is no good for me. If i add on more options then press the Add To Cart paypal button...It doesn't work...Only works when there is 3 options.

My problem is i need to have atleast 7 options. So when the user press's the drop down box - 7 price options become available instead of only 3!

Any ideas on how to get around this problem?

I never tried the above javascript code so i'm not sure if that would work!

What do you think?

I really need to get this figured out otherwise i may need to change my -For Sale- pages on my site!!!

Thanks

Robert

RobertF
05-30-2008, 10:10 AM
you could use some javascript to change the price:

firstly add following to form tag:

name="paypal"

then in the dropdown:

<select name="dropdn" onchange="update_price();">
<option value="10">Cost $10</option>
</select>

then use script such as follows

<script>
function update_price() {

document.forms.paypal.amount.value = document.forms.cost_form.dropdn.value;
}
</script>

this is a rough and ready solution but the basics are here for what u need


How do i add your code to my code in the first post?