Integrate PayPal links into your AppGini application
This tutorial will show you how to place paypal links into a table view generated by AppGini. Let's say that we have a table listing items for sale, like this one below.
We'll make some simple modifications so that it becomes like this:
Prepare the linksFirst of all, you need to log into your PayPal account, and prepare the payment links for your products. This tutorial would work fine with single item buy links, add-to-cart links, and subscription (regular payment) links. PayPal provides special HTML code for the link. Using a text editor, copy that code into an empty html file and give it a clear name (for example, "blue-doll.html"). Create a similar file for each payment link.
To avoid clutter, I'd recommend that you create a folder inside your AppGini application folder. This folder can have a name like "paypal" for example. We'll save all the html files containing the PayPal payment links into that folder.
Modify the table view templateThe next step is modifying the generated "templates/tablename_templateTV.html" (where tablename is the name of the table where you want to place the links). Open that file in a text editor. Find the line containing the placeholder for the field that you want to replace with the PayPal button (corresponding to the "buy" field in the example screenshots above). The code, as generated by AppGini, should be similar to this:
Change it to:
<iframe src="paypal/<%%VALUE(buy)%%>" frameborder="0" width="160" height="80"></iframe>
Remember to change "buy" above to the actual field name. You might also want to adjust the width and height values in the above code if the PayPal button doesn't display correctly.