Remember, you do not need to add custom scripts manually if you have successfully installed PayPal Pay in 4 Widgets. For more information, see Add PayPal Pay in 4 to your Web Store.
Follow the steps below to add the custom script:
-
In your Maropost Commerce control panel, navigate to Settings & tools > All settings & tools.
-
Search for and click on Custom Scripts.
-
Click the Add New button.
-
In the Name field enter PayPal Pay in 4
.
-
In the Key 1 field enter your PayPal client ID.
-
On the Page Header tab paste the below code:
<script
src="https://www.paypal.com/sdk/js?client-id=[@referral_key1@]¤cy=AUD&components=messages"
data-namespace="PayPalSDK">
</script>
-
On the Product Page (Under Buying Options) paste the below code:
<div
data-pp-message
data-pp-style-layout="text"
data-pp-style-logo-type="inline"
data-pp-style-text-color="black"
data-pp-amount="[%if [@inpromo@]%][@promo_price@][%else%][@store_price@][%/if%]">
</div>
-
On the Product Page (Under Description) paste the below code:
<div
data-pp-messagedata-pp-style-layout="text"
data-pp-style-logo-type="inline"
data-pp-style-text-color="black"
data-pp-amount="[%if [@inpromo@]%][@promo_price@][%else%][@store_price@][%/if%]">
</div>
-
On the Product Thumbnails paste the below code:
<div
data-pp-messagedata-pp-placement="product"
data-pp-style-text-size="10"
data-pp-amount="[%if [@inpromo@]%][@promo_price@][%else%][@store_price@][%/if%]">
</div>
-
On the Checkout (Call to Action) Cart Page paste the below code:
<div
data-pp-message
data-pp-placement="product"
data-pp-style-layout="flex"
data-pp-style-ratio="8x1"
data-pp-style-color="blue"
data-pp-amount="[@grand_total@]">
</div>
-
Click the Save button.
Note: Saving a custom script requires you to authenticate your access. Click the Send Token Now button and an email will be sent to you with a security token. Copy the token and paste it into the verification field. Click the Verify Token button and your changes can be saved. The token will last two hours in case you need to change multiple scripts.