Back to Top

Magento 2 Payment Shipping Restrictions

Updated 26 August 2024

Using Magento 2 Payment Restrictions and Shipping module, the admin can assign the shipping and payment methods to products and the categories.

Sometimes the admin wants to restrict a few of the shipping and payment methods for some products and category types.

So, instead of completely disabling the shipping and payment methods for the store, restrict the shipping and payments methods which the admin doesn’t wish to use for particular products and categories.

During the checkout process, the customer can view the assigned shipping and payment methods to place an order.

Note:

Searching for an experienced
Magento 2 Company ?
Find out More
  •  The extension will not create any new shipping and payment methods for you.
  •  The module functionality will not work for the order created from the admin panel.

Wonder How Magento 2 Payment Restriction & Shipping Restriction Works? Watch the below Video

Nc5Hx5mFMpQ

Features of Adobe Commerce Payment and Shipping Restriction

  • The admin can enable or disable the module as per convenience.
  • Assign specific shipping methods to a product.
  • Assign specific payment methods to a product.
  • Restrict the payment and shipping methods for the product types – Simple, Configurable, Virtual and downloadable.
  • Assign specific shipping methods to product categories.
  • Assign specific Magento 2 payment methods to product categories.
  • The admin can map the shipping and payment methods.
  • Assign different shipping and payment methods to various products and category types.
  • Only assigned shipping and payment methods available while checkout.
  • Restrict the shipping and payment for the products and categories which were existing before the installation of this module by editing them again.
  • This Module is compatible with GraphQl. 

Installation

Customers will get a zip folder and they have to extract the contents of this zip folder on their system. The extracted folder has an src folder, inside the src folder you have the app folder.

You need to transfer this app folder into the Magento2 root directory on the server as shown below.

INSTALLATION

After the successful installation, you have to run these commands in the Magento 2 (Adobe Commerce) root directory.

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
php bin/magento indexer:reindex
php bin/magento cache:flush

Multi-Lingual Configuration

For Multilingual support, please navigate to Store>Configuration>General >Locale Options. And select your desired language from the Locale option.

locale

Module Configuration

After the module installation, the admin can configure the module settings by navigating to the Stores -> Settings -> Configuration -> Webkul -> Shipping and Payment Restriction as shown below.

enable extension

Here, the admin will:

  • Enable Module on Frontend – Set the option to Yes if want to display the restricted shipping and payment methods only on the frontend.
  • Else set the option to No if want to display all the shipping and payment methods.

And, lastly hit the Save Config button to save the configuration successfully.

Category – Assign Shipping & Payment Methods

The admin can restrict the different payment and shipping methods for each category as shown below.

category payment and shipping restriction

On the category edit page, the admin will have two fields:

  • Select Shipping Method- Choose the shipping methods wants to enable for that particular category.
  • Select Payment Method- Choose the payment methods wants to enable for that particular category.

And, lastly hit the Save button to save the category successfully.

Note:
  • The admin needs to configure the payment and shipping methods for each category individually.
  • Further, the admin can configure the different payment and shipping methods for the parent and the child category.
  • The admin can also restrict the shipping and payment for the categories which were existing before the installation of this module.

Product – Assign Shipping & Payment Methods

The admin can even restrict the different payment and shipping methods for each product as shown below.

product payment and shipping restriction

On the product edit page, the admin will have two fields:

  • Select Shipping- Choose the shipping methods wants to enable for that particular product.
  • Select Payment- Choose the payment methods wants to enable for that particular product.

And, lastly hit the Save button to save the product successfully.

Note:
  • The admin needs to configure the payment and shipping methods for each product individually.
  • The admin can restrict the payment and shipping methods for the product types – Simple, Configurable, Virtual and downloadable.
  • Moreover, the admin can restrict the shipping and payment for the products which were existing before the installation of this module.
  • The Mapped shipping and payment method should be selected else there will be no payment method displayed for the mapped shipping selected.

Payment Shipping Mapping

The admin can map the payment method with the shipping methods by navigating to payment shipping mapping section and the following mapping list will be displayed as shown in the image below.

manage payment and shipping mapping

The admin can create new mapping from the Add Mapping section and select the desired shipping method and payment method that is needed to be saved as shown in the image below.

edit payment and shipping mapping

Front-End

Now at the front-end, the customer can view the restricted shipping and payment methods while placing the order. On the cart page, the customer can view the enabled shipping methods only.

cart

And accordingly, the customer will select the shipping method when proceeding further.

shipping

While making the payment, the customer can choose the payment method from the enabled ones only.

payment

The module allows shipping and payment method restriction on the product and on the category.

Note:
  • If the admin has not restricted any shipping and payment methods on products then, the control will automatically check for restriction on the category of that product.
  • If no restriction is applied to the category as well, in that case, all the active shipping and payment methods will be available at checkout.
  • The module supports CheckOut with Multiple Address as well.
Case 1: What if a single product in the cart belongs to multiple categories?

The shipping and payment restriction made on the product has a higher priority than that of categories. So, in this case, firstly it would check the shipping and payment method assigned to the product.

If not assigned, then it will automatically check for restriction on the categories of that product and does the union of payment and shipping methods of the multiple categories.

Union of shipping and payment methods will be displayed at the checkout page.

Case 2: What if the shopping cart has multiple products (each product belongs to multiple categories) with different shipping and payment method enabled?

The shipping and payment restriction made on the product has a higher priority than that of categories.

So, in this case, firstly it would check the common payment and shipping methods among the multiple products in the cart and accordingly will display them at the checkout.

If no shipping & payment method assigned to products then it will automatically check for shipping & payment method restriction on the categories.

For each product, it does the union of payment and shipping methods of the categories it belongs to.

Secondly, will check the common payment and shipping methods among the multiple union sets created for each product.

And those common shipping and payment methods will be displayed at the checkout page.

Case 3: What if the enabled shipping and payment methods don’t work for the location from where the customer is placing the order?

In this case, it first checks the shipping and payment method assigned to the product based on the customer’s location and accordingly displays them at checkout.

If for a product, restricted shipping and payment method is not applicable as per the customer’s location, then, the shipping and payment method restriction of the category will be displayed.

If the shipping & payment restriction is applicable to a product, then, payment and shipping restriction is never applicable to that category based product. Let us understand this through an example which is given below.

For instance, there is a product named Product-1 which needs to be shipped to New York and Germany.

The shipping and payment method mapping is defined for Product-1 is USPS and COD, respectively. One can see that the USPS shipping shall be applicable to Product-1 which needs to be shipped to New York.

At the same time, if the same product, Product-1 is to be shipped to Germany. Moreover, if by any chance, the USPS shipping is not applicable.

There will be no shipping and payment methods applicable for the location Germany on the checkout page.

Case 4: What if two or more products are added in the cart, each having separate shipping & payment methods mapped on it?

Let’s suppose there are two product X and product Y. For the product X, enabled shipping methods are (Free shipping, Table rate & Flat rate ) and (Check/Money Order, Bank Transfer Payment & Cash on Delivery ) are its selected payment methods.

Whereas for the product, Y (Flat rate and Free shipping) are the enabled shipping methods and (Check/Money Order, Bank Transfer Payment, Cash on Delivery & PayPal Billing Agreement ) are its selected payment methods.

Additionally in the backend Free shipping has been mapped with COD.

As a result, when a customer for an instance add these two products X and Y into his shopping cart only the shipping rates which are commonly present for both the products will be visible to the customer, in this case, (Flat rate and Free shipping).

Further, consider that the customer opted for Free shipping since it is originally mapped with the COD. Therefore only cash on delivery will be visible to the customer.

If the customer picks Fixed rate shipping and note since we haven’t mapped this with any of the payment methods.

Therefore, here all the common payment methods will be visible to the customer. Which are (Check/Money Order, Bank Transfer Payment & Cash on Delivery ) for this case.

That’s all for the Magento 2 (Adobe Commerce) Payment & Shipping Restriction plugin. Still, have any issues, feel free to add a ticket and let us know your views at webkul.uvdesk.com

Explore the Adobe Commerce Cloud development services by Webkul. You may also browse our quality Magento 2 extensions.

Current Product Version - 4.0.3

Supported Framework Version - Magento 2.0.x, 2.1.x, 2.2.x,2.3.x, 2.4.x

Blog Version - Magento 2.0.x, 2.1.x, 2.2.x,2.3.x, 2.4.x
  • Version 2.0.x, 2.1.x, 2.2.x, 2.3.x, 2.4.x
  • Version 2.0.x , 2.1.x , 2.2.x , 2.3.x
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Back to Top

Message Sent!

If you have more details or questions, you can reply to the received confirmation email.

Back to Home