Skip to content

Commit b665b9c

Browse files
author
Joan He
committed
MAGETWO-90591: Add Selected Button shouldn't be enabled if there are no images available
- resolve merge conflict
2 parents 9ecc8ea + 50503f2 commit b665b9c

File tree

202 files changed

+2982
-1822
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+2982
-1822
lines changed

app/code/Magento/Braintree/Gateway/Http/Client/TransactionRefund.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ class TransactionRefund extends AbstractTransaction
1717
protected function process(array $data)
1818
{
1919
$storeId = $data['store_id'] ?? null;
20-
// sending store id and other additional keys are restricted by Braintree API
21-
unset($data['store_id']);
2220

2321
return $this->adapterFactory->create($storeId)
2422
->refund($data['transaction_id'], $data[PaymentDataBuilder::AMOUNT]);

app/code/Magento/Braintree/Gateway/Http/Client/TransactionSubmitForSettlement.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ class TransactionSubmitForSettlement extends AbstractTransaction
1919
protected function process(array $data)
2020
{
2121
$storeId = $data['store_id'] ?? null;
22-
// sending store id and other additional keys are restricted by Braintree API
23-
unset($data['store_id']);
2422

2523
return $this->adapterFactory->create($storeId)
2624
->submitForSettlement($data[CaptureDataBuilder::TRANSACTION_ID], $data[PaymentDataBuilder::AMOUNT]);

app/code/Magento/Braintree/Gateway/Http/Client/TransactionVoid.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ class TransactionVoid extends AbstractTransaction
1515
protected function process(array $data)
1616
{
1717
$storeId = $data['store_id'] ?? null;
18-
// sending store id and other additional keys are restricted by Braintree API
19-
unset($data['store_id']);
2018

2119
return $this->adapterFactory->create($storeId)->void($data['transaction_id']);
2220
}

app/code/Magento/Braintree/view/frontend/templates/paypal/button.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ $config = [
2929
class="action-braintree-paypal-logo" disabled>
3030
<img class="braintree-paypal-button-hidden"
3131
src="https://checkout.paypal.com/pwpp/2.17.6/images/pay-with-paypal.png"
32-
alt="Pay with PayPal"/>
32+
alt="<?= $block->escapeHtml(__('Pay with PayPal')) ?>"
33+
title="<?= $block->escapeHtml(__('Pay with PayPal')) ?>"/>
3334
</button>
3435
</div>

app/code/Magento/Catalog/Controller/Product/Compare/Add.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,14 @@ public function execute()
3636
$productName = $this->_objectManager->get(
3737
\Magento\Framework\Escaper::class
3838
)->escapeHtml($product->getName());
39-
$this->messageManager->addSuccess(__('You added product %1 to the comparison list.', $productName));
39+
$this->messageManager->addComplexSuccessMessage(
40+
'addCompareSuccessMessage',
41+
[
42+
'product_name' => $productName,
43+
'compare_list_url' => $this->_url->getUrl('catalog/product_compare')
44+
]
45+
);
46+
4047
$this->_eventManager->dispatch('catalog_product_compare_add_product', ['product' => $product]);
4148
}
4249

app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/DefaultPrice.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ protected function getSelect($entityIds = null, $type = null)
456456
$specialFromExpr = "{$specialFrom} IS NULL OR {$specialFromDate} <= {$currentDate}";
457457
$specialToExpr = "{$specialTo} IS NULL OR {$specialToDate} >= {$currentDate}";
458458
$specialPriceExpr = $connection->getCheckSql(
459-
"{$specialPrice} IS NOT NULL AND {$specialFromExpr} AND {$specialToExpr}",
459+
"{$specialPrice} IS NOT NULL AND ({$specialFromExpr}) AND ({$specialToExpr})",
460460
$specialPrice,
461461
$maxUnsignedBigint
462462
);
@@ -547,7 +547,7 @@ protected function _prepareCustomOptionPriceTable()
547547
* @param IndexTableStructure $finalPriceTable
548548
* @return void
549549
*/
550-
private function modifyPriceIndex(IndexTableStructure $finalPriceTable)
550+
private function modifyPriceIndex(IndexTableStructure $finalPriceTable) : void
551551
{
552552
foreach ($this->priceModifiers as $priceModifier) {
553553
$priceModifier->modifyPrice($finalPriceTable);
@@ -862,6 +862,11 @@ private function getTotalTierPriceExpression(\Zend_Db_Expr $priceExpression)
862862
);
863863
}
864864

865+
/**
866+
* @param string $tableAlias
867+
* @param \Zend_Db_Expr $priceExpression
868+
* @return \Zend_Db_Expr
869+
*/
865870
private function getTierPriceExpressionForTable($tableAlias, \Zend_Db_Expr $priceExpression)
866871
{
867872
return $this->getConnection()->getCheckSql(

app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductPageSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<element name="qtyInput" type="button" selector="input.input-text.qty"/>
1313
<element name="addToCartBtn" type="button" selector="button.action.tocart.primary" timeout="30"/>
1414
<element name="successMsg" type="button" selector="div.message-success"/>
15+
<element name="errorMsg" type="button" selector="div.message-error"/>
1516
<element name="alertMessage" type="text" selector=".page.messages [role=alert]"/>
1617
<element name="messagesBlock" type="text" selector=".page.messages"/>
1718
<element name="addToWishlist" type="button" selector="//a[@class='action towishlist']" timeout="30"/>

app/code/Magento/Catalog/etc/frontend/di.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,18 @@
7979
<argument name="typeId" xsi:type="string">recently_compared_product</argument>
8080
</arguments>
8181
</virtualType>
82+
<type name="Magento\Framework\View\Element\Message\MessageConfigurationsPool">
83+
<arguments>
84+
<argument name="configurationsMap" xsi:type="array">
85+
<item name="addCompareSuccessMessage" xsi:type="array">
86+
<item name="renderer" xsi:type="const">\Magento\Framework\View\Element\Message\Renderer\BlockRenderer::CODE</item>
87+
<item name="data" xsi:type="array">
88+
<item name="template" xsi:type="string">Magento_Catalog::messages/addCompareSuccessMessage.phtml</item>
89+
</item>
90+
</item>
91+
</argument>
92+
</arguments>
93+
</type>
8294
<type name="Magento\Catalog\Block\Product\View\Gallery">
8395
<arguments>
8496
<argument name="galleryImagesConfig" xsi:type="array">
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
// @codingStandardsIgnoreFile
7+
/** @var \Magento\Framework\View\Element\Template $block */
8+
?>
9+
<?= $block->escapeHtml(__(
10+
'You added product %1 to the <a href="%2">comparison list</a>.',
11+
$block->getData('product_name'),
12+
$block->getData('compare_list_url')),
13+
['a']
14+
);

app/code/Magento/CatalogInventory/Model/Plugin/PriceIndexUpdater.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct(Processor $priceIndexProcessor)
3636
* @return Item
3737
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
3838
*/
39-
public function afterSave(Item $subject, Item $result, AbstractModel $model)
39+
public function afterSave(Item $subject, Item $result, AbstractModel $model): Item
4040
{
4141
$fields = [
4242
'is_in_stock',
@@ -55,7 +55,7 @@ public function afterSave(Item $subject, Item $result, AbstractModel $model)
5555

5656
/**
5757
* @param Item $subject
58-
* @param $result
58+
* @param mixed $result
5959
* @param int $websiteId
6060
* @return void
6161
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
@@ -67,7 +67,7 @@ public function afterUpdateSetOutOfStock(Item $subject, $result, int $websiteId)
6767

6868
/**
6969
* @param Item $subject
70-
* @param $result
70+
* @param mixed $result
7171
* @param int $websiteId
7272
* @return void
7373
* @SuppressWarnings(PHPMD.UnusedFormalParameter)

0 commit comments

Comments
 (0)