Magento 2 Payment Restrictions

 

Magento 2 Payment Restrictions extension developed by Meetanshi helps restricting payment methods based on various Product Attributes, Cart Attributes, Shipping Address, Store Views, and Customer Groups.

 

Table of Content

  1. Extension Installation Guide
  2. Payment Restriction Rules
  3. Add New Rule
  4. Set Payment Restriction Conditions
  5. Days & Time-Based Restriction

 

  1. Extension Installation
  • For Magento Marketplace Customers:

Find the extension’s Composer name and version in its composer.json file.

  • Login to your SSH and run:
    • composer require meetanshi/magento2-payment-restrictions
  • Enter your authentication keys. Your public key is your username; your private key is your password.
  • Wait for Composer to finish updating your project dependencies and make sure there aren’t any errors.
  • To verify that the extension is installed properly, run the command:
    • php bin/magento module:status Meetanshi_PaymentRestriction
  • By default, the extension is probably disabled. Enable the extension and clear static view files:
    • php bin/magento module:enable Meetanshi_PaymentRestriction --clear-static-content
    • php bin/magento setup:upgrade
    • For Magento version 2.0.x to 2.1.x - php bin/magento setup:static-content:deploy
    • For Magento version 2.2.x & above - php bin/magento setup:static-content:deploy –f
    • php bin/magento cache:flush
  • For Meetanshi Customers:
  • Extract the zip folder and upload our extension to the root of your Magento 2 directory via FTP.
  • Login to your SSH and run below commands step by step:
    • php bin/magento setup:upgrade
    • For Magento version 2.0.x to 2.1.x - php bin/magento setup:static-content:deploy
    • For Magento version 2.2.x & above - php bin/magento setup:static-content:deploy –f
    • php bin/magento cache:flush
  • That’s it.
  1. Payment Restrictions Rules
    The admin can create new rules to restrict payment methods based on business needs. Already created rules will be displayed in backend under Sales > Payment Restrictions.


 

  1. Add New Rule
    To add a new rule, login to Magento 2, move to Sales > Payment Restrictions, click “Add Rule” button. Here, you can find various settings for the payment restriction rule.
  • Rule Name: Define rule to recognize it easily.
  • Status: Activate the rule from the dropdown.
  • Payment Methods: Select payment methods from the list to restrict if the orders meet the condition.
  • Customer Groups: Select customer groups to restrict payment method for.
  • Store: Select stores to restrict payment method for.
  • For Admin: Set YES to apply the payment restriction rule in the backend as well.


 

  1. Set Payment Restriction Conditions
    The extension facilitates to set payment restriction conditions based on product attributes, cart attributes, shipping attributes, and customer attributes. Under the conditions tab, select various attributes and define the condition.


  

  1. Days & Time-Based Restriction
    The extension facilitates to set payment restriction condition based on specific days of the week and time. Move to the Days & Time tab to set such restriction.


  

Once the payment restriction rules are defined and enabled, the extension will restrict payment methods for the customers in frontend based on set conditions.

 

​​​​​​​