Adding extra payment options in Paypal button

All WYSIWYG Web Builder support issues that are not covered in the forums below.
Forum rules
IMPORTANT NOTE!!

DO YOU HAVE A QUESTION OR PROBLEM AND WANT QUICK HELP?
THEN PLEASE SHARE A "DEMO" PROJECT.



PLEASE READ THE FORUM RULES BEFORE YOU POST:
http://www.wysiwygwebbuilder.com/forum/viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
Post Reply
iMatt
 
 
Posts: 96
Joined: Mon Nov 25, 2013 2:03 pm

Adding extra payment options in Paypal button

Post by iMatt »

Say I am creating two sizes of the same basic item. The standard size is £2 and the larger size is £3.50. Whilst this can be created easily enough using a form combobox, is there any way this can be reflected in Paypal? Because only one price seems to be allowed.
User avatar
Pablo
 
Posts: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Adding extra payment options in Paypal button

Post by Pablo »

There is an example for this in the Form Wizard.
iMatt
 
 
Posts: 96
Joined: Mon Nov 25, 2013 2:03 pm

Re: Adding extra payment options in Paypal button

Post by iMatt »

Okay. Can the form wizard be used with PayPal?
User avatar
Pablo
 
Posts: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Adding extra payment options in Paypal button

Post by Pablo »

The Form Wizard creates a standard form whihc is setup for PayPal, because PayPal buttons only support one price.
User avatar
BaconFries
 
 
Posts: 5328
Joined: Thu Aug 16, 2007 7:32 pm

Re: Adding extra payment options in Paypal button

Post by BaconFries »

Once you have you have installed the example you will notice that the combobox has two prices. On select of either and on submit/pay then that selection will be used and sent to PayPal for payment.
iMatt
 
 
Posts: 96
Joined: Mon Nov 25, 2013 2:03 pm

Re: Adding extra payment options in Paypal button

Post by iMatt »

okay, I have created a form using the form wizard. How do i get the 'add to cart' button to send info/submit to PayPal?
User avatar
Pablo
 
Posts: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Adding extra payment options in Paypal button

Post by Pablo »

The form wizard creates the complete form so there is no need for a separate PayPal button in that case.
The PayPal options can be configured via the 'hidden fields' of the form.
User avatar
alex4orly
 
 
Posts: 632
Joined: Mon Jan 20, 2014 8:17 am
Location: Australia
Contact:

Re: Adding extra payment options in Paypal button

Post by alex4orly »

I have created a membership / donations page for this organisation here :
https://communitylifestyleaccommodation ... modal.html
Click the accept to view the page

I tried engaging with a Payment Gateway service provider, but it is hard to deal with them.
I am considering switching to using PayPal instead.

So, the PAGE activates various payment options, but the one selected last is the one the visitor to the page wants to pay.
So, can I replace that "Pay Now" button with a PayPal button, or must I start again and create a form with the wizard?

Thanks
User avatar
Pablo
 
Posts: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Adding extra payment options in Paypal button

Post by Pablo »

You can modify the existing form, but for PayPal you will need to add the required hidden fields.
What you can do, is create a new form on another page and copy all the values manually.
User avatar
alex4orly
 
 
Posts: 632
Joined: Mon Jan 20, 2014 8:17 am
Location: Australia
Contact:

Re: Adding extra payment options in Paypal button

Post by alex4orly »

I created the button, it generated the following code, it takes me to the paypal page - but the amount 200 doesn't show up
Why?
Here is the code generated by the button:

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" id="PayPal1_form" method="post" target="PayPal">
<input type="hidden" name="business" value="alex4orly@gmail.com">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="item_name" value="Big Dog">
<input type="hidden" name="item_number" value="BG22">
<input type="hidden" name="amount" value="220">
<input type="hidden" name="currency_code" value="AUD">
<input type="hidden" name="shipping" value="">
<input type="hidden" name="shipping2" value="">
<input type="hidden" name="handling" value="">
<input type="hidden" name="return" value="www.cla-ltd.org">
<input type="hidden" name="cancel_return" value="www.cla-ltd.org/fault.html">
<input type="hidden" name="undefined_quantity" value="0">
<input type="hidden" name="receiver_email" value="alex4orly@gmail.com">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="no_note" value="1">
<input id="PayPal1" type="image" name="submit" src="mypictures/paynow.jpg" alt="Make payments with PayPal, it's fast, free, and secure!">
</form>
User avatar
Pablo
 
Posts: 21578
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Adding extra payment options in Paypal button

Post by Pablo »

The standard PayPal button does not show the amount. Only during checkout.
User avatar
alex4orly
 
 
Posts: 632
Joined: Mon Jan 20, 2014 8:17 am
Location: Australia
Contact:

Re: Adding extra payment options in Paypal button

Post by alex4orly »

I found the answer, if the script is in sandbox mode, it doesn't, but in Live it does - yes, at tha checkout stage
I just need to figure out how to set the "amount" element value dinamically (depending on the user choice) with Javascript function

Thanks
User avatar
alex4orly
 
 
Posts: 632
Joined: Mon Jan 20, 2014 8:17 am
Location: Australia
Contact:

Re: Adding extra payment options in Paypal button

Post by alex4orly »

I tried :

document.getElementByName("amount").innerHTML = topay;
But it doesn't work, it seems that "name" has been depracated

I would like to use:
document.getElementById("amount").innerHTML = topay;
But, the code generated by WWB doesn't show an ID for that field
<input type="hidden" name="amount" value="">

So?

Cheers
User avatar
BaconFries
 
 
Posts: 5328
Joined: Thu Aug 16, 2007 7:32 pm

Re: Adding extra payment options in Paypal button

Post by BaconFries »

But it doesn't work, it seems that "name" has been depracated
Alex, are you saying that "name" is depracated in PayPal forms?
But, the code generated by WWB doesn't show an ID for that field
<input type="hidden" name="amount" value="">
It isnt that WWB doesn't generate an "ID" PayPal hidden fields don't use it.
User avatar
alex4orly
 
 
Posts: 632
Joined: Mon Jan 20, 2014 8:17 am
Location: Australia
Contact:

Re: Adding extra payment options in Paypal button

Post by alex4orly »

But I need the idea to be able to assign a value to in real time, depending on what the visitor wants to pay.
According to the w3 school, name is deprecated...
I need the I'd.
How?
Cheers
User avatar
BaconFries
 
 
Posts: 5328
Joined: Thu Aug 16, 2007 7:32 pm

Re: Adding extra payment options in Paypal button

Post by BaconFries »

You have misread it, it is obsolete in HTML5 not deprecated. It is suggested to use "ID" in HTML5. On forms you should still use name="" to label your form controls. If you need to use "id" you will need to manually add yourself and use getElementById() rather than getElementByName()

Some useful reading regarding attributes:
https://developer.mozilla.org/en-US/doc ... Attributes
User avatar
alex4orly
 
 
Posts: 632
Joined: Mon Jan 20, 2014 8:17 am
Location: Australia
Contact:

Re: Adding extra payment options in Paypal button

Post by alex4orly »

I tried GetElementByName() - it didn't work
My alternative is to create a Pay Now button for each option - then I can hard code the amount
Please have a look here : https://communitylifestyleaccommodation ... modal.html
Click "Accept" to get to the page
User avatar
alex4orly
 
 
Posts: 632
Joined: Mon Jan 20, 2014 8:17 am
Location: Australia
Contact:

Re: Adding extra payment options in Paypal button

Post by alex4orly »

Is there a way for me to trap the Onclick PayPal button?
If there is, I could insert a call to a Javascrip function to assign the relevant price to the "amount" variable

Cheers
GrahamW
 
 
Posts: 240
Joined: Sat Jul 08, 2017 5:02 am

Re: Adding extra payment options in Paypal button

Post by GrahamW »

Hi Alex

have a look at my mals ecommerce extension for WWB it uses paypal as the payment gateway but there is quite a few options or styles you can set your page up with
Demo here:
https://www.shop.grahamscomputers.net/d ... sdemo.html
Purchase here:
https://shop.grahamscomputers.net/websh ... ite-1.html

Need any more info please just ask
Graham
User avatar
alex4orly
 
 
Posts: 632
Joined: Mon Jan 20, 2014 8:17 am
Location: Australia
Contact:

Re: Adding extra payment options in Paypal button

Post by alex4orly »

Hello Graham

Please have a look at the site I am working on here : https://communitylifestyleaccommodation ... modal.html
It DOES NOT need an actual shopping cart, just a link to Paypal Standard Payment page

Thanks
Alex
User avatar
alex4orly
 
 
Posts: 632
Joined: Mon Jan 20, 2014 8:17 am
Location: Australia
Contact:

Re: Adding extra payment options in Paypal button

Post by alex4orly »

I am trying to trap the pay button, here is the form code first:
<form action="https://www.paypal.com/cgi-bin/webscr" id="PayPal1_form" method="post" target="_self">
<input type="hidden" name="business" value="alex4orly@gmail.com">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="item_name" value="Big Dog">
<input type="hidden" name="item_number" value="BG22">
<input type="hidden" name="amount" value="">
<input type="hidden" name="currency_code" value="AUD">
<input type="hidden" name="shipping" value="">
<input type="hidden" name="shipping2" value="">
<input type="hidden" name="handling" value="">
<input type="hidden" name="return" value="www.anz.com">
<input type="hidden" name="cancel_return" value="anz.cba.com">
<input type="hidden" name="undefined_quantity" value="0">
<input type="hidden" name="receiver_email" value="alex4orly@gmail.com">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="no_note" value="1">
<input id="PayPal1" type="image" name="submit" src="mypictures/paynow.jpg" alt="Make payments with PayPal, it's fast, free, and secure!">
</form>

And now, inside the Body section I have the following:
<script>
document.getElementById("PayPal1").addEventListener("click", function(){
alert("Hello World");
});
</script>

But, the alert() doesn't show up.
I am trying to use this event to assign the value of the payment to the form "amount" variable....
Any other idea?
Whay this is not working?

Thanks
Post Reply