[solved] Paypal button works on one page not the homepage

I’m in the early stages of a new site. The embedded paypal button code worked on a previous site (now archived) and works on a subpage of the new site. But I’m not able to get the code to work on the homepage, where I really need it to show.

I’m wondering if it has something to do with the width of the container?

I’ve used the boilerplate webflow response for custom code and checked the client-id and the hostedButtonId against the sourcecode from paypal. All is fine there.

Here’s a link to the page where the code works
pp-button-test

Here’s the homepage where working code from above does Not work
Webflow - ver 3

Hi there,

The PayPal button isn’t visible in the Designer because custom code and scripts can only be rendered on published sites. When using script tags in the code editor, you’ll only see a placeholder while working in the Designer.

Your code is working correctly, as evidenced by your test page (pp-button-test) on the staging subdomain. To test any custom code implementations before going live, you can publish your site to the .webflow.io staging subdomain.

Hopefully this helps! If you still need assistance, please reply here so somebody from the community can help.

For anyone else that runs across this post or has a similar issue, I had a duplicate code embed on the page and didn’t realize it.

The paypal button uses a unique ID. With two of the same IDs on the page, only the first will be rendered. However, that first code embed was set to display: none; which effectively disabled the embed I was seeing and using.

“Simple Fix” remove the duplicate HTML elemment ID tag, and make sure the embed is set to be visible on the page.


Here’s the Direct PayPal link for more information

Shoutout to Juan from the webflow troubleshooting team for the answer to this issue!