I want to move Paypal express checkout button from the payment section to the top of the checkout page in Magento 2.
Move Paypal Express Checkout button to top of the checkout page in magento 2
1.2k views Asked by Aniket Prajapati At
2
There are 2 answers
0
Dhairya Shah
On
I have achieved by this way.
Custom/Module/view/frontend/layout/checkout_index_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="content">
<block class="Magento\Paypal\Block\Express\InContext\Minicart\SmartButton" name="checkout.right.logo" template="Custom_Module::express/in-context/shortcut/button.phtml" before="-">
</block>
</referenceContainer>
</body>
</page>
Custom/Module/view/frontend/templates/express/in-context/shortcut/button.phtml
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/**
* @var \Magento\Paypal\Block\Express\InContext\Minicart\SmartButton $block
*/
$widget = $this->helper(\Magento\Framework\Json\Helper\Data::class)->jsonDecode($block->getJsInitParams());
$widgetConfig = $this->helper(\Magento\Framework\Json\Helper\Data::class)->jsonEncode($widget['Magento_Paypal/js/in-context/button']);
?>
<div data-mage-init='{"Magento_Paypal/js/in-context/button":<?= /* @noEscape */ $widgetConfig ?>}'
class="paypal checkout paypal-logo paypal-express-in-context-mini-cart-container">
</div>
Related Questions in PAYPAL
- PayPal v2 invoicing API "INVALID_REQUEST" from incorrect amount fields
- laravel paypal ssl eror, package used srmklive / laravel-paypal
- When a PayPal subscription payment is successful, why do I see two transactions? One is $0, and the other one is a regular payment
- Wrong payment currency with Paypal in WooCommerce
- Storing completed payment information from the new 'Pay link or button' PayPal integration
- Can The HTML for the Pay Link Be Updated?
- Locating Existing APP ID for Adaptive Payments in PayPal Business Account
- How to Store PayPal Subscription ID in MongoDB After Payment?
- PayPal login integration refresh_token
- Title: Dynamically Adding Total Amount to PayPal Payment Button from Booking Webpage
- How can I send money to someone else's bank account linked to Paypal using Paypal API?
- PayPal Express Checkout - get PII / billing information from the PayPal account on payment
- Credit card fields showing under PayPal Express Checkout
- Error using PayPal subscription with Multiple Subscription buttons
- Simple Paypal button integration results in 404 error
Related Questions in MAGENTO2
- Force Magento 2's checkout accordion to be open on first step, closed on second step
- get list of items from sku magento 2 programatically
- Decrypting Magento 2 customer passwords using email for migration to Shopify
- Venia pwa + magento 2 categories and products issue
- Magretno 2 how to send the request of place order when user checked on the check box of terms and condtion
- Magento Rest Api Recaptcha Validation Failed Error
- How to change server Elasticsearch version?
- Difficulty installing Magento2
- problem to include fontawesome 6 on magento 2
- Mutagen copy multiple times project (4 copy of the same project)
- Magento 2 Bulk endpoint fails
- How to setdata of custom dynamicrows ui component from category_form.xml in magento 2
- setup:di:compile error after upgrading to Magento 2.4.6
- magento 2.4.6 styles overide issue
- Magento2 : How to add custom validation to the dynamic rows created using UI component
Related Questions in PAYMENT-GATEWAY
- Issue in payment form gateway
- how to integrate cashfree payment gateway in ruby on rails project
- i am geting value error while get cust id value from passing query in link which is in checkout file . I am using razorpay payment-gateway
- How to send Stripe session checkout parameters in subscription mode
- How can I change amount of payment-plan in flutterwave payment gateway?
- This operation is not allowed. Please contact Razorpay support for details. getting in transfers API (Live Mode)
- I'm encountering Error: [TypeError: Order.findOneAndUpdate is not a function] while updating the status [NextJS 14]
- I need help integrating Flutterwave into my React and express Node Application
- Can't get Woocommerce Payment Gateway Fees to be added upon checkout
- Inconsistency when trying to calculate the cost of proration in stripe
- Square payment gateway in e-commerce site
- Integrating CoinGate Payment Gateway in PHP Project: Including Payment Fees in Total Amount
- TillPayments Woocommerce plugin - how to show all payment gateways on Customer Payment Page
- Linking a registered customer to a payment subscription in a third-party service
- How to Detect Payment Completion Automatically in Wallet App
Related Questions in CHECKOUT
- Display a notice in WooCommerce checkout if a subscription item is in cart for an active subscriber
- How to test Creating and Cancelling Subscription in ThriveCart in Test Mode
- Google sheet inventory with check out
- Magretno 2 how to send the request of place order when user checked on the check box of terms and condtion
- Insert a custom button after WooCommerce Checkout Billing Address Field
- Increase WooCommerce Cart Total Weight Based On Specific Shipping Class
- Is there a way to display a custom message when the postal code entered is not covered by any shipping zone in woocommerce?
- Reorder Countries from WooCommerce Checkout country Select2 Dropdowns
- update checkout data in shopify using REST API
- I would like to hide the discount input field on our checkout page. Using checkout UI extensions
- Display the region name in WooCommerce admin order pages
- Save custom checkout field from shortcode in WooCommerce
- Checkout Page in Shopify
- Add ACF custom field in WooCommerce Checkout Form (Gutenberg Block)
- Woocommerce 8.6.1 checkout form hooks not fired
Related Questions in EXPRESS-CHECKOUT
- Shopify Automated Checkout Bot
- Remove the text from "woocommerce-notices-wrapper" at checkout page
- Issue with PayPal Recurring Payments Profile
- PayPal: Recurring Payments Profile not being created in Live
- stripe payment gateway problem in React Redux
- Express Checkout Customization in Hybris
- Migrating from API V1 to V2: How to getPaymentInstuctions after capture order?
- Migrating from checkout.js to JavaScript SDK, but authorising before executing the payment?
- Paypal paylater set button amount
- Paypal pay later not working when currency is GBP
- Paypal Array returning success message but payment not getting process i am using laravel and express-checkout
- Paypal javascript sdk - shipping address
- How to manage response from paypal when people pay as a guest checkout. No paypal account
- Order doesnt appear in admin panel shopify, but is registered in Paypal
- Move Paypal Express Checkout button to top of the checkout page in magento 2
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Magento's Paypal configuration has an option to display a PayPal shortcut on the "View cart" page, which is the main thing you should absolutely do. It enables people to add something to their cart, then click to go to PayPal and not have to type in all their address and payment information mangually into Magento, because it just gets pulled in from their Paypal account.
You can also display the same PayPal shortcut on each product page.