Magento Cash On Delivery (COD) Charge Extension

About Cash On Delivery (COD) Charge

Cash On Delivery (COD) is currently one of the most popular payment mode for online web shops. The major reason for its popularity is that the customers do not have to pay anything before the products are delivered to them. In some countries this remains a popular option with internet-based retailers, since it is far easier to set up for small businesses and does not require the purchaser to have a credit card.

This payment method is the perfect solution for those customers who do not trust other payment methods, such as a card payment or PayPal, and prefer to pay upon receiving their order. With this method, you can offset the additional cost normally associated with COD by charging a fee to customers that choose this payment method.

Also some store owners would like to restrict this feature due to valid constraints like, distance between the store owner and their customer’s shipping address. To overcome this issue we have added the feature in this extension, which allows the store owner to restrict COD purchases to certain ZIP/PIN Codes. This extension also add an option of checking the availability of the COD payment method directly on the product page, making it convenient for customers to see if they will be able to use the option or not – well in advance.

This module allows you to add the COD payment method with the option of applying an extra fee and restrict COD purchases to certain ZIP/PIN Codes and allow to check the availability of Cash On Delivery payment method using ZIP/PIN Code directly on product page before placing the order.

 

Feature
  • Allow to charge your customers the same fee regardless of the amount of the order.
  • Apply a fee based on the percentage of the total order.
  • The fee is displayed separately in the cart, order, invoice, invoice pdf, order email.
  • The fee is calculated based on the store currency.
  • Allows you to set a minimum and maximum order size to show this payment method
  • Allow store owner to Add/Edit/Update PIN Code/ZIP code for Cash On Delivery method.
  • Cash On Delivery payment method Auto Hide based on customer entered shipping address PIN Code/ZIP code.
  • Allow to check the availability of Cash On Delivery using ZIP Code on product page.
  • This extension gives relaxation for customize Success/Failure message of service availability.

Standard Feature:

  • Follow Magento2 coding standards for this extension.
  • Follows Magento2 extension development guideline.
  • Compatible with latest Magento 2 editions.

Note:This extension will add another Cash On Delivery payment method on your Magento2 web store.

 

Installation

Your magento 2 extensions can be installed in a few minutes by going through these following steps

Step 1: Download/purchase the extension

Step 2: Unzip the file in a temporary directory

Step 3: Paste “CODCharges” folder into MagentoRoot/app/code/Doyenhub directory.

Step 4: Disable the cache under System >> Cache Management

Step 5: Enter the following at the command line to setup extension:

bin/magento module:enable Doyenhub_CODCharges –clear-static-content

bin/magento setup:upgrade

bin/magento setup:di:compile

bin/magento setup:static-content:deploy

bin/magento indexer:reindex

Note: Clear the store cache, clear your browser cache, domain cookies, and refresh the page.

If you change theme from admin you have to remove pub/static and re-deploy pub/static.

 

Uninstallation

Enter the following at the command line to setup extension:

bin/magento module:disable Doyenhub_CODCharges –clear-static-content

bin/magento setup:upgrade

bin/magento setup:di:compile

bin/magento setup:static-content:deploy

 

User Manual

1. Go to, Store >> Configuration >> Sales >> Payment Methods >> Cash On Delivery

EnabledYes/No (Select ‘Yes’ to enable the extension)

2. Configure these extension settings as per your requirement

New Order StatusSelect default ‘Pending’ for order confirmation with this payment method.
TitleEnter the text to be display on checkout payment method.
Payment from applicable countriesSelect ‘all allowed country’ for allowed “Cash On Delivery Charge” payment method on all countries or for specific select “allow specific country”.
Payment from specific countriesSelect specific countries for allowed “Cash On Delivery Charge” payment method.
Available zip codeEnter comma(,) separated zipcode for allowed “Cash On Delivery Charge” payment method. if empty then available for all zipcodes.
Minimum Order TotalEnter minimum order total for allowed “Cash On Delivery Charge” payment method or leave empty for disabling limit.
Maximum Order TotalEnter maximum order total for allowed “Cash On Delivery Charge” payment method or leave empty for disabling limit.
Before DiscountSelect yes for calculate charge before adding discount in order total.
Charge labelIf you want to display some note for take charges on checkout payment method, otherwise leave empty.
ExportExport sample file of charges or last entered file for you reference and verification of charges.
ImportUpload file for taking charges. This file is contain country, from amount, fee.
country: Should be “iso2 country” code or if you want to add charges to all country you can use country code as ‘*’. e.g US, PT.
from amount: Should be 0 or minimum order amount from that you want to apply charges.
fee: Should be 0 or any amount that you want to charge or you can also enter as ‘%’. e.g. 10, or 10%
Sort orderEnter sort order for displaying payment method on checkout.

3. Configure these extension settings as per your requirement for product page

Display On Product PageSelect ‘Yes’ If you want to display cash on delivery availability check form on product view page.
TitleEnter the text to be display for title of block on product view page.
Text PlaceholderEnter the text to be display for placeholder of textbox on product view page.
Check Button LabelEnter the text for display check button text on product view page.
Change Button LabelEnter the text for display change link text on product view page.
Product Page Success MessageEnter the text for display success message for product view page.
Product Page Failure MessageEnter the text for display error message for product view page.
Product Page Change MessageEnter the text for display session message for product view page.
Admin/Backend
1. Enable Cash on delivery
You can enable/disable cash on delivery charge functionality as per your requirement. 
2. New Order Status
There is only one option “Pending” same as default cash on delivery payment method. you can see this pending status on new generated order.
3. Title
You can enter title of Cash On Delivery Doyenhub payment method, for displaying on frontend checkout.
4. Payment from Applicable Countries
There are two options “All Allowed Countries” and “Specific Countries”, you can select as per your requirement, if you select “All Allowed Countries” then it will disable next field “Payment from specifc countries”.
5. Payment from Specific Countries
You can select specific countries in which Cash On Delivery Doyenhub payment method will be available.
6. Available zip code
You can allow the Cash On Delivery Doyenhub payment method only for specific zipcodes and on rest of zipcodes Cash On Delivery Doyenhub payment method will not be available. For allowing all zipcodes you have to leave as empty.
7. Minimum Order Total
Enter minimum order total for allowing “Cash On Delivery Charge” payment method from minimum order total or leave empty for disabling limit.
8. Maximum Order Total
Enter maximum order total for allowing “Cash On Delivery Charge” payment method to maximum order total or leave empty for disabling limit.
9. Before Discount
Select “Yes” for calculate charge before adding discount in order total. If you want to take charges including cart discount then you have to select “No”.
10. Charge Label
Enter text for displaying note of take charges on checkout page payment method, otherwise leave empty.
11. Export
Export sample file of charges or last entered charges file for you references and verification of charges.
12. Import
Upload file for taking charges as your requirement. Their is below one tag line that will display you an count of charge rules that you entered through file.
[NOTE]
country: should be “iso2 country” code or if you want to add charges to all country you can use country code as ‘*’. e.g US, PT.
from amount: should be 0 or minimum order amount from that you want to apply charges.
fee: should be 0 or any amount that you want to charge or you can also enter as ‘%’. e.g. 10, or 10%
13. Sort Order
Enter sort order for displaying payment method on checkout.
14. Display on product page
By enabling this you can show the cash on delivery form on product view page.
15. Custom fields for product view
Configure these extension settings as per your requirement for product view page.
Sales order from Admin

On order, invoice and credit memo you can see cash on delivery charges. if customer has ordered with this cash on delivery doyenhub payment method and charges is available.

1. Order information

2. Invoice information

3. Credit memo information

Print pdf from Admin

On invoice and credit memo pdf you can see cash on delivery charges. if customer has ordered with this cash on delivery doyenhub payment method.

1. Invoice Pdf

2. Credit Memo Pdf

Frontend
1. Product View Page
Here you can see both cash on delivery is available in your area. You can change the section title, button text, and message text from extension configuration setting in admin.
Here, cash on delivery is not available at entered zipcode. 
If user has already entered a shipping zipcode and on that zipcode cash on delivery is available, then it will show below message. You can change the section title, link text, and both message text from extension configuration.
2. Checkout Page
if cash on delivery doyenhub is available based on admin requirement then it will display in checkout page.
3. My Orders : Registered User(Customer)
On my orders page, order item, invoice and refund section cash on delivery charges will be display on order total section.
4. Orders Email
In order item, invoice and credit memo email cash on delivery charges will be display on order total section.
Demo Video

Leave a Reply

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