Adding extra payment options in Paypal button

All WYSIWYG Web Builder support issues that are not covered in the forums below.
Forum rules
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
User avatar
BaconFries
 
 
Posts: 4713
Joined: Thu Aug 16, 2007 7:32 pm

Re: Adding extra payment options in Paypal button

Post by BaconFries » Fri Jul 26, 2019 12:02 am

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: 810
Joined: Mon Jan 20, 2014 8:17 am
Location: Australia
Contact:

Re: Adding extra payment options in Paypal button

Post by alex4orly » Fri Jul 26, 2019 12:17 am

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: 810
Joined: Mon Jan 20, 2014 8:17 am
Location: Australia
Contact:

Re: Adding extra payment options in Paypal button

Post by alex4orly » Fri Jul 26, 2019 3:59 am

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: 264
Joined: Sat Jul 08, 2017 5:02 am

Re: Adding extra payment options in Paypal button

Post by GrahamW » Fri Jul 26, 2019 5:21 am

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: 810
Joined: Mon Jan 20, 2014 8:17 am
Location: Australia
Contact:

Re: Adding extra payment options in Paypal button

Post by alex4orly » Fri Jul 26, 2019 5:54 am

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: 810
Joined: Mon Jan 20, 2014 8:17 am
Location: Australia
Contact:

Re: Adding extra payment options in Paypal button

Post by alex4orly » Fri Jul 26, 2019 12:22 pm

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