A few years ago I created a test web site that included the files from this tutorial - PayPal Express Checkout with PHP by Sanwebe, although I only used it in Sandbox mode it seemed to work fine.
Recently, I decided to revisit the project, though this time around develop it using WordPress (Version 4.5.3), and ran into problems.
In the original site I put all the files into the root directory then kicked off the process by using -
<form method="post" action="process.php?paypal=checkout">
<input type="hidden" name="itemname" value="Product One" />
<input type="hidden" name="itemnumber" value="1" />
<input type="hidden" name="itemprice" value="1.50" />
<input type="hidden" name="itemQty" value="1" />
<input class="button medium green" type="submit" name="submitbutt" value="Download " />
</form>
in the product page. The action call to process.php?paypal=checkout
looked up the process.php file in the root folder and carried the paypal=checkout function, great.
However, using the same form in a WordPress product page fails, as it tries to find http://website.com/product/process.php?paypal=checkout rather than looking up the process.php file.
After spending a couple of weeks searching Stack Overflow and WordPress Support, as well as general web searches, I'm stuck.
So far I have tried -
- Including the files in the root directory as before - didn't work.
- Including the files in the theme directory as before - didn't work.
- Including the files in the child-theme directory as before - didn't work.
- Tried using get_template_part() - didn't work.
- Tried using include('path/to/folder/my_script.php');, include_once(), require()
- Tried using include (TEMPLATEPATH . '/mypage.php');
- Tried adding the process.php into both the theme and child-theme functions.php files
- I even tried creating a Plugin, but that also failed, maily because I'm rubbish.
Any assistance would be greatly appreciated.
Thanks
</div>