Skip to content

Commit bcd7893

Browse files
committed
MC-32201: Reorder functionality
1 parent 7e7700d commit bcd7893

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

app/code/Magento/Quote/Model/Quote.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,8 @@ public function beforeSave()
865865
}
866866

867867
parent::beforeSave();
868+
869+
return $this;
868870
}
869871

870872
/**
@@ -946,7 +948,7 @@ public function assignCustomerWithAddressChange(
946948
try {
947949
$defaultBillingAddress = $this->addressRepository->getById($customer->getDefaultBilling());
948950
} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
949-
//
951+
// phpcs:ignore Magento2.CodeAnalysis.EmptyStatement
950952
}
951953
if (isset($defaultBillingAddress)) {
952954
/** @var \Magento\Quote\Model\Quote\Address $billingAddress */
@@ -960,7 +962,7 @@ public function assignCustomerWithAddressChange(
960962
try {
961963
$defaultShippingAddress = $this->addressRepository->getById($customer->getDefaultShipping());
962964
} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
963-
//
965+
// phpcs:ignore Magento2.CodeAnalysis.EmptyStatement
964966
}
965967
if (isset($defaultShippingAddress)) {
966968
/** @var \Magento\Quote\Model\Quote\Address $shippingAddress */
@@ -1686,6 +1688,7 @@ public function addProduct(
16861688
$errors[] = $message;
16871689
}
16881690
}
1691+
break;
16891692
}
16901693
}
16911694
if (!empty($errors)) {

app/code/Magento/Sales/Model/Reorder/Reorder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class Reorder
3737
*/
3838
private const MESSAGE_CODES = [
3939
'Product that you are trying to add is not available' => self::ERROR_NOT_SALABLE,
40+
'This product is out of stock' => self::ERROR_NOT_SALABLE,
4041
'The fewest you may purchase is' => self::ERROR_INSUFFICIENT_STOCK,
4142
'The most you may purchase is' => self::ERROR_INSUFFICIENT_STOCK,
4243
'The requested qty is not available' => self::ERROR_INSUFFICIENT_STOCK,

dev/tests/api-functional/testsuite/Magento/GraphQl/Sales/ReorderTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
/**
1717
* Test Reorder
18+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1819
*/
1920
class ReorderTest extends GraphQlAbstract
2021
{

0 commit comments

Comments
 (0)