Magento 2 Surcharge extension allows admin to apply the surcharge for using specific payment methods, shipping methods, products, ordering from the specific countries & regions, through specific customer groups in Magento 2 store.
Table of Content
- Extension Installation
- Configuration
- Product Surcharge Settings
- Country Surcharge Settings
- Region Surcharge Settings
- Customer Group Surcharge Settings
- Payment Surcharge Settings
- Minimum Order Amount Surcharge Settings
- Small Order Fee Settings
- Shipping Surcharge Settings
- Surcharge Applied on Orders in Frontend
- Surcharge Details in Backend
- For Magento Marketplace Customers
-
- Find the Composer name and version of the extension in the extension’s composer.json file.
- Login to your SSH and run:
- composer require meetanshi/magento-2-surcharge-fee --ignore-platform-reqs
- 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 installed properly, run the command:
- php bin/magento module:status Meetanshi_Surcharge --ignore-platform-reqs
-
- By default, the extension is probably disabled.
- Enable the extension and clear static view files:
-
- php bin/magento module:enable Meetanshi_Surcharge --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
- php bin/magento module:status Meetanshi_Surcharge --ignore-platform-reqs
- 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
- Configuration
To configure the extension, login to Magento 2 backend, move to Stores à Configuration à Meetanshi à Surcharge where you can find various settings to configure the extension.
- Surcharge: Enable or disable Surcharge extension from here.
- Calculate Surcharge On: Select one of the options to calculate surcharge on.
- Subtotal: Calculates and applies surcharge on the order subtotal.
- Subtotal Incl. Tax: Calculates and applies surcharge on the order subtotal including tax.
- Shipping: Calculates and applies surcharge on the shipping amount.
- Shipping Incl. Tax: Calculates and applies surcharge on the shipping including tax.
- Tax: Calculates and applies surcharge on the tax amount.
- Exclude Discount: Calculates the surcharge amount and applies after subtracting the discount amount from the subtotal.
- Grandtotal: Calculates and applies surcharge on the order grand total.
- Product Surcharge Settings
Configure the settings to enable product surcharge.
- Product Surcharge: Enable surcharge on purchasing products.
- Surcharge Type: Select one of the options on how you want to calculate and apply surcharge on orders.
- Highest Surcharge Amount per Order: Applies the highest surcharge amount of all products in the cart.
- Lowest Surcharge Amount per Order: Applies the lowest surcharge amount of all products in the cart.
- Per Product: Calculates and applies the sum of surcharge of all the products in the cart.
- Per Item: Calculates and applies the sum of surcharge of all the product items in the cart.
- Title: Enter the product surcharge title to display on cart, checkout, and other order pages.
To set product specific surcharge fee, go to Catalog > Products, edit a product, find the option “Surcharge Fee” and enter the surcharge fee amount for the product.
- Country Surcharge Settings
Configure the settings to enable surcharge when someone orders from specific countries. You can enable up to 3 country surcharges.
- Country Surcharge: Enable surcharge on purchasing from the specific countries.
- Countries: Select the countries from the order of which you want to apply country surcharge.
- Type: Select one of the options on how you want to calculate and apply country surcharge on orders.
- Fixed Amount: Applies the flat surcharge fee amount.
- Percentage of Product Price: Considers surcharge fee amount as percentage of product price and applies on the order.
- Title: Enter the country surcharge title to display on cart, checkout, frontend and other order related pages.
- Surcharge Fee Amount: Enter the surcharge fee amount.
- Apply Surcharge on Customer Group: Select Yes to apply country surcharge only on the orders from some specific customer groups.
- Region Surcharge Settings
Configure the settings to enable surcharge when someone orders from specific regions.
- Region Surcharge: Enable surcharge on purchasing from the specific regions.
- Regions: Select the regions from the order of which you want to apply region surcharge.
- Title: Enter the region surcharge title to display on cart, checkout, frontend and other order related pages.
- Surcharge Type: Select one of the options on how you want to calculate and apply region surcharge on orders.
- Fixed Amount: Applies the flat surcharge fee amount.
- Percentage of Product Price: Considers surcharge fee amount as percentage of product price and applies on the order.
- Surcharge Fee Amount: Enter the surcharge fee amount.
- Apply Surcharge on Customer Group: Select Yes to apply region surcharge only on the orders from some specific customer groups.
- Customer Group Surcharge Settings
Configure the settings to enable surcharge when someone orders from specific customer groups. You can add up to 3 customer group surcharges.
- Customer Group Surcharge: Enable surcharge on purchasing from the specific customer groups.
- Type: Select one of the options on how you want to calculate and apply customer group surcharge on orders.
- Fixed Amount: Applies the flat surcharge fee amount.
- Percentage of Product Price: Considers surcharge fee amount as percentage of product price and applies on the order.
- Title: Enter the customer group surcharge title to display on cart, checkout, frontend and other order related pages.
- Surcharge Fee Amount: Enter the surcharge fee amount.
- Customer Groups: Select the customer groups to which you want to apply customer group surcharge.
- Payment Surcharge Settings
Configure the settings to enable surcharge when someone orders by using specific payment methods. You can add up to 3 payment surcharges.
- Payment Surcharge: Enable surcharge on purchasing by using specific payment methods.
- Payment Methods to Apply Surcharge: Select the payment methods on use of which you want to apply payment surcharge.
- Title: Enter the payment surcharge title to display on cart, checkout, frontend and other order related pages.
- Type: Select one of the options on how you want to calculate and apply payment surcharge on orders.
- Fixed Amount: Applies the flat surcharge fee amount.
- Percentage of Product Price: Considers surcharge fee amount as percentage of product price and applies on the order.
- Surcharge Fee Amount: Enter the surcharge fee amount.
- Apply Surcharge on Customer Group: Select Yes to apply payment surcharge only on the orders from some specific customer groups.
- Minimum Order Amount Surcharge Settings
Configure the settings to enable surcharge when someone orders with the amount below the specified minimum order amount.
- Enforce Minimum Amount: Enable surcharge on orders below specified minimum amount.
- Title: Enter the minimum order amount surcharge title to display on cart, checkout, frontend and other order related pages.
- Minimum Order Amount: Enter the minimum order amount to apply surcharge. Here, surcharge amount will be the difference between the current order amount and the specified minimum order amount.
- Apply Surcharge on Customer Group: Select Yes to apply minimum order amount surcharge only on the orders from some specific customer groups.
- Small Order Fee Settings
Configure the settings to enable small order fee when someone orders with the amount below the specified minimum order amount.
- Small Order Fee: Enable small order fee on orders below specified minimum amount.
- Type: Select one of the options on how you want to calculate and apply small order fee.
- Fixed Amount: Applies the flat surcharge fee amount.
- Percentage of Product Price: Considers surcharge fee amount as percentage of product price and applies on the order.
- Title: Enter the small order fee title to display on cart, checkout, frontend and other order related pages.
- Minimum Order Amount: Enter the minimum order amount to apply small order fee.
- Surcharge Fee Amount: Enter the surcharge fee amount.
- Apply Surcharge on Customer Group: Select Yes to apply small order fee only on the orders from some specific customer groups.
- Shipping Surcharge Settings
Configure the settings to enable surcharge when someone orders using specific shipping methods. You can add up to 3 shipping method surcharges.
- Shipping Surcharge: Enable surcharge on purchase by using specific shipping methods.
- Calculate Surcharge On: Select one of the options for shipping method surcharge calculation.
- Shipping Price: Select to calculate shipping surcharge amount based on the shipping price.
- Value in Global Settings: Select to consider the global setting value under the calculate surcharge on option to calculate surcharge.
- Shipping Methods to Apply Surcharge: Select the shipping methods on use of which you want to apply payment surcharge.
- Title: Enter the shipping surcharge title to display on cart, checkout, frontend and other order related pages.
- Type: Select one of the options on how you want to calculate and apply shipping surcharge on orders.
- Fixed Amount: Applies the flat surcharge fee amount.
- Percentage: Considers surcharge fee amount as percentage and applies on the order.
- Surcharge Fee Amount: Enter the surcharge fee amount.
- Apply Surcharge on Customer Group: Select Yes to apply payment surcharge only on the orders from some specific customer groups.
- Surcharge Applied on Orders in Frontend
Once you've configured all the surcharge types, after adding the products to cart, various surcharges get applied on the order.
- Surcharge on the Cart page – Not Logged-in Customer
If a customer is not logged-in, various surcharges get applied based on the conditions met as per the configuration. The applied surcharge is shown on the cart page along with the respective surcharge title.
- Surcharge on the Cart page – Logged-in Customer
If a customer is logged-in, various surcharges get applied based on the conditions met as per the configuration. The applied surcharge is shown on the cart page along with the respective surcharge title.
- Surcharge on the Checkout page
All the applied surcharge is shown on the checkout page along with the respective surcharge title.
- Surcharge Details in My Account Section
After the order is placed successfully by a logged-in customer, all the applied surcharge details is shown customer’s My Account section under the My Orders > Order View.
- Surcharge Details in Order Email
The Surcharge details is also seen in the order confirmation email to the customer.
- Surcharge Details in Backend
Apart from the frontend, the admin can also see the surcharge details from the backend under Sales à Orders à Order View. In addition to the order view section in the backend, surcharge details can be seen in order invoice, invoice PDF and credit memo section as well.