close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Payment solution

Thread began 6/23/2011 8:07 am by Paul | Last modified 2/27/2012 3:20 pm by Jason Byrnes | 3221 views | 12 replies |

PaulBeta Tester

Payment solution

Firstly, I wasnt sure where to post this question as i have both eCart and Payment Buttons extension.

I need some advice on the best product.
I have a paypal business account.

I need to build a payment page where logged in users select a credit package from a simple drop down, where each option has a different cost value.

html:
<select name="cred-option" id="cred-option">								        																        <option value="5.00">3</option>
<option value="8.00">7</option>
<option value="10.00">10</option>
<option value="12.50">15</option> </select>



then proceeds to purchase. No downloads of any description or carriage and tax etc required.

When a user selects an option to buy, I need the 'value' used in the payment transaction.

For example, if a logged in user selects option 7, they will need to pay GBP 8.00.

Both values need inserting into my transaction table thus;

the credit value 7 into the credit-qty field and the credit cost GBP 8.00 into the credit-cost field. I can sort any transaction id's and dates etc.

Any advise on simplest solution would be appreciated.

Thank you.

Sign in to reply to this post

Jason ByrnesWebAssist

use eCart for this.

create a new column in the cart object for credit option.

in the add to cart button, set the price column to be editable from a select list. set the credit option column to updateble from a hidden form element.

after the add to cart button is added and has created the select list and hidden element for you, populate the select list with the labels and values

Now, you will need to add an onChange event to the select list to populate the hidden form element with the selected label. make note of:
1) The form name
2) The select list name
3) the hidden element name

the onchange script will look like:

onChange="document.formName.hiddenElementName.value = document.formName.selectName[document.formName.selectName.selectedIndex].text"
Sign in to reply to this post

PaulBeta Tester

Thank you for quick response.
I shall attempt now.

Sign in to reply to this post

PaulBeta Tester

Jason,

I believe I followed the instructions, but fearful I may have missed something as the my buy option is not adding to cart.

I've attached the source file, any ideas?

Thanks,

Attached Files
buy-credit.zip
Sign in to reply to this post

Jason ByrnesWebAssist

the onchange code is not correct:

onchange="&quot;document.eCredit.eCredits_1_ID_Add.value = document.eCredit.eCredits_1_creditoption_Add[document.eCredit.eCredits_1_creditoption_Add.selectedIndex].text&quot;"




should be:

onchange="document.eCredits_1_ATC_<?php echo $row_CredOptions["cred_id"]; ?>.eCredits_1_creditoption_Add.value = document.eCredits_1_ATC_<?php echo $row_CredOptions["cred_id"]; ?>.eCredits_1_Price_Add[document.eCredits_1_ATC_<?php echo $row_CredOptions["cred_id"]; ?>.eCredits_1_Price_Add.selectedIndex].text"
Sign in to reply to this post

paul377172

I am trying something similar but it always returns the first value in the description field in the cart.

This is the code i applied to the onchange event onchange="document.domains_1_ATC_<?php echo $row_Recordset1["URLID"]; ?>.domains_1_Description_Add.value = document.domains_1_ATC_<?php echo $row_Recordset1["URLID"]; ?>.domains_1_Price_Add[document.domains_1_ATC_<?php echo $row_Recordset1["URLID"]; ?>domains_1_Price_Add.selectedIndex].text"

although it changes the quotes to &quot; in dreamweaver

Attached Files
domaindetails2.zip
Sign in to reply to this post

Jason ByrnesWebAssist

change:

php:
onChange="&quot;document.domains_1_ATC_<?php echo $row_Recordset1["URLID"]; ?>.domains_1_Description_Add.value = document.domains_1_ATC_<?php echo $row_Recordset1["URLID"]; ?>.domains_1_Price_Add[document.domains_1_ATC_<?php echo $row_Recordset1["URLID"]; ?>domains_1_Price_Add.selectedIndex].text&quot;"



to:

php:
onChange="document.domains_1_ATC_<?php echo $row_Recordset1["URLID"]; ?>.domains_1_Description_Add.value = document.domains_1_ATC_<?php echo $row_Recordset1["URLID"]; ?>.domains_1_Price_Add[document.domains_1_ATC_<?php echo $row_Recordset1["URLID"]; ?>domains_1_Price_Add.selectedIndex].text"
Sign in to reply to this post

paul377172

Thanks tried that but still doesnt work

Attached Files
domaindetails2.zip
Sign in to reply to this post

Jason ByrnesWebAssist

please post a link where i can see the problem in the browser

Sign in to reply to this post

paul377172

domaindetails2.php?URLID=4

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...