0

How to add the Paypal checkout and Paypal credit button in the custom .phtml file?

I want to add the same as a mini cart/my cart PayPal button on the custom page.

0

Try this way

Created a link in .phtml file for Paypal Express:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$storeManager = $objectManager->get('\Magento\Store\Model\StoreManagerInterface');
$baseurl = $storeManager->getStore()->getBaseUrl();
$paypalexpress = $baseurl.'paypal/express/start/button/1/';

<div id="button">
    <a href="<?php echo $paypalexpress; ?>">
    <img id="btnPayPal" src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif">
    </a>
</div>
| improve this answer | |
  • I want to add the same as mini cart/my cart PayPal button on the custom page. Thanks – Masud Shaikh Feb 12 at 13:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.