Magento 2 get Payment Method from Quote


Magento 2 get Payment Method from Quote– We can get current Payment method that user selected on frontend from quote session. Let us understand how to get current payment method applied on cart in Magento2.


Magento 2 get Payment Method from Quote Session Example

You can get current payment method selected from quote using object manager simply as below-

Get Payment Method in Magento2 Example:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$cart = $objectManager->get('\Magento\Checkout\Model\Cart');

$quote = $cart->getQuote();
$paymentMethod = $quote->getPayment()->getMethod();

The above example will give you Payment Method that user selected during checkout on frontend.


Advertisements

Add Comment

📖 Read More