First of all you'll have to add a PayPal button for each product you have on the page. To do so, please follow these steps.
- Login to your PayPal account.
- Go to ‘Profile’ tab.
- Select ‘My selling tools’ like in the example.
- Press the ‘create new button’ button like in the screenshot.
- Complete those 3 steps. Step 1, Step 2, Step 3 - just fill it so that it will cover your needs.
- Do the same thing for all your products.
- Later you'll need the PayPal's generated code, you can find it by clicking on the 'Action' button on the item, and later on the 'View code' button from the drop-down, please take a look at the screenshot.
- Open the ‘js/products/views/modalView.js’ file and replace the button with the generated code by PayPal like shown in the screenshot.
- Open the ‘js/products/models/itemModel.js’ and add ne property ‘paypal’ as shown in the screenshot.
- Open the ‘js/products/categories/bags.js’ file and set the id of your button in there like shown in the screenshot. Do the same for all your products.
There is one more thing. Considering that we have all our products linked to the PayPal's API we don't need the native Triablo's 'add to cart' functionality. So in order to isolate your web app from the native API you’ll need to hide the ‘cart’ and ‘quick add to cart’ buttons.
- Open your HTML file.
- Search for ‘shopping-cart’ and remove that block entirely, like shown in the screenshot.
- Open the ‘js/products/views/itemView.js’ file.
- Search for ‘add-product-code’ and remove the block entirely, like shown in the screenshot.