Skip to content
Rubin Shrestha
  • Rubin Shrestha
  • Profile
  • Blog
  • Nepali Typing
  • Contact
  • Search
Rubin Shrestha
  • Search
  • Rubin Shrestha
  • Profile
  • Blog
  • Nepali Typing
  • Contact
Home » Blog » Magento 2: Enable/Disable Payment methods based on product attribute value
Blog

Magento 2: Enable/Disable Payment methods based on product attribute value

by |Published May 19, 2022

I want to enable/disable the COD payment method based on product attribute. I tried this:
Disable Payment Method at Checkout in Magento 2 Based on Product Attribute

But I am having an issue when I have 2 products in cart where, cod value of one product is set to “yes” and another one set to “no”.
Any help will be appreciated.

  • Magento
  • Magento1
  • Magento2

You may also like

7 Things You Should Know Before Switching To Linux
Published February 20, 2022

7 Things You Should Know Before Switching To Linux

If you are reading this blog, you are most probably using Windows or Mac and looking to switch over. Linux is an […]

Published December 12, 2021

How to display name from custom attribute in product view page

Currently product name (title) is displayed from attribute name. How to display product name (title) from custom attribute second_name on product view […]

Smallest set covering intervals
Published March 22, 2023

Smallest set covering intervals

Given an array arr[] consisting of N ranges of the form [L, R], the task is to determine the size of the […]

Force SMB3 when possible?
Published December 17, 2019

Force SMB3 when possible?

Background I have an environment with 5000 or so workstations, 1000 or so servers. All of my file share servers are running […]

Interesting

  • Saving an extra checkout shipping address field in Magento 2.4.5
  • Magento 2: updateCustomerV2 graphQl
  • Combine MultiLanguage StoreView & main Language
  • Add a new filter in sort “Available for purchase” in magento 2.4.6
  • Suppress PowerShell prompts when executing script from standard input
  • What causes Windows Hello fingerprint and PIN data to be lost?
  • Unable to boot to Windows, says boot disk is unavailable after installing Ubuntu
  • Building GuestAdditions failed on guest RHEL9 due to read-only member ‘vm_flags’

Post navigation

  • Previous post How to write php unit test for a controller ? Magento 2
  • Back to post list
  • Next post Design pattern with examples magento2
——————-
  • Saving an extra checkout shipping address field in Magento 2.4.5
  • Magento 2: updateCustomerV2 graphQl
  • Combine MultiLanguage StoreView & main Language
  • Add a new filter in sort “Available for purchase” in magento 2.4.6
  • Suppress PowerShell prompts when executing script from standard input
——————-
  • Rubin Shrestha
  • Profile
  • Blog
  • Nepali Typing
  • Contact
——————-
  • Blog
  • Contact
  • Nepali Typing | Nepali Unicode | English to Nepali | English Conversion | English Translate | नेपाली to English | नेपाली टाईपिङ
  • Occasional Photography
    • The desert that everybody loves in pictures
  • Photography
  • Rubin Shrestha

© 2024 Rubin Shrestha – All rights reserved

Powered by WP – Designed with the Customizr theme