diff --git a/app/code/Magento/Checkout/Block/Total/Nominal.php b/app/code/Magento/Checkout/Block/Total/Nominal.php
deleted file mode 100644
index f390c315bae5e..0000000000000
--- a/app/code/Magento/Checkout/Block/Total/Nominal.php
+++ /dev/null
@@ -1,141 +0,0 @@
-priceCurrency = $priceCurrency;
- parent::__construct($context, $customerSession, $checkoutSession, $salesConfig, $data);
- }
-
- /**
- * Getter for a quote item name
- *
- * @param \Magento\Sales\Model\Quote\Item\AbstractItem $quoteItem
- * @return string
- */
- public function getItemName(\Magento\Sales\Model\Quote\Item\AbstractItem $quoteItem)
- {
- return $quoteItem->getName();
- }
-
- /**
- * Getter for a quote item row total
- *
- * @param \Magento\Sales\Model\Quote\Item\AbstractItem $quoteItem
- * @return float
- */
- public function getItemRowTotal(\Magento\Sales\Model\Quote\Item\AbstractItem $quoteItem)
- {
- return $quoteItem->getNominalRowTotal();
- }
-
- /**
- * Getter for nominal total item details
- *
- * @param \Magento\Sales\Model\Quote\Item\AbstractItem $quoteItem
- * @return array
- */
- public function getTotalItemDetails(\Magento\Sales\Model\Quote\Item\AbstractItem $quoteItem)
- {
- return $quoteItem->getNominalTotalDetails();
- }
-
- /**
- * Getter for details row label
- *
- * @param \Magento\Framework\Object $row
- * @return string
- */
- public function getItemDetailsRowLabel(\Magento\Framework\Object $row)
- {
- return $row->getLabel();
- }
-
- /**
- * Getter for details row amount
- *
- * @param \Magento\Framework\Object $row
- * @return string
- */
- public function getItemDetailsRowAmount(\Magento\Framework\Object $row)
- {
- return $row->getAmount();
- }
-
- /**
- * Getter for details row compounded state
- *
- * @param \Magento\Framework\Object $row
- * @return bool
- */
- public function getItemDetailsRowIsCompounded(\Magento\Framework\Object $row)
- {
- return $row->getIsCompounded();
- }
-
- /**
- * Format an amount without container
- *
- * @param float $amount
- * @return string
- */
- public function formatPrice($amount)
- {
- return $this->priceCurrency->format($amount, false);
- }
-
- /**
- * Import total data into the block, if there are items
- *
- * @return string
- */
- protected function _toHtml()
- {
- $total = $this->getTotal();
- $items = $total->getItems();
- if ($items) {
- foreach ($total->getData() as $key => $value) {
- $this->setData("total_{$key}", $value);
- }
- return parent::_toHtml();
- }
- return '';
- }
-}
diff --git a/app/code/Magento/Checkout/Model/Type/Onepage.php b/app/code/Magento/Checkout/Model/Type/Onepage.php
index c49669e912c33..6e9925c2c5192 100644
--- a/app/code/Magento/Checkout/Model/Type/Onepage.php
+++ b/app/code/Magento/Checkout/Model/Type/Onepage.php
@@ -431,7 +431,7 @@ public function saveBilling($data, $customerAddressId)
$address = $this->getQuote()->getBillingAddress();
}
- if (!$this->getQuote()->getCustomerId() && self::METHOD_REGISTER == $this->getQuote()->getCheckoutMethod()) {
+ if (!$this->getQuote()->getCustomerId() && $this->isCheckoutMethodRegister()) {
if ($this->_customerEmailExists($address->getEmail(), $this->_storeManager->getWebsite()->getId())) {
return [
'error' => 1,
@@ -492,13 +492,19 @@ public function saveBilling($data, $customerAddressId)
)->setCollectShippingRates(
true
)->collectTotals();
- $shipping->save();
+ if (!$this->isCheckoutMethodRegister()) {
+ $shipping->save();
+ }
$this->getCheckout()->setStepData('shipping', 'complete', true);
break;
}
}
- $this->quoteRepository->save($this->getQuote());
+ if ($this->isCheckoutMethodRegister()) {
+ $this->quoteRepository->save($this->getQuote());
+ } else {
+ $address->save();
+ }
$this->getCheckout()->setStepData(
'billing',
@@ -517,6 +523,16 @@ public function saveBilling($data, $customerAddressId)
return [];
}
+ /**
+ * Check whether checkout method is "register"
+ *
+ * @return bool
+ */
+ protected function isCheckoutMethodRegister()
+ {
+ return $this->getQuote()->getCheckoutMethod() == self::METHOD_REGISTER;
+ }
+
/**
* Validate customer data and set some its data for further usage in quote
*
diff --git a/app/code/Magento/Checkout/etc/sales.xml b/app/code/Magento/Checkout/etc/sales.xml
deleted file mode 100644
index 69ebcbc6f04e1..0000000000000
--- a/app/code/Magento/Checkout/etc/sales.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
diff --git a/app/code/Magento/Checkout/view/frontend/templates/total/nominal.phtml b/app/code/Magento/Checkout/view/frontend/templates/total/nominal.phtml
deleted file mode 100644
index 13adb333776cb..0000000000000
--- a/app/code/Magento/Checkout/view/frontend/templates/total/nominal.phtml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
- getRenderingArea() == $this->getTotalArea()) ? '%s' : '%s', $this->escapeHtml($this->getTotalTitle())) ?>
- |
-
-getTotalItems() as $i => $item): ?>
- getTotalItemDetails($item) as $j => $row):?>
-
-
- escapeHtml($this->getItemDetailsRowLabel($row)) ?>
- |
-
- formatPrice($this->getItemDetailsRowAmount($row)) ?>
- |
-
-
-
-
- escapeHtml($this->getItemName($item)); ?>
- |
-
- helper('Magento\Checkout\Helper\Data')->formatPrice($this->getItemRowTotal($item)) ?>
- |
-
-
diff --git a/app/code/Magento/Multishipping/Helper/Data.php b/app/code/Magento/Multishipping/Helper/Data.php
index 9df86f3b14250..3d85088207977 100644
--- a/app/code/Magento/Multishipping/Helper/Data.php
+++ b/app/code/Magento/Multishipping/Helper/Data.php
@@ -87,7 +87,6 @@ public function isMultishippingCheckoutAvailable()
true
) &&
$quote->getItemsSummaryQty() - $quote->getItemVirtualQty() > 0 &&
- $quote->getItemsSummaryQty() <= $this->getMaximumQty() &&
- !$quote->hasNominalItems();
+ $quote->getItemsSummaryQty() <= $this->getMaximumQty();
}
}
diff --git a/app/code/Magento/Payment/Model/Cart/SalesModel/Quote.php b/app/code/Magento/Payment/Model/Cart/SalesModel/Quote.php
index dd6d7e16f1434..cde66236a50e9 100644
--- a/app/code/Magento/Payment/Model/Cart/SalesModel/Quote.php
+++ b/app/code/Magento/Payment/Model/Cart/SalesModel/Quote.php
@@ -50,7 +50,7 @@ public function getAllItems()
'parent_item' => $item->getParentItem(),
'name' => $item->getName(),
'qty' => (int)$item->getTotalQty(),
- 'price' => $item->isNominal() ? 0 : (double)$item->getBaseCalculationPrice(),
+ 'price' => (double)$item->getBaseCalculationPrice(),
'original_item' => $item,
]
);
diff --git a/app/code/Magento/Sales/Api/Data/OrderItemInterface.php b/app/code/Magento/Sales/Api/Data/OrderItemInterface.php
index 5532e6f6f878f..2b8d76a0350b3 100644
--- a/app/code/Magento/Sales/Api/Data/OrderItemInterface.php
+++ b/app/code/Magento/Sales/Api/Data/OrderItemInterface.php
@@ -266,11 +266,7 @@ interface OrderItemInterface extends \Magento\Framework\Api\ExtensibleDataInterf
*/
const BASE_HIDDEN_TAX_REFUNDED = 'base_hidden_tax_refunded';
/*
- * Is-nominal flag.
- */
- const IS_NOMINAL = 'is_nominal';
- /*
- * Tax-canceled flag.
+ * Tax canceled flag
*/
const TAX_CANCELED = 'tax_canceled';
/*
@@ -751,13 +747,6 @@ public function getHiddenTaxInvoiced();
*/
public function getHiddenTaxRefunded();
- /**
- * Gets the is-nominal flag value for the order item.
- *
- * @return int Is-nominal flag value.
- */
- public function getIsNominal();
-
/**
* Gets the is-quantity-decimal flag value for the order item.
*
diff --git a/app/code/Magento/Sales/Model/Config.php b/app/code/Magento/Sales/Model/Config.php
index 086decbdad64a..b7a4606b61cb2 100644
--- a/app/code/Magento/Sales/Model/Config.php
+++ b/app/code/Magento/Sales/Model/Config.php
@@ -49,7 +49,7 @@ public function getTotalsRenderer($section, $group, $code)
/**
* Retrieve totals for group
- * e.g. quote, nominal_totals, etc
+ * e.g. quote, etc
*
* @param string $section
* @param string $group
diff --git a/app/code/Magento/Sales/Model/Config/Converter.php b/app/code/Magento/Sales/Model/Config/Converter.php
index 1c28d520bbba5..7529fc9d34c37 100644
--- a/app/code/Magento/Sales/Model/Config/Converter.php
+++ b/app/code/Magento/Sales/Model/Config/Converter.php
@@ -5,7 +5,7 @@
*/
/**
- * Converts sales totals (incl. nominal, creditmemo, invoice) from \DOMDocument to array
+ * Converts sales totals (incl. creditmemo, invoice) from \DOMDocument to array
*/
namespace Magento\Sales\Model\Config;
diff --git a/app/code/Magento/Sales/Model/Config/Reader.php b/app/code/Magento/Sales/Model/Config/Reader.php
index 415bd0458ddf7..8922b4756e186 100644
--- a/app/code/Magento/Sales/Model/Config/Reader.php
+++ b/app/code/Magento/Sales/Model/Config/Reader.php
@@ -5,7 +5,7 @@
*/
/**
- * Sales configuration filesystem loader. Loads all totals (incl. nominal, creditmemo, invoice)
+ * Sales configuration filesystem loader. Loads all totals (incl. creditmemo, invoice)
* configuration from XML file
*/
namespace Magento\Sales\Model\Config;
diff --git a/app/code/Magento/Sales/Model/ConfigInterface.php b/app/code/Magento/Sales/Model/ConfigInterface.php
index 6fe4b3ae37436..89d359b405e60 100644
--- a/app/code/Magento/Sales/Model/ConfigInterface.php
+++ b/app/code/Magento/Sales/Model/ConfigInterface.php
@@ -19,7 +19,7 @@ public function getTotalsRenderer($section, $group, $code);
/**
* Retrieve totals for group
- * e.g. quote, nominal_totals, etc
+ * e.g. quote, etc
*
* @param string $section
* @param string $group
diff --git a/app/code/Magento/Sales/Model/Order.php b/app/code/Magento/Sales/Model/Order.php
index 5daad893b4934..33085bcd11296 100644
--- a/app/code/Magento/Sales/Model/Order.php
+++ b/app/code/Magento/Sales/Model/Order.php
@@ -802,6 +802,10 @@ public function canEdit()
return false;
}
+ if ($this->hasInvoices()) {
+ return false;
+ }
+
if (!$this->getPayment()->getMethodInstance()->canEdit()) {
return false;
}
@@ -1491,21 +1495,6 @@ public function addItem(\Magento\Sales\Model\Order\Item $item)
return $this;
}
- /**
- * Whether the order has nominal items only
- *
- * @return bool
- */
- public function isNominal()
- {
- foreach ($this->getAllVisibleItems() as $item) {
- if ('0' == $item->getIsNominal()) {
- return false;
- }
- }
- return true;
- }
-
/*********************** PAYMENTS ***************************/
/**
@@ -1821,6 +1810,18 @@ public function getInvoiceCollection()
return $this->_invoices;
}
+ /**
+ * Set order invoices collection
+ *
+ * @param InvoiceCollection $invoices
+ * @return $this
+ */
+ public function setInvoiceCollection(InvoiceCollection $invoices)
+ {
+ $this->_invoices = $invoices;
+ return $this;
+ }
+
/**
* Retrieve order shipments collection
*
diff --git a/app/code/Magento/Sales/Model/Order/Item.php b/app/code/Magento/Sales/Model/Order/Item.php
index aeeb47d00f218..d0ad825fea617 100644
--- a/app/code/Magento/Sales/Model/Order/Item.php
+++ b/app/code/Magento/Sales/Model/Order/Item.php
@@ -88,7 +88,6 @@
* @method \Magento\Sales\Model\Order\Item setBaseHiddenTaxInvoiced(float $value)
* @method \Magento\Sales\Model\Order\Item setHiddenTaxRefunded(float $value)
* @method \Magento\Sales\Model\Order\Item setBaseHiddenTaxRefunded(float $value)
- * @method \Magento\Sales\Model\Order\Item setIsNominal(int $value)
* @method \Magento\Sales\Model\Order\Item setTaxCanceled(float $value)
* @method \Magento\Sales\Model\Order\Item setHiddenTaxCanceled(float $value)
* @method \Magento\Sales\Model\Order\Item setTaxRefunded(float $value)
@@ -1272,16 +1271,6 @@ public function getHiddenTaxRefunded()
return $this->getData(OrderItemInterface::HIDDEN_TAX_REFUNDED);
}
- /**
- * Returns is_nominal
- *
- * @return int
- */
- public function getIsNominal()
- {
- return $this->getData(OrderItemInterface::IS_NOMINAL);
- }
-
/**
* Returns is_qty_decimal
*
diff --git a/app/code/Magento/Sales/Model/Order/Payment.php b/app/code/Magento/Sales/Model/Order/Payment.php
index fa245e8ce5302..c1c956a50b92e 100644
--- a/app/code/Magento/Sales/Model/Order/Payment.php
+++ b/app/code/Magento/Sales/Model/Order/Payment.php
@@ -378,7 +378,7 @@ protected function processAction($action, \Magento\Sales\Model\Order $order)
$this->_order($baseTotalDue);
break;
case \Magento\Payment\Model\Method\AbstractMethod::ACTION_AUTHORIZE:
- $this->_authorize(true, $baseTotalDue);
+ $this->authorize(true, $baseTotalDue);
// base amount will be set inside
$this->setAmountAuthorized($totalDue);
break;
@@ -471,12 +471,9 @@ public function capture($invoice)
$invoice->setIsPaid(true);
$this->_updateTotals(['base_amount_paid_online' => $amountToCapture]);
}
- if ($order->isNominal()) {
- $message = $this->_prependMessage(__('An order with subscription items was registered.'));
- } else {
- $message = $this->_prependMessage($message);
- $message = $this->_appendTransactionToMessage($transaction, $message);
- }
+ $message = $this->_prependMessage($message);
+ $message = $this->_appendTransactionToMessage($transaction, $message);
+
$order->setState($state, $status, $message);
$this->getMethodInstance()->processInvoice($invoice, $this);
return $this;
@@ -575,7 +572,7 @@ public function registerCaptureNotification($amount, $skipFraudDetection = false
*/
public function registerAuthorizationNotification($amount)
{
- return $this->_isTransactionExists() ? $this : $this->_authorize(false, $amount);
+ return $this->_isTransactionExists() ? $this : $this->authorize(false, $amount);
}
/**
@@ -1129,9 +1126,10 @@ protected function _order($amount)
*
* @param bool $isOnline
* @param float $amount
+ *
* @return $this
*/
- protected function _authorize($isOnline, $amount)
+ public function authorize($isOnline, $amount)
{
// check for authorization amount to be equal to grand total
$this->setShouldCloseParentTransaction(false);
@@ -1155,13 +1153,14 @@ protected function _authorize($isOnline, $amount)
// similar logic of "payment review" order as in capturing
if ($this->getIsTransactionPending()) {
+ $state = \Magento\Sales\Model\Order::STATE_PAYMENT_REVIEW;
$message = __(
'We will authorize %1 after the payment is approved at the payment gateway.',
$this->_formatPrice($amount)
);
- $state = \Magento\Sales\Model\Order::STATE_PAYMENT_REVIEW;
} else {
if ($this->getIsFraudDetected()) {
+ $state = \Magento\Sales\Model\Order::STATE_PAYMENT_REVIEW;
$message = __(
'Order is suspended as its authorizing amount %1 is suspected to be fraudulent.',
$this->_formatPrice($amount, $this->getCurrencyCode())
@@ -1171,35 +1170,19 @@ protected function _authorize($isOnline, $amount)
}
}
if ($this->getIsFraudDetected()) {
- $state = \Magento\Sales\Model\Order::STATE_PAYMENT_REVIEW;
$status = \Magento\Sales\Model\Order::STATUS_FRAUD;
}
// update transactions, order state and add comments
$transaction = $this->_addTransaction(\Magento\Sales\Model\Order\Payment\Transaction::TYPE_AUTH);
- if ($order->isNominal()) {
- $message = $this->_prependMessage(__('An order with subscription items was registered.'));
- } else {
- $message = $this->_prependMessage($message);
- $message = $this->_appendTransactionToMessage($transaction, $message);
- }
+ $message = $this->_prependMessage($message);
+ $message = $this->_appendTransactionToMessage($transaction, $message);
+
$order->setState($state, $status, $message);
return $this;
}
- /**
- * Public access to _authorize method
- *
- * @param bool $isOnline
- * @param float $amount
- * @return $this
- */
- public function authorize($isOnline, $amount)
- {
- return $this->_authorize($isOnline, $amount);
- }
-
/**
* Void payment either online or offline (process void notification)
* NOTE: that in some cases authorization can be voided after a capture. In such case it makes sense to use
diff --git a/app/code/Magento/Sales/Model/Quote.php b/app/code/Magento/Sales/Model/Quote.php
index a34cc20245be5..5969c0ad6084c 100644
--- a/app/code/Magento/Sales/Model/Quote.php
+++ b/app/code/Magento/Sales/Model/Quote.php
@@ -1246,22 +1246,6 @@ public function removeAllItems()
*/
public function addItem(\Magento\Sales\Model\Quote\Item $item)
{
- /**
- * Temporary workaround for purchase process: it is too dangerous to purchase more than one nominal item
- * or a mixture of nominal and non-nominal items, although technically possible.
- *
- * The problem is that currently it is implemented as sequential submission of nominal items and order,
- * by one click. It makes logically impossible to make the process of the purchase failsafe.
- * Proper solution is to submit items one by one with customer confirmation each time.
- */
- if ($item->isNominal() && $this->hasItems() || $this->hasNominalItems()) {
- throw new \Magento\Framework\Model\Exception(
- // @codingStandardsIgnoreStart
- __('Sorry, but items with payment agreements must be ordered one at a time To continue, please remove or buy the other items in your cart, then order this item by itself.')
- // @codingStandardsIgnoreEnd
- );
- }
-
$item->setQuote($this);
if (!$item->getId()) {
$this->getItemsCollection()->addItem($item);
@@ -2190,41 +2174,6 @@ public function merge(Quote $quote)
return $this;
}
- /**
- * Getter whether quote has nominal items
- * Can bypass treating virtual items as nominal
- *
- * @param bool $countVirtual
- * @return bool
- */
- public function hasNominalItems($countVirtual = true)
- {
- foreach ($this->getAllVisibleItems() as $item) {
- if ($item->isNominal()) {
- if (!$countVirtual && $item->getProduct()->isVirtual()) {
- continue;
- }
- return true;
- }
- }
- return false;
- }
-
- /**
- * Whether quote has nominal items only
- *
- * @return bool
- */
- public function isNominal()
- {
- foreach ($this->getAllVisibleItems() as $item) {
- if (!$item->isNominal()) {
- return false;
- }
- }
- return true;
- }
-
/**
* @return $this
*/
diff --git a/app/code/Magento/Sales/Model/Quote/Address.php b/app/code/Magento/Sales/Model/Quote/Address.php
index 8137f2d7174cb..b31a7ee3d7913 100644
--- a/app/code/Magento/Sales/Model/Quote/Address.php
+++ b/app/code/Magento/Sales/Model/Quote/Address.php
@@ -182,13 +182,6 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress
*/
protected $_baseTotalAmounts = [];
- /**
- * Whether to segregate by nominal items only
- *
- * @var bool
- */
- protected $_nominalOnly = null;
-
/**
* Core store config
*
@@ -571,23 +564,14 @@ public function getItemsCollection()
*/
public function getAllItems()
{
- // We calculate item list once and cache it in three arrays - all items, nominal, non-nominal
- $cachedItems = $this->_nominalOnly ? 'nominal' : ($this->_nominalOnly === false ? 'nonnominal' : 'all');
+ // We calculate item list once and cache it in three arrays - all items
+ $cachedItems = 'all';
$key = 'cached_items_' . $cachedItems;
if (!$this->hasData($key)) {
- // For compatibility we will use $this->_filterNominal to divide nominal items from non-nominal
- // (because it can be overloaded)
- // So keep current flag $this->_nominalOnly and restore it after cycle
- $wasNominal = $this->_nominalOnly;
- $this->_nominalOnly = true;
- // Now $this->_filterNominal() will return positive values for nominal items
-
$quoteItems = $this->getQuote()->getItemsCollection();
$addressItems = $this->getItemsCollection();
$items = [];
- $nominalItems = [];
- $nonNominalItems = [];
if ($this->getQuote()->getIsMultiShipping() && $addressItems->count() > 0) {
foreach ($addressItems as $aItem) {
if ($aItem->isDeleted()) {
@@ -601,11 +585,6 @@ public function getAllItems()
}
}
$items[] = $aItem;
- if ($this->_filterNominal($aItem)) {
- $nominalItems[] = $aItem;
- } else {
- $nonNominalItems[] = $aItem;
- }
}
} else {
/*
@@ -622,21 +601,12 @@ public function getAllItems()
continue;
}
$items[] = $qItem;
- if ($this->_filterNominal($qItem)) {
- $nominalItems[] = $qItem;
- } else {
- $nonNominalItems[] = $qItem;
- }
}
}
}
// Cache calculated lists
$this->setData('cached_items_all', $items);
- $this->setData('cached_items_nominal', $nominalItems);
- $this->setData('cached_items_nonnominal', $nonNominalItems);
-
- $this->_nominalOnly = $wasNominal; // Restore original value before we changed it
}
$items = $this->getData($key);
@@ -644,51 +614,6 @@ public function getAllItems()
return $items;
}
- /**
- * Getter for all non-nominal items
- *
- * @return array
- */
- public function getAllNonNominalItems()
- {
- $this->_nominalOnly = false;
- $result = $this->getAllItems();
- $this->_nominalOnly = null;
- return $result;
- }
-
- /**
- * Getter for all nominal items
- *
- * @return array
- */
- public function getAllNominalItems()
- {
- $this->_nominalOnly = true;
- $result = $this->getAllItems();
- $this->_nominalOnly = null;
-
- return $result;
- }
-
- /**
- * Segregate by nominal criteria
- *
- * Returns
- * true: get nominals only
- * false: get non-nominals only
- * null: get all
- *
- * @param \Magento\Sales\Model\Quote\Item\AbstractItem $item
- * @return \Magento\Sales\Model\Quote\Item\AbstractItem|false
- */
- protected function _filterNominal($item)
- {
- return null === $this->_nominalOnly ||
- false === $this->_nominalOnly && !$item->isNominal() ||
- true === $this->_nominalOnly && $item->isNominal() ? $item : false;
- }
-
/**
* Retrieve all visible items
*
@@ -861,9 +786,6 @@ public function getShippingRatesCollection()
{
if (null === $this->_rates) {
$this->_rates = $this->_rateCollectionFactory->create()->setAddressFilter($this->getId());
- if ($this->getQuote()->hasNominalItems(false)) {
- $this->_rates->setFixedOnlyFilter(true);
- }
if ($this->getId()) {
foreach ($this->_rates as $rate) {
$rate->setAddress($this);
diff --git a/app/code/Magento/Sales/Model/Quote/Address/Total/AbstractTotal.php b/app/code/Magento/Sales/Model/Quote/Address/Total/AbstractTotal.php
index b90abc626ed1e..d9c57affc69c0 100644
--- a/app/code/Magento/Sales/Model/Quote/Address/Total/AbstractTotal.php
+++ b/app/code/Magento/Sales/Model/Quote/Address/Total/AbstractTotal.php
@@ -188,14 +188,14 @@ protected function _addBaseAmount($baseAmount)
}
/**
- * Get all items except nominals
+ * Get all items
*
* @param \Magento\Sales\Model\Quote\Address $address
* @return array
*/
protected function _getAddressItems(\Magento\Sales\Model\Quote\Address $address)
{
- return $address->getAllNonNominalItems();
+ return $address->getAllItems();
}
/**
diff --git a/app/code/Magento/Sales/Model/Quote/Address/Total/Nominal.php b/app/code/Magento/Sales/Model/Quote/Address/Total/Nominal.php
deleted file mode 100644
index 7ad7aae70a71c..0000000000000
--- a/app/code/Magento/Sales/Model/Quote/Address/Total/Nominal.php
+++ /dev/null
@@ -1,93 +0,0 @@
-_collectorFactory = $collectorFactory;
- }
-
- /**
- * Invoke collector for nominal items
- *
- * @param \Magento\Sales\Model\Quote\Address $address
- * @return $this
- */
- public function collect(\Magento\Sales\Model\Quote\Address $address)
- {
- $collector = $this->_collectorFactory->create(['store' => $address->getQuote()->getStore()]);
-
- // invoke nominal totals
- foreach ($collector->getCollectors() as $model) {
- $model->collect($address);
- }
-
- // aggregate collected amounts into one to have sort of grand total per item
- foreach ($address->getAllNominalItems() as $item) {
- $rowTotal = 0;
- $baseRowTotal = 0;
- $totalDetails = [];
- foreach ($collector->getCollectors() as $model) {
- $itemRowTotal = $model->getItemRowTotal($item);
- if ($model->getIsItemRowTotalCompoundable($item)) {
- $rowTotal += $itemRowTotal;
- $baseRowTotal += $model->getItemBaseRowTotal($item);
- $isCompounded = true;
- } else {
- $isCompounded = false;
- }
- if ((double)$itemRowTotal > 0 && ($label = $model->getLabel())) {
- $totalDetails[] = new \Magento\Framework\Object(
- ['label' => $label, 'amount' => $itemRowTotal, 'is_compounded' => $isCompounded]
- );
- }
- }
- $item->setNominalRowTotal($rowTotal);
- $item->setBaseNominalRowTotal($baseRowTotal);
- $item->setNominalTotalDetails($totalDetails);
- }
-
- return $this;
- }
-
- /**
- * Fetch collected nominal items
- *
- * @param \Magento\Sales\Model\Quote\Address $address
- * @return $this
- */
- public function fetch(\Magento\Sales\Model\Quote\Address $address)
- {
- $items = $address->getAllNominalItems();
- if ($items) {
- $address->addTotal(
- [
- 'code' => $this->getCode(),
- 'title' => __('Subscription Items'),
- 'items' => $items,
- 'area' => 'footer',
- ]
- );
- }
- return $this;
- }
-}
diff --git a/app/code/Magento/Sales/Model/Quote/Address/Total/Nominal/Collector.php b/app/code/Magento/Sales/Model/Quote/Address/Total/Nominal/Collector.php
deleted file mode 100644
index 60846e18b796c..0000000000000
--- a/app/code/Magento/Sales/Model/Quote/Address/Total/Nominal/Collector.php
+++ /dev/null
@@ -1,27 +0,0 @@
-getAllNominalItems();
- if (!count($items)) {
- return $this;
- }
-
- // estimate quote with all address items to get their row weights
- $this->_shouldGetAllItems = true;
- parent::collect($address);
- $address->setCollectShippingRates(true);
- $this->_shouldGetAllItems = false;
- // now $items contains row weight information
-
- // collect shipping rates for each item individually
- foreach ($items as $item) {
- if (!$item->getProduct()->isVirtual()) {
- $address->requestShippingRates($item);
- $baseAmount = $item->getBaseShippingAmount();
- if ($baseAmount) {
- $item->setShippingAmount(
- $this->priceCurrency->convert($baseAmount, $address->getQuote()->getStore())
- );
- }
- }
- }
-
- return $this;
- }
-
- /**
- * Don't fetch anything
- *
- * @param \Magento\Sales\Model\Quote\Address $address
- * @return array
- */
- public function fetch(\Magento\Sales\Model\Quote\Address $address)
- {
- return \Magento\Sales\Model\Quote\Address\Total\AbstractTotal::fetch($address);
- }
-
- /**
- * Get nominal items only or indeed get all items, depending on current logic requirements
- *
- * @param \Magento\Sales\Model\Quote\Address $address
- * @return array
- */
- protected function _getAddressItems(\Magento\Sales\Model\Quote\Address $address)
- {
- if ($this->_shouldGetAllItems) {
- return $address->getAllItems();
- }
- return $address->getAllNominalItems();
- }
-}
diff --git a/app/code/Magento/Sales/Model/Quote/Address/Total/Nominal/Subtotal.php b/app/code/Magento/Sales/Model/Quote/Address/Total/Nominal/Subtotal.php
deleted file mode 100644
index 9f43af1ebfa4f..0000000000000
--- a/app/code/Magento/Sales/Model/Quote/Address/Total/Nominal/Subtotal.php
+++ /dev/null
@@ -1,59 +0,0 @@
-getAllNominalItems();
- }
-}
diff --git a/app/code/Magento/Sales/Model/Quote/Item/AbstractItem.php b/app/code/Magento/Sales/Model/Quote/Item/AbstractItem.php
index e40981592423c..2a2340f2e9b89 100644
--- a/app/code/Magento/Sales/Model/Quote/Item/AbstractItem.php
+++ b/app/code/Magento/Sales/Model/Quote/Item/AbstractItem.php
@@ -484,28 +484,6 @@ public function getBaseCalculationPriceOriginal()
return $this->_getData('base_calculation_price');
}
- /**
- * Get whether the item is nominal
- * TODO: fix for multishipping checkout
- *
- * @return bool
- */
- public function isNominal()
- {
- return false;
- }
-
- /**
- * Data getter for 'is_nominal'
- * Used for converting item to order item
- *
- * @return int
- */
- public function getIsNominal()
- {
- return (int)$this->isNominal();
- }
-
/**
* Get original price (retrieved from product) for item.
* Original price value is in quote selected currency
diff --git a/app/code/Magento/Sales/Model/Service/Quote.php b/app/code/Magento/Sales/Model/Service/Quote.php
index e87ff919c1b1f..f5aa07a01436e 100644
--- a/app/code/Magento/Sales/Model/Service/Quote.php
+++ b/app/code/Magento/Sales/Model/Service/Quote.php
@@ -40,7 +40,7 @@ class Quote
protected $_order = null;
/**
- * If it is true, quote will be inactivate after submitting order or nominal items
+ * If it is true, quote will be inactivate after submitting order
*
* @var bool
*/
@@ -213,7 +213,6 @@ protected function prepareCustomerData(\Magento\Sales\Model\Quote $quote)
*/
public function submitOrderWithDataObject()
{
- $this->_deleteNominalItems();
$this->_validate();
$quote = $this->_quote;
$isVirtual = $quote->isVirtual();
@@ -302,22 +301,6 @@ public function submitOrderWithDataObject()
return $order;
}
- /**
- * Submit nominal items
- *
- * @return void
- */
- public function submitNominalItems()
- {
- $this->_validate();
- $this->_eventManager->dispatch(
- 'sales_model_service_quote_submit_nominal_items',
- ['quote' => $this->_quote]
- );
- $this->_inactivateQuote();
- $this->_deleteNominalItems();
- }
-
/**
* Submit all available items
* All created items will be set to the object
@@ -327,16 +310,6 @@ public function submitNominalItems()
*/
public function submitAllWithDataObject()
{
- // don't allow submitNominalItems() to inactivate quote
- $inactivateQuoteOld = $this->_shouldInactivateQuote;
- $this->_shouldInactivateQuote = false;
- try {
- $this->submitNominalItems();
- $this->_shouldInactivateQuote = $inactivateQuoteOld;
- } catch (\Exception $e) {
- $this->_shouldInactivateQuote = $inactivateQuoteOld;
- throw $e;
- }
// no need to submit the order if there are no normal items remained
if (!$this->_quote->getAllVisibleItems()) {
$this->_inactivateQuote();
@@ -404,18 +377,4 @@ protected function _validate()
return $this;
}
-
- /**
- * Get rid of all nominal items
- *
- * @return void
- */
- protected function _deleteNominalItems()
- {
- foreach ($this->_quote->getAllVisibleItems() as $item) {
- if ($item->isNominal()) {
- $item->isDeleted(true);
- }
- }
- }
}
diff --git a/app/code/Magento/Sales/etc/fieldset.xml b/app/code/Magento/Sales/etc/fieldset.xml
index efd1f230bc688..0c2601c754313 100644
--- a/app/code/Magento/Sales/etc/fieldset.xml
+++ b/app/code/Magento/Sales/etc/fieldset.xml
@@ -479,9 +479,6 @@
-
-
-