Question

PayPal HTML Widget Code Error


Badge

I have a PayPal subscribe button code I have pasted into an Elementor HTML widget, but it does not show up in preview or on the front-end.

I checked with PayPal customer service, we tested it on a button tester and it works there. So this button code seems to only not work in Elementor. I need to be able to set a time-limit for subscription payments which the Elementor PayPal button widget does not allow for. For example $99 for 10 months then payments stop.

I’ve tried creating a new button code within PayPal, also tried to add the code on another page, didn’t fix it.

When I paste the PayPal HTML code into the Elementor widget it shows: “named entity expected. Got none.” error.

Anyone else having this issue or know how to fix it? Any guidance or insight here is greatly appreciated!


10 replies

Userlevel 3
Badge +1

Can you post a link to the page where this is happening? If you can’t do that, please post the PayPal HTML as well as the source code for the page.

To get the source code, in Chrome, View → Developer → Source Code. Either save the file that’s opened as a text file and attache to your response message or just copy and paste the contents into your response message. 

Badge

This is the page it’s happening on: https://midwiferywisdom.com/retreat/

The PayPal subscribe buttons *should* be showing up at the bottom of the page under the text “Need a payment plan on the Full Midwifery Wisdom Experience? Contact us to set one up!” but before the email signup forms.

Thank you so much for any insight!

Userlevel 3
Badge +1

Ok so for starters, you’ve got some JavaScript errors occurring in what appears to be PayPal code. How did you set up all of the PayPal stuff in your theme? Is there a plugin (maybe a WooCommerce add-on?) that configures everything for accepting PayPal payments?

I can’t say for sure without seeing you backend, but it sounds/looks like the initial configuration is not correct which is causing the button code you pasted into the HTML widget to fail… and thus not display the button.

 

Can you give some idea as to how you set your site up for payPal? Was it all i plugins? Did you have to edit any code? Stuff like that….

Badge

Thanks for this insight! Paypal was connected through WooCommerce by signing in directly to the Paypal account from the website/WooCommerce dashboard, no WooCommerce add-ons are being used. The Paypal buttons do show up and working on the WooCommerce shop checkout page. But that’s separate from the copy/pasted subscription code for the page having issues.

Got the same issue here with a PayPal Smart Payment Button which I’m trying to show in elementor html widget.

 

Userlevel 6
Badge +3

Are u using something called zoid  ?

I don’t know nothing about Zoid. This is just the code that PayPal generates after you create your custom bottom and you should only copy and paste it in the HTML widget.

Badge

That’s the exact error I’m getting in the paypal code… not using Zoid either.

Userlevel 3
Badge +1

I created a CodePen with *just* the PayPal button script and it seems to be working - 

 

In the window above, click HTML (top left corner). The contents of that window should be exactly what you have in your HTML (or text) widget. Is it?

Userlevel 3
Badge +1

@Kristen Mantell - your error console is showing “zoid destroyed all components”. In Googling that phrase, it seems the error is produced when the PayPal script is loaded on the page more than once, which I can see *is* happening on your page. I don’t see any other PayPal buttons on your page, but I do see in the code that there are a few sections you’ve hidden using the Responsive controls in the Advanced tab.

Could any of these sections contain old PayPal button widgets you’re not using? Or an HTML widget with unused PayPal code? If so, remove the code/widget or the section entirely. This should at least clear up the errors in the console and *might* allow your buttons to display as they do on other pages without the extra PayPal script instances.

Does that make sense?

 

Also, “named entity expected. Got none.” error you’re seeing is due to the & in the URL to the PayPal script you’ve pasted in to the edit HTML window. To get rid of it, you can URLencode that URL:

https%3A%2F%2Fwww.paypal.com%2Fsdk%2Fjs%3Fclient-id%3DAf1hEpeJ09GpwGJhhwhXgLElR096kXVKtJU1ZcWEJ8pvkrVbfmJEZF1l5GwEsBDL-U3qnYC7S5tLEr4d%26vault%3Dtrue%26intent%3Dsubscription

 

THat’s not what’s causing your problem though.

Reply