-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #146 from magento-commerce/1.1.41-release
1.1.41 Release
- Loading branch information
Showing
18 changed files
with
2,016 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
diff --git a/vendor/magento/module-async-order/Model/CartRepository.php b/vendor/magento/module-async-order/Model/CartRepository.php | ||
index 3f6946c483c..59c39a567b9 100644 | ||
--- a/vendor/magento/module-async-order/Model/CartRepository.php | ||
+++ b/vendor/magento/module-async-order/Model/CartRepository.php | ||
@@ -9,6 +9,7 @@ declare(strict_types=1); | ||
namespace Magento\AsyncOrder\Model; | ||
|
||
use Magento\Framework\Api\SearchCriteriaInterface; | ||
+use Magento\Framework\App\DeploymentConfig; | ||
use Magento\Quote\Api\CartRepositoryInterface; | ||
use Magento\Quote\Api\Data\CartInterface; | ||
use Magento\Quote\Model\QuoteRepository; | ||
@@ -23,15 +24,23 @@ class CartRepository implements CartRepositoryInterface | ||
*/ | ||
private $quoteRepository; | ||
|
||
+ /** | ||
+ * @var DeploymentConfig | ||
+ */ | ||
+ private DeploymentConfig $deploymentConfig; | ||
+ | ||
/** | ||
* Constructor | ||
* | ||
* @param QuoteRepository $quoteRepository | ||
+ * @param DeploymentConfig $deploymentConfig | ||
*/ | ||
public function __construct( | ||
- QuoteRepository $quoteRepository | ||
+ QuoteRepository $quoteRepository, | ||
+ DeploymentConfig $deploymentConfig | ||
) { | ||
$this->quoteRepository = $quoteRepository; | ||
+ $this->deploymentConfig = $deploymentConfig; | ||
} | ||
|
||
/** | ||
@@ -55,6 +64,9 @@ class CartRepository implements CartRepositoryInterface | ||
*/ | ||
public function getActive($cartId, array $sharedStoreIds = []) | ||
{ | ||
+ if (!$this->deploymentConfig->get(OrderManagement::ASYNC_ORDER_OPTION_PATH)) { | ||
+ return $this->quoteRepository->getActive($cartId, $sharedStoreIds); | ||
+ } | ||
return $this->get($cartId, $sharedStoreIds); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
diff --git a/vendor/magento/module-advanced-sales-rule/Model/Rule/Condition/FilterTextGenerator/Product/Attribute.php b/vendor/magento/module-advanced-sales-rule/Model/Rule/Condition/FilterTextGenerator/Product/Attribute.php | ||
index 4e90156..cd2b85f 100644 | ||
--- a/vendor/magento/module-advanced-sales-rule/Model/Rule/Condition/FilterTextGenerator/Product/Attribute.php | ||
+++ b/vendor/magento/module-advanced-sales-rule/Model/Rule/Condition/FilterTextGenerator/Product/Attribute.php | ||
@@ -7,6 +7,10 @@ namespace Magento\AdvancedSalesRule\Model\Rule\Condition\FilterTextGenerator\Pro | ||
|
||
use Magento\AdvancedSalesRule\Model\Rule\Condition\ConcreteCondition\Product\Attribute as AttributeCondition; | ||
use Magento\AdvancedRule\Model\Condition\FilterTextGeneratorInterface; | ||
+use Magento\Catalog\Model\Product; | ||
+use Magento\Eav\Model\Config; | ||
+use Magento\Eav\Model\Entity\Attribute\AbstractAttribute; | ||
+use Magento\Framework\Locale\FormatInterface; | ||
|
||
class Attribute implements FilterTextGeneratorInterface | ||
{ | ||
@@ -16,28 +20,48 @@ class Attribute implements FilterTextGeneratorInterface | ||
protected $attributeCode; | ||
|
||
/** | ||
+ * @var FormatInterface | ||
+ */ | ||
+ private FormatInterface $localeFormat; | ||
+ | ||
+ /** | ||
+ * @var Config | ||
+ */ | ||
+ private Config $config; | ||
+ | ||
+ /** | ||
* @param array $data | ||
+ * @param Config $config | ||
+ * @param FormatInterface $localeFormat | ||
*/ | ||
- public function __construct(array $data) | ||
- { | ||
+ public function __construct( | ||
+ array $data, | ||
+ Config $config, | ||
+ FormatInterface $localeFormat | ||
+ ) { | ||
$this->attributeCode = $data['attribute']; | ||
+ $this->config = $config; | ||
+ $this->localeFormat = $localeFormat; | ||
} | ||
|
||
/** | ||
- * @param \Magento\Framework\DataObject $quoteAddress | ||
- * @return string[] | ||
+ * @inheritdoc | ||
*/ | ||
public function generateFilterText(\Magento\Framework\DataObject $quoteAddress) | ||
{ | ||
$filterText = []; | ||
if ($quoteAddress instanceof \Magento\Quote\Model\Quote\Address) { | ||
$items = $quoteAddress->getAllItems(); | ||
+ $attribute = $this->getAttributeObject(); | ||
foreach ($items as $item) { | ||
$product = $item->getProduct(); | ||
if (!$product->hasData($this->attributeCode)) { | ||
$product->load($product->getId()); | ||
} | ||
$value = $product->getData($this->attributeCode); | ||
+ if ($attribute && $attribute->getBackendType() === 'decimal') { | ||
+ $value = $this->localeFormat->getNumber($value); | ||
+ } | ||
if (is_scalar($value)) { | ||
$text = AttributeCondition::FILTER_TEXT_PREFIX . $this->attributeCode . ':' . $value; | ||
if (!in_array($text, $filterText)) { | ||
@@ -48,4 +72,20 @@ class Attribute implements FilterTextGeneratorInterface | ||
} | ||
return $filterText; | ||
} | ||
+ | ||
+ /** | ||
+ * Retrieve attribute object | ||
+ * | ||
+ * @return ?AbstractAttribute | ||
+ */ | ||
+ private function getAttributeObject(): ?AbstractAttribute | ||
+ { | ||
+ try { | ||
+ $attributeObject = $this->config->getAttribute(Product::ENTITY, $this->attributeCode); | ||
+ } catch (\Exception $e) { | ||
+ $attributeObject = null; | ||
+ } | ||
+ | ||
+ return $attributeObject; | ||
+ } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
diff --git a/vendor/magento/module-purchase-order/Model/Validator/ActionReady/PlaceOrderValidator.php b/vendor/magento/module-purchase-order/Model/Validator/ActionReady/PlaceOrderValidator.php | ||
index 69e1169e080c..d3b0cbe8bd9f 100644 | ||
--- a/vendor/magento/module-purchase-order/Model/Validator/ActionReady/PlaceOrderValidator.php | ||
+++ b/vendor/magento/module-purchase-order/Model/Validator/ActionReady/PlaceOrderValidator.php | ||
@@ -20,6 +20,7 @@ class PlaceOrderValidator implements ValidatorInterface | ||
public function validate(PurchaseOrderInterface $purchaseOrder): bool | ||
{ | ||
$status = $purchaseOrder->getStatus(); | ||
+ $quote = $purchaseOrder->getSnapshotQuote(); | ||
$placeOrderStatuses = [ | ||
PurchaseOrderInterface::STATUS_APPROVED, | ||
PurchaseOrderInterface::STATUS_ORDER_FAILED | ||
@@ -27,6 +28,7 @@ public function validate(PurchaseOrderInterface $purchaseOrder): bool | ||
if (!in_array($status, $placeOrderStatuses) | ||
|| (null != $purchaseOrder->getOrderId()) | ||
|| !$purchaseOrder->getQuoteId() | ||
+ || $quote->getHasError() | ||
) { | ||
return false; | ||
} | ||
diff --git a/vendor/magento/module-purchase-order/view/frontend/templates/purchaseorder/view/info/buttons.phtml b/vendor/magento/module-purchase-order/view/frontend/templates/purchaseorder/view/info/buttons.phtml | ||
index 6310f5164a92..e6dbcaa6d86b 100644 | ||
--- a/vendor/magento/module-purchase-order/view/frontend/templates/purchaseorder/view/info/buttons.phtml | ||
+++ b/vendor/magento/module-purchase-order/view/frontend/templates/purchaseorder/view/info/buttons.phtml | ||
@@ -47,9 +47,11 @@ | ||
<?php if ($block->paymentRequired()): ?> | ||
<input type="hidden" name="payment_redirect" value="1"> | ||
<?php endif; ?> | ||
+ <?php if (!$block->hasError()): ?> | ||
<button type="submit" class="action placeorder primary"> | ||
<span><?= $escaper->escapeHtml(__('Place Order')) ?></span> | ||
</button> | ||
+ <?php endif; ?> | ||
</form> | ||
<?php endif; ?> | ||
|
Oops, something went wrong.