From aad28f428d611706c64347fe94fe867d4995683d Mon Sep 17 00:00:00 2001 From: Riccardo Tempesta Date: Wed, 25 Oct 2017 15:33:58 +0200 Subject: [PATCH] Initial order status change --- Model/Cashondelivery.php | 1 - Model/CashondeliveryTable.php | 4 +--- Model/Payment.php | 2 +- Model/ResourceModel/Order/Collection.php | 3 +-- etc/adminhtml/system.xml | 2 +- etc/module.xml | 2 +- 6 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Model/Cashondelivery.php b/Model/Cashondelivery.php index 428c68c..98b863f 100644 --- a/Model/Cashondelivery.php +++ b/Model/Cashondelivery.php @@ -136,7 +136,6 @@ public function getCartInformation() return $this->objectManagerInterface->get('MSP\CashOnDelivery\Api\CashondeliveryCartInterface'); } - /** * @return \Magento\Tax\Api\Data\TaxRateInterface */ diff --git a/Model/CashondeliveryTable.php b/Model/CashondeliveryTable.php index dcb7018..a7ff44f 100644 --- a/Model/CashondeliveryTable.php +++ b/Model/CashondeliveryTable.php @@ -150,7 +150,6 @@ public function saveFromFile($fileName) for ($i=0; $i_columns as $columnName) { - // Optional columns if ($columnName == 'website') { if (!isset($csvLine[$columnsMap[$columnName]]) || !$csvLine[$columnsMap[$columnName]]) { @@ -164,8 +163,7 @@ public function saveFromFile($fileName) if ($columnName == 'fee') { $dataRow['is_pct'] = (strpos($value, '%') !== false); $value = floatval(str_replace('%', '', $value)); - - } else if ($columnName == 'from_amount') { + } elseif ($columnName == 'from_amount') { $value = floatval($value); } diff --git a/Model/Payment.php b/Model/Payment.php index 9b52d83..bed6d94 100644 --- a/Model/Payment.php +++ b/Model/Payment.php @@ -42,7 +42,7 @@ public function isAvailable(\Magento\Quote\Api\Data\CartInterface $quote = null) $excludeRegions = $this->_scopeConfig->getValue(static::XML_PATH_EXCLUDE_REGIONS); - if(!empty($excludeRegions)) { + if (!empty($excludeRegions)) { $excludeRegions = explode(',', $excludeRegions); foreach ($quote->getAllShippingAddresses() as $shippingAddress) { if (in_array($shippingAddress->getRegionId(), $excludeRegions)) { diff --git a/Model/ResourceModel/Order/Collection.php b/Model/ResourceModel/Order/Collection.php index ff69c2a..20da0af 100644 --- a/Model/ResourceModel/Order/Collection.php +++ b/Model/ResourceModel/Order/Collection.php @@ -119,7 +119,7 @@ public function __construct( /** * Get sales amount expression - * Here i added the last to arguments to the expression + * Here i added the last to arguments to the expression * to subtract the cash on deliry and the tax amount form the total revenue * * @return string @@ -156,5 +156,4 @@ protected function _getSalesAmountExpression() return $this->_salesAmountExpression; } - } diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 087c014..800251e 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -36,7 +36,7 @@ - Magento\Sales\Model\Config\Source\Order\Status\NewStatus + Magento\Sales\Model\Config\Source\Order\Status\Newprocessing diff --git a/etc/module.xml b/etc/module.xml index 1e1561e..8cf7ea7 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -21,7 +21,7 @@ --> - +