Coder Social home page Coder Social logo

cashondelivery's Introduction

Cash On Delivery for Magento 2

This module is a Cash On Delivery implementation for Magento2 allowing you to define an additional fee based on destination country, region and total amount.

Note: This module superseeds https://github.com/magespecialist/m2-MSP_CashOnDelivery

Main features:

  • Multiple currencies allowed
  • Multi store allowed
  • Percent or static fee supported
  • Fee per country / region / amount
  • Default fee fallback
  • Multi website support
  • Exclude specific regions

Installing in your Magento

  • From your CLI run: composer require it4mage/cashondelivery
  • Log-in your Magento backend
  • Go to Stores > Configuration > Sales > Payment Methods > Cash On Delivery
  • Configure Cash On Delivery according to your preferences

Configuring fees

  • Log-in your Magento backend
  • Go to Stores > Configuration > Sales > Payment Methods > Cash On Delivery
  • Scroll down untill you see Export CSV button
  • Click and download msp_cashondelivery.csv file
  • Change the CSV file and upload using the "browse" button
  • Save

CSV syntax

MSP Cash On Delivery CSV file syntax is really simple. You have 5 columns: country, region, from_amount, fee, website

  • country: ISO 2 letters country code. Use * as wildcard to indicate all countries
  • region: Region name. Use * as wildcard to indicate all regions
  • from_amount: Indicates the minimum amount to apply the additional fee
  • fee: The fee to apply (in base currency). Adding % after the fee indicates a percent value
  • website: Magento website code (e.g.: base). Use * as wildcard to indicate all websites

cashondelivery's People

Contributors

andrearivadossi avatar azambon avatar cdlate avatar fabianaromagnoli avatar fballiano avatar galanis-a avatar giacmir avatar mmenozzi avatar paveq avatar phoenix128 avatar renatocason avatar shanavas786 avatar slackerzz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cashondelivery's Issues

Not able to upload MSP csv

I got below error when uploading the file

The "C:/Users/admin/AppData/Local/Temp/D:/softs///**/php6A14.tmp" file doesn't exist.

Please let me know if you need more info.

Preconditions

  1. Magento v2.3.0
  2. XAMPP v3.2.2
  3. PHP v7.1.19
  4. Windows 10

Steps to reproduce

  1. Install MSP-CashOnDelivery on Magento 2.3.0
  2. Upload MSP CSV in MSP-CashOnDelivery settings
  3. Click save

Expected result

  1. CSV should have been processed and all rules should be uploaded in system.

Actual result

  1. Got below error
    The "C:/Users/admin/AppData/Local/Temp/D:/softs///**/php6A14.tmp" file doesn't exist.

image

MSP_CashOnDelivery module break Component Manager

From @ahmedzainsalem on February 11, 2018 13:34

Preconditions
PHP 7.0.27
Magento 2.1.2

Steps to reproduce

I installed the extension via Composer : composer require msp/cashondelivery
Go to System -> Tools -> Web Setup -> Component Manager

Expected result

No PHP error. The list of installed extensions is presented.

Actual result
The spinner is loading all the time.
You can see that the url /setup/index.php/componentGrid/components returns the following PHP error:

An error occurred

An error occurred during execution; please try again later.

Additional information:

RuntimeException

File:
public_html/setup/src/Magento/Setup/Model/PackagesData.php:88
Message:
Couldn't get available versions for package msp/cashondelivery
Stack trace:
#0 public_html/setup/src/Magento/Setup/Controller/ComponentGrid.php(98): Magento\Setup\Model\PackagesData->syncPackagesData()
#1 public_html/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(82): Magento\Setup\Controller\ComponentGrid->componentsAction()
#2 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#3 public_html/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#4 /public_html/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#5 /public_html/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(118): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#6 public_html/vendor/zendframework/zend-mvc/src/DispatchListener.php(93): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#7 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#8 /public_html/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#9 public_html/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#10 public_html/vendor/zendframework/zend-mvc/src/Application.php(314): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#11 public_html/setup/index.php(31): Zend\Mvc\Application->run()
#12 {main}

Copied from original issue: magespecialist#57

magento 2.4 installation problem

when i try to install this module on magento 2.4 i have this error message:

Installing data... SQLSTATE[42000]: Syntax error or access violation: 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs

One or more columns in database should be TEXT or BLOB type.

COD fee unconditionally refunded in credit memo

Preconditions

  1. Magento 2.4.x
  2. COD module configured to apply a fee

Steps to reproduce

  1. Create an order as customer with at least two items and COD payment such that a fee is applied
  2. In back end invoice the order (it doesn't matter if it is shipped or not)
  3. In back end try to create a credit memo for one of the items

Expected result

  1. User can specify wether COD fee will be refunded in the credit memo, preferably he should also be able to specify the amount

Actual result

  1. COD fee is refunded unconditionally. See attached screenshot
    image

This is a problem with partial refunds (e.g. defective product or damaged on delivery etc). Also if you do multiple refunds on an order, COD fee is refunded multiple times, once on every credit memo (even though it was only payed once)

Compatibility for Magento 2.4.5 and PHP v8.1

Hello!

Is there any chance that this module will be updated to run on Magento 2.4.5 and on PHP v8.1?

It still runs great on magento 2.4.5 on PHP v7.4 but when I try to switch on the PHP v8.1 I get the following error when I am running the composer update:

Problem 1 - it4mage/cashondelivery[1.2.0, ..., 1.2.8] require php ~5.5.0|~5.6.0|~7.0.0 -> your php version (8.1.9) does not satisfy that requirement. - it4mage/cashondelivery[1.2.9, ..., 1.2.12] require php ^7.0|^7.1 -> your php version (8.1.9) does not satisfy that requirement. - Root composer.json requires it4mage/cashondelivery ^1.2 -> satisfiable by it4mage/cashondelivery[1.2.0, ..., 1.2.12].

Thank you!

composer installation

there's no packagist package for it4mage/CashOnDelivery, the doc still refers to msp/CashOnDelivery which is older and uses the msp repository.

IMHO the best option is to create a packagist package for this repo, thus actually making this module independent from the original version.

what do you think about that?

Price by Postal Code

Preconditions

  1. Magento 2.2.0 CE

Is it possible to change the Cash On Delivery price by Postal Code through the CSV file? Maybe you could implement this in a future update?

Fix Checkout and order tax issue with tax and without tax

Hello

If you get the wrong price at order page base price - tax price go to "1- Fix Order price".
if you have an issue in checkout to show cod price with tax go to "2- Show price with a tax or without tax in the checkout page "


1- Fix Order price

please go to
msp/cashondelivery/Block/Sales/Cashondelivery.php

change line 48 ` - to +
From
'value' => $source->getBaseMspCodAmount() - $source->getBaseMspCodTaxAmount(),
To
'value' => $source->getBaseMspCodAmount() + $source->getBaseMspCodTaxAmount(),

this it will fix the price on order page and mail.


To Get Base price with tax Tax in customer order page
'value' => $source->getBaseMspCodAmount() + $source->getBaseMspCodTaxAmount(),

To Get Base price without tax in customer order page
'value' => $source->getBaseMspCodAmount() ,
`***********************************************************

2- Show price with a tax or without tax in the checkout page

go to
msp/cashondelivery/Model/Total/Quote/Cashondelivery.php

Change in line 100 from
From : without tax
'value' => $total->getBaseMspCodAmount() ,
To: with tax
'value' => $total->getBaseMspCodAmount() + $total->getBaseMspCodTaxAmount(),


Abdullah Almohammad

code for Magento 1.9

Hi, is it possibile to download the code for Magento 1.9 or there is only the version for Magento 2.x ?

thank you

Fee based on Subtotal

How can the module be modified so that it adds fee based on subtotal and not on grand total?

Problema con customer / prodotti disattivati

Salve,

quando elimino o disattivo un prodotto che e' stato messo in un carrello da un customer ed il customer si ricollega, il sistema si blocca. Disattivando il vostro modulo tutto torna a funzionare. Vi è gia' successo ?

Loading indefinitely M2.3.3

As soon as I check the cash on delivery payment option it starts loading and never stops. I cannot proceed with the order unless I reload the page which of course doesn't work again.
image

Preconditions

Steps to reproduce

Expected result

Actual result

  1. [Screenshot, logs]

[SOLVED] CheckoutData and shipping/billing informations missing on payment selection

Preconditions

Magento 2.x

Steps to reproduce

  1. Go to Checkout as Guest
  2. Add shipping information
  3. Click on COD payment
  4. Refresh page

Expected result

Shipping and Billing address are maintained.

Actual result

Shipping and Billing are missing, since checkout-data from LocalStorage (mage-cache-storage) is being deleted on payment selection.
image

How to fix

file view/frontend/web/js/view/payment/method-renderer/cashondelivery.js, add false after row 71.

before

return storage.put(
	serviceUrl,
	JSON.stringify(payload),
).done(function () {
	cashondelivery.canShowCashOnDelivery(quote.paymentMethod().method == 'msp_cashondelivery');
	getTotalsAction([]);
	fullScreenLoader.stopLoader();
});

after

return storage.put(
	serviceUrl,
	JSON.stringify(payload),
	false
).done(function () {
	cashondelivery.canShowCashOnDelivery(quote.paymentMethod().method == 'msp_cashondelivery');
	getTotalsAction([]);
	fullScreenLoader.stopLoader();
});

Price in Sales Order and Backend is wrong when exclude taxes

From @zenomordiante on February 26, 2018 9:21

ON it4mage page we can not open Issue.

Preconditions

  1. Magento 2.2.2
  2. Fee is 6€ Taxes included
  3. Check on Delivery csv:
    country,region,from_amount,fee,website
    ,,0.0000,4.92,*

Steps to reproduce

  1. I have set to display Subtotals Excluded taxes as:
    schermata 2018-02-26 alle 10 16 54

schermata 2018-02-26 alle 10 17 01

Expected result

  1. Price in cart and checkout is ok, but in Backend orders and Sales mail is wrong

Actual result

  1. CHECKOUT IS OK
    img-7381

  2. SALES MAIL IS WRONG
    img-7383

  3. BACKEND AREA ORDER IS WRONG
    img-7382

  4. TOTALS IS OK

Copied from original issue: magespecialist#58

Magento 2.2.3 CE, price is zero when adding to cart

From @Baracuda011 on April 30, 2018 11:49

Preconditions

  1. Magento 2.2.3 CE
  2. PHP 7.0.28
  3. MySQL 5.0.12

Steps to reproduce

  1. Upgrade from 2.1.3 CE to 2.2.3 CE
  2. Try to add any product to cart

Expected result

  1. Mini cart should appear with the added product

Actual result

  1. Product is not added to cart
  2. Ajax call (/en/customer/section/load/?sections=cart&update_section_id=false&_=1525081553687) endlessly loads.

/en/customer/section/load/?sections=cart&update_section_id=false&_=1525081553687

cart
{
summary_count: 0,
subtotalAmount: null,
subtotal: "AED0.00",
data_id: 1525081565,
extra_actions: "",
isGuestCheckoutAllowed: true,
THIS => items: [] <= THIS,
possible_onepage_checkout: true,
subtotal: "AED0.00",
subtotalAmount: null,
subtotal_excl_tax: "AED0.00",
subtotal_incl_tax: "AED0.00",
summary_count: 0,
website_id: "1"
}

To add a detailed description here:

I have a very strange issue. After upgrading from 2.1.3 to 2.2.3 CE I've noticed one strange issue, which is as I found out, related to MSP_CashOnDelivery module. But please let me explain the scenario.

When the module is disabled, add to cart work properly, and mini-cart is displayed after product is added to cart. But, when the module is enabled data this is not the case.

Here are the call and the response:

/en/customer/section/load/?sections=cart&update_section_id=false&_=1525081553687

cart
{
summary_count: 0,
subtotalAmount: null,
subtotal: "AED0.00",
data_id: 1525081565,
extra_actions: "",
isGuestCheckoutAllowed: true,
THIS => items: [] <= THIS,
possible_onepage_checkout: true,
subtotal: "AED0.00",
subtotalAmount: null,
subtotal_excl_tax: "AED0.00",
subtotal_incl_tax: "AED0.00",
summary_count: 0,
website_id: "1"
}

Magento Community also confirmed my scenario, please have a look at:
https://community.magento.com/t5/Magento-2-x-Programming/Magento-2-2-3-CE-price-is-zero-when-adding-to-cart/m-p/93291#M4305

Thank you very much.

Cheers,
Nemanja.

Copied from original issue: magespecialist#62

Virtual product in cart hide cash on delivery payment

Preconditions

  1. Magento 2.2.3 CE
  2. PHP 7.0.28
  3. MySQL 5.0.12

Steps to reproduce

  1. Add to cart one virtual product and one simple product
  2. Go to checkout
  3. Compile shipping form
  4. Continue to payment step

Expected result

  1. Cash on delivery available as payment method because one simple product is present on cart

Actual result

  1. Cash on delivery not shown as possibile payment method

In my opinion problem lives at this file:

/msp/cashondelivery/Model/Payment.php

at line 43.

is this abandoned?

I see unanswered issues and PRs, and the documentation still refers to msp/cashondelivery which was abandoned.

It this updated or should we consider another cashondelivery module?

Fee only sho tax excluded

From @masfiore on February 1, 2018 10:36

There is a possibility to sho only the fee with tax excluded, but if you have in checkout all tax included only this field show tax excluded.

Preconditions

Magento 2.2 Nginx

Steps to reproduce

In checkout when select metod Cash on delivery, the fee is only tax excluded

Expected result

There is a possibility to show tax included?

Copied from original issue: magespecialist#56

When change order's status to "Invoice", COD's tax is deducted from grand total

Preconditions

  1. Magento 2.2.9
  2. PHP 7.1

Steps to reproduce

  1. Make a test order from the frontend
  2. Process the order on the backend and generate the invoice

Expected result

  1. Grand total should be product's price + shipping + COD
  2. Total paid should be product's price + shipping + COD

Actual result

  1. The grand total is correct
  2. The total paid is product's price + shipping + (COD - tax)
  3. There is a total due which is the COD's tax amount

Both products and shipping method are taxable. I have applied the fixes mentioned in #18 . Which file should I edit and how? Any suggestions?

Regards,
Fay

Screenshot 2019-10-04 17 09 14

tax did not included

From @moamen-ui on May 6, 2018 15:17

Preconditions

  1. Magento 2.2.3

Steps to reproduce

  1. add product to cart
  2. checkout
  3. choose Cash on delivery

Expected result

  1. include on tax

Actual result

  1. did not include on tax

Copied from original issue: magespecialist#63

Not working in Magento 2.3.4

I'm getting a console error when try to select "cash on delivery" on checkout::
/rest/it/V1/carts/mine/selected-payment-method 500 (Internal Server Error).
The error:
Property "DisableTmpl" does not have accessor method "getDisableTmpl" in class "Magento\Quote\Api\Data\PaymentInterface".

I tried the suggested solution here:
https://magento.stackexchange.com/questions/292776/magento-2-3-3-paypal-problem-while-checkout
but it does not work

Any help appreciated, thanks!

magento 2.4 installation problem

Though setup:upgrade runs without any issue on compile I am getting the below error:

Repositories code generation... 1/9 [===>------------------------]  11% 3 secs 85.0 MiBPHP Fatal error:  Uncaught Error: Class 'MSP\CashOnDelivery\Model\Total\Quote\AbstractTotal' not found in /home/server/yaeabfbzft/public_html/app/code/MSP/MSP_CashOnDelivery/Model/Total/Quote/Cashondelivery.php:31
Stack trace:
#0 /home/server/yaeabfbzft/public_html/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(136): require_once()
#1 /home/server/yaeabfbzft/public_html/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(117): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->includeClass()
#2 /home/server/yaeabfbzft/public_html/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(87): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->extract()
#3 /home/server/yaeabfbzft/public_html/setup/src/Magento/Setup/Module/Di/App/Task/Operation/RepositoryGenerator.php(61): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->getList()
#4 /home/server/yaeabfbzft/public_html/setup/src/Ma in /home/server/yaeabfbzft/public_html/app/code/MSP/MSP_CashOnDelivery/Model/Total/Quote/Cashondelivery.php on line 31

Thanks in advance for your time.

Issue with tax in COD fee

Hello,

I have this issue that the fee isn't broken down into value + taxes. The fee is 100% value.

image

How could this be approached?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.