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

Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR
Published June 7, 2025

Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR

I have Magento 2.4.4 running on Plesk CentOS Server. PHP 8.1 PHP FPM Enabled Varnish on Port 80 Nginx on Port 8080 […]

Windows key OEM (In bios etc) [closed]
Published September 12, 2025

Windows key OEM (In bios etc) [closed]

Another pc has come my way, and it all boots and runs, I did a clean install of Win 10 and got […]

Published July 11, 2025

URL Rewrites created automatically

I have a problem with large amount of URL rewrites being generated and the target path looks weird. We have more than […]

Adding a shortcut to a local HTML file in Ubuntu Chrome
Published June 7, 2022

Adding a shortcut to a local HTML file in Ubuntu Chrome

I have a local HTML file that I want to run as a Chrome application (that is, it opens in it’s own […]

Interesting

  • Windows Store Missing From Settings Apps
  • CUPS not printing PostScript, but I cannot find an error. Need help troubleshooting
  • UEFI Shell on boot after reinstalling system drive: no FSx: entries in map
  • How to prevent the 802.1x credentials dialog from constantly coming up on macOS with Ubiquiti MAC-based access control?
  • Why does my MySQL “source” command fail with long path name? [closed]
  • Prevent 802.1X credentials dialog on MacOS with Ubiquiti MAC-based control
  • Mysql source command fails with long path name [closed]
  • How do I log out of superuser.com website? I can’t find the LOGOUT anywhere [migrated]

Post navigation

  • Previous post How to write php unit test for a controller ? Magento 2
  • Back to post list
  • Next post How to show available data first then show the data respective to dropdown selection in Magento 2
——————-
  • Windows Store Missing From Settings Apps
  • CUPS not printing PostScript, but I cannot find an error. Need help troubleshooting
  • UEFI Shell on boot after reinstalling system drive: no FSx: entries in map
  • How to prevent the 802.1x credentials dialog from constantly coming up on macOS with Ubiquiti MAC-based access control?
  • Why does my MySQL “source” command fail with long path name? [closed]
——————-
  • 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

© 2026 Rubin Shrestha – All rights reserved

Powered by WP – Designed with the Customizr theme