Skip to content

Commit 0465f37

Browse files
committed
Merge branch 'develop' of github.com:magento/magento2ce into MAGETWO-67593
2 parents cbece79 + f63b0a1 commit 0465f37

File tree

45 files changed

+535
-334
lines changed

Some content is hidden

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

45 files changed

+535
-334
lines changed

app/code/Magento/Bundle/Observer/LoadProductOptionsObserver.php

Lines changed: 0 additions & 27 deletions
This file was deleted.

app/code/Magento/Bundle/etc/frontend/events.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
<event name="catalog_product_upsell">
1010
<observer name="bundle_observer" instance="Magento\Bundle\Observer\AppendUpsellProductsObserver"/>
1111
</event>
12-
<event name="catalog_product_collection_load_after">
13-
<observer name="bundle_observer" instance="Magento\Bundle\Observer\LoadProductOptionsObserver"/>
14-
</event>
1512
<event name="product_option_renderer_init">
1613
<observer name="bundle_observer" instance="Magento\Bundle\Observer\InitOptionRendererObserver"/>
1714
</event>

app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2175,9 +2175,7 @@ private function fillTierPriceData(\Magento\Framework\DB\Select $select)
21752175
}
21762176
foreach ($this->getItems() as $item) {
21772177
$productId = $item->getData($this->getLinkField());
2178-
if (isset($tierPrices[$productId])) {
2179-
$this->getBackend()->setPriceData($item, $tierPrices[$productId]);
2180-
}
2178+
$this->getBackend()->setPriceData($item, isset($tierPrices[$productId]) ? $tierPrices[$productId] : []);
21812179
}
21822180
}
21832181

app/code/Magento/Catalog/Setup/InstallSchema.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2022,18 +2022,6 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con
20222022
'attribute_id',
20232023
\Magento\Framework\DB\Ddl\Table::ACTION_CASCADE
20242024
)
2025-
->addForeignKey(
2026-
$installer->getFkName(
2027-
'catalog_product_entity_media_gallery',
2028-
'entity_id',
2029-
'catalog_product_entity',
2030-
'entity_id'
2031-
),
2032-
'entity_id',
2033-
$installer->getTable('catalog_product_entity'),
2034-
'entity_id',
2035-
\Magento\Framework\DB\Ddl\Table::ACTION_CASCADE
2036-
)
20372025
->setComment(
20382026
'Catalog Product Media Gallery Attribute Backend Table'
20392027
);

app/code/Magento/CatalogSearch/Model/Search/FilterMapper/ExclusionStrategy.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ public function apply(
9797
[
9898
$alias => $tableName
9999
],
100-
'search_index.entity_id = category_ids_index.product_id',
100+
$this->resourceConnection->getConnection()->quoteInto(
101+
'search_index.entity_id = category_ids_index.product_id AND category_ids_index.store_id = ?',
102+
$this->storeManager->getStore()->getId()
103+
),
101104
[]
102105
);
103106
$isApplied = true;

app/code/Magento/ConfigurableProduct/Block/Product/View/Type/Configurable.php

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public function getJsonConfig()
223223
],
224224
'productId' => $currentProduct->getId(),
225225
'chooseText' => __('Choose an Option...'),
226-
'images' => isset($options['images']) ? $options['images'] : [],
226+
'images' => $this->getOptionImages(),
227227
'index' => isset($options['index']) ? $options['index'] : [],
228228
];
229229

@@ -236,6 +236,33 @@ public function getJsonConfig()
236236
return $this->jsonEncoder->encode($config);
237237
}
238238

239+
/**
240+
* Get product images for configurable variations
241+
*
242+
* @return array
243+
*/
244+
protected function getOptionImages()
245+
{
246+
$images = [];
247+
foreach ($this->getAllowProducts() as $product) {
248+
249+
$productImages = $this->helper->getGalleryImages($product) ?: [];
250+
foreach ($productImages as $image) {
251+
$images[$product->getId()][] =
252+
[
253+
'thumb' => $image->getData('small_image_url'),
254+
'img' => $image->getData('medium_image_url'),
255+
'full' => $image->getData('large_image_url'),
256+
'caption' => $image->getLabel(),
257+
'position' => $image->getPosition(),
258+
'isMain' => $image->getFile() == $product->getImage(),
259+
];
260+
}
261+
}
262+
263+
return $images;
264+
}
265+
239266
/**
240267
* @return array
241268
*/

app/code/Magento/ConfigurableProduct/Helper/Data.php

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -76,23 +76,11 @@ public function getGalleryImages(\Magento\Catalog\Api\Data\ProductInterface $pro
7676
public function getOptions($currentProduct, $allowedProducts)
7777
{
7878
$options = [];
79+
$allowAttributes = $this->getAllowAttributes($currentProduct);
80+
7981
foreach ($allowedProducts as $product) {
8082
$productId = $product->getId();
81-
$images = $this->getGalleryImages($product);
82-
if ($images) {
83-
foreach ($images as $image) {
84-
$options['images'][$productId][] =
85-
[
86-
'thumb' => $image->getData('small_image_url'),
87-
'img' => $image->getData('medium_image_url'),
88-
'full' => $image->getData('large_image_url'),
89-
'caption' => $image->getLabel(),
90-
'position' => $image->getPosition(),
91-
'isMain' => $image->getFile() == $product->getImage(),
92-
];
93-
}
94-
}
95-
foreach ($this->getAllowAttributes($currentProduct) as $attribute) {
83+
foreach ($allowAttributes as $attribute) {
9684
$productAttribute = $attribute->getProductAttribute();
9785
$productAttributeId = $productAttribute->getId();
9886
$attributeValue = $product->getData($productAttribute->getAttributeCode());

app/code/Magento/Directory/view/frontend/templates/currency.phtml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,16 @@
1919
<div class="switcher currency switcher-currency" id="switcher-currency<?php echo $block->escapeHtmlAttr($id) ?>">
2020
<strong class="label switcher-label"><span><?php echo $block->escapeHtml(__('Currency')) ?></span></strong>
2121
<div class="actions dropdown options switcher-options">
22-
<div class="action toggle switcher-trigger" id="switcher-currency-trigger<?php echo $block->escapeHtmlAttr($id) ?>">
22+
<div class="action toggle switcher-trigger"
23+
id="switcher-currency-trigger<?php echo $block->escapeHtmlAttr($id) ?>"
24+
data-mage-init='{"dropdown":{}}'
25+
data-toggle="dropdown"
26+
data-trigger-keypress-button="true">
2327
<strong class="language-<?php echo $block->escapeHtml($block->getCurrentCurrencyCode()) ?>">
2428
<span><?php echo $block->escapeHtml($currentCurrencyCode) ?> - <?php echo @$block->escapeHtml($currencies[$currentCurrencyCode]) ?></span>
2529
</strong>
2630
</div>
27-
<ul class="dropdown switcher-dropdown" data-mage-init='{"dropdownDialog":{
28-
"appendTo":"#switcher-currency<?php echo $block->escapeJs($id) ?> > .options",
29-
"triggerTarget":"#switcher-currency-trigger<?php echo $block->escapeJs($id) ?>",
30-
"closeOnMouseLeave": false,
31-
"triggerClass":"active",
32-
"parentClass":"active",
33-
"buttons":null}}'>
31+
<ul class="dropdown switcher-dropdown" data-target="dropdown">
3432
<?php foreach ($currencies as $_code => $_name): ?>
3533
<?php if ($_code != $currentCurrencyCode): ?>
3634
<li class="currency-<?php echo $block->escapeHtmlAttr($_code) ?> switcher-option">

app/code/Magento/Eav/Setup/EavSetup.php

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,35 +1002,36 @@ private function _updateAttributeAdditionalData($entityTypeId, $id, $field, $val
10021002
return $this;
10031003
}
10041004
$additionalTableExists = $this->setup->getConnection()->isTableExists($this->setup->getTable($additionalTable));
1005-
if ($additionalTable && $additionalTableExists) {
1006-
$attributeFields = $this->setup->getConnection()->describeTable($this->setup->getTable($additionalTable));
1007-
if (is_array($field)) {
1008-
$bind = [];
1009-
foreach ($field as $k => $v) {
1010-
if (isset($attributeFields[$k])) {
1011-
$bind[$k] = $this->setup->getConnection()->prepareColumnValue($attributeFields[$k], $v);
1012-
}
1013-
}
1014-
if (!$bind) {
1015-
return $this;
1016-
}
1017-
$field = $bind;
1018-
} else {
1019-
if (!isset($attributeFields[$field])) {
1020-
return $this;
1005+
if (!$additionalTableExists) {
1006+
return $this;
1007+
}
1008+
$attributeFields = $this->setup->getConnection()->describeTable($this->setup->getTable($additionalTable));
1009+
if (is_array($field)) {
1010+
$bind = [];
1011+
foreach ($field as $k => $v) {
1012+
if (isset($attributeFields[$k])) {
1013+
$bind[$k] = $this->setup->getConnection()->prepareColumnValue($attributeFields[$k], $v);
10211014
}
10221015
}
1023-
$this->setup->updateTableRow(
1024-
$this->setup->getTable($additionalTable),
1025-
'attribute_id',
1026-
$this->getAttributeId($entityTypeId, $id),
1027-
$field,
1028-
$value
1029-
);
1030-
1031-
$attribute = $this->getAttribute($entityTypeId, $id);
1032-
$this->updateCachedRow($field, $value, $attribute);
1016+
if (!$bind) {
1017+
return $this;
1018+
}
1019+
$field = $bind;
1020+
} else {
1021+
if (!isset($attributeFields[$field])) {
1022+
return $this;
1023+
}
10331024
}
1025+
$this->setup->updateTableRow(
1026+
$this->setup->getTable($additionalTable),
1027+
'attribute_id',
1028+
$this->getAttributeId($entityTypeId, $id),
1029+
$field,
1030+
$value
1031+
);
1032+
1033+
$attribute = $this->getAttribute($entityTypeId, $id);
1034+
$this->updateCachedRow($field, $value, $attribute);
10341035

10351036
return $this;
10361037
}

app/code/Magento/Sales/Model/ResourceModel/Order/Status.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
* @author Magento Core Team <[email protected]>
1919
*/
20-
class Status extends \Magento\Framework\Model\ResourceModel\Db\VersionControl\AbstractDb
20+
class Status extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
2121
{
2222
/**
2323
* Status labels table

0 commit comments

Comments
 (0)