• Resolved David Borrink

    (@davidborrink)


    I’m developing a commerce site where my client wants a PayPal button placed in the page. When I place the PayPal button code in a page or a post it gets messed/deleted in the visual editor, and has errors when used in “code” with the visual editor turned off.

    I’m installed runPHP to allow PHP code to be executed. I place the PayPal code in a document called ‘paypalbutton.php’ and place it in my theme folder. Then on the page/post where my client wants them placed, I put the following code in:

    <?php include(‘paypalbutton.php’); ?>

    And I get error messages about line numbers and such.

    Here’s where I’m wondering if I’m a newbie-error-guy. Can I place the PayPal script inside the .php file just as I get it from PayPal, or do I need to add some php tags around it in the file?

    To explain one other bit of info: I’ve removed the post “loop” from index.php to create a static page for a front page. That’s one location they want the button. The other is on a page template. These are all static pages, but I have a post page using a modified index.php to act like a static page but without sidebars.

    Any ideas or tips about my .php file usage?

Viewing 2 replies - 16 through 17 (of 17 total)
  • What a great feeling is that “YESS!!!!!”, isn’t it?

    I having been following these instructions and also got my PayPal button to work. Thanks Harknell!

    However, I would like to add some info regarding the line breaks at the end. It seems that the line breaks are provided by PayPal’s code. So, when pasting their code into the AWSOM editor, go to the end and make sure that the ‘—–“></form>’ is all on one line. Does this make sense?

    One thing I’ve discovered is that many of these button things that Paypal and other sites give you are often filled with extra characters or incorrect code. So it can often glitch when input into an editor. It’s less likely to glitch though if you use the code editor instead of the visual editor.

    I’m really glad you guys have all been able to get this to work. You’ll be happy to know that the next version of the AWSOM News Announcement plugin will support multiple announcement areas, so you can use it to plug buttons and other stuff all over the place.

Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘runPHP plugin used to add a PayPal button to a page or post’ is closed to new replies.