Skip to content

Commit f0645fb

Browse files
committed
Merge pull request #244 from magento-dragons/develop
[DRAGONS] Sprint 77 - Bugs and MultiLocationInventory
2 parents 5a4ffe9 + 808e56b commit f0645fb

File tree

45 files changed

+828
-510
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

+828
-510
lines changed

app/code/Magento/Catalog/view/frontend/web/js/product/list/toolbar.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,16 @@ define([
6161
},
6262

6363
changeUrl: function (paramName, paramValue, defaultValue) {
64+
var decode = window.decodeURIComponent;
6465
var urlPaths = this.options.url.split('?'),
6566
baseUrl = urlPaths[0],
6667
urlParams = urlPaths[1] ? urlPaths[1].split('&') : [],
6768
paramData = {},
6869
parameters;
6970
for (var i = 0; i < urlParams.length; i++) {
7071
parameters = urlParams[i].split('=');
71-
paramData[parameters[0]] = parameters[1] !== undefined
72-
? window.decodeURIComponent(parameters[1].replace(/\+/g, '%20'))
72+
paramData[decode(parameters[0])] = parameters[1] !== undefined
73+
? decode(parameters[1].replace(/\+/g, '%20'))
7374
: '';
7475
}
7576
paramData[paramName] = paramValue;

app/code/Magento/CatalogSearch/view/frontend/templates/advanced/result.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<?php else: ?>
2424
<div class="message error">
2525
<div>
26-
<?php /* @escapeNotVerified */ echo __('We can\'t find any items matching these search criteria.');?> <a href="<?php /* @escapeNotVerified */ echo $block->getFormUrl(); ?>"><?php /* @escapeNotVerified */ echo __('Modify your search'); ?></a>
26+
<?php /* @escapeNotVerified */ echo __('We can\'t find any items matching these search criteria.');?> <a href="<?php /* @escapeNotVerified */ echo $block->getFormUrl(); ?>"><?php /* @escapeNotVerified */ echo __('Modify your search.'); ?></a>
2727
</div>
2828
</div>
2929
<?php endif; ?>
@@ -44,7 +44,7 @@
4444
<div class="message notice">
4545
<div>
4646
<?php /* @escapeNotVerified */ echo __("Don't see what you're looking for?"); ?>
47-
<a href="<?php /* @escapeNotVerified */ echo $block->getFormUrl(); ?>"><?php /* @escapeNotVerified */ echo __('Modify your search'); ?></a>
47+
<a href="<?php /* @escapeNotVerified */ echo $block->getFormUrl(); ?>"><?php /* @escapeNotVerified */ echo __('Modify your search.'); ?></a>
4848
</div>
4949
</div>
5050
<?php endif; ?>

app/code/Magento/ConfigurableProduct/Controller/Adminhtml/Product/Initialization/Helper/Plugin/Configurable.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ public function afterInitialize(
5151
$attributes = $this->request->getParam('attributes');
5252
if ($product->getTypeId() == ConfigurableProduct::TYPE_CODE && !empty($attributes)) {
5353
$setId = $this->request->getPost('new-variations-attribute-set-id');
54-
$product->setAttributeSetId($setId);
54+
if ($setId) {
55+
$product->setAttributeSetId($setId);
56+
}
5557
$this->productType->setUsedProductAttributeIds($attributes, $product);
5658

5759
$product->setNewVariationsAttributeSetId($setId);

app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable/Price.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ public function getFinalPrice($qty, $product)
2222
return $product->getCalculatedFinalPrice();
2323
}
2424
if ($product->getCustomOption('simple_product') && $product->getCustomOption('simple_product')->getProduct()) {
25-
return parent::getFinalPrice($qty, $product->getCustomOption('simple_product')->getProduct());
25+
$finalPrice = parent::getFinalPrice($qty, $product->getCustomOption('simple_product')->getProduct());
2626
} else {
2727
$priceInfo = $product->getPriceInfo();
2828
$finalPrice = $priceInfo->getPrice('final_price')->getAmount()->getValue();
29-
$finalPrice = $this->_applyOptionsPrice($product, $qty, $finalPrice);
30-
$finalPrice = max(0, $finalPrice);
31-
$product->setFinalPrice($finalPrice);
32-
33-
return $finalPrice;
3429
}
30+
$finalPrice = $this->_applyOptionsPrice($product, $qty, $finalPrice);
31+
$finalPrice = max(0, $finalPrice);
32+
$product->setFinalPrice($finalPrice);
33+
34+
return $finalPrice;
3535
}
3636

3737
/**

app/code/Magento/ConfigurableProduct/Ui/Component/Listing/AssociatedProduct/Filters.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ public function update(UiComponentInterface $component)
4343
return;
4444
}
4545

46-
$attributeIds = $component->getContext()->getRequestParam('attribute_ids');
47-
if ($attributeIds) {
48-
foreach ($this->getAttributes($attributeIds) as $attribute) {
46+
$attributeCodes = $component->getContext()->getRequestParam('attributes_codes');
47+
if ($attributeCodes) {
48+
foreach ($this->getAttributes($attributeCodes) as $attribute) {
4949
$filter = $this->filterFactory->create($attribute, $component->getContext());
5050
$filter->prepare();
5151
$component->addComponent($attribute->getAttributeCode(), $filter);
@@ -54,12 +54,12 @@ public function update(UiComponentInterface $component)
5454
}
5555

5656
/**
57-
* @param array $attributeIds
57+
* @param array $attributeCodes
5858
* @return mixed
5959
*/
60-
protected function getAttributes($attributeIds)
60+
protected function getAttributes($attributeCodes)
6161
{
6262
$attributeCollection = $this->attributeCollectionFactory->create();
63-
return $attributeCollection->addFieldToFilter('attribute_code', ['in' => $attributeIds]);
63+
return $attributeCollection->addFieldToFilter('attribute_code', ['in' => $attributeCodes]);
6464
}
6565
}

app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/options/price-type-handler.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ define([
2727
}
2828
this.hideWarning();
2929
$(this.messageSelector).notification('add', {
30-
message: $.mage.__('We can\'t save custom-defined options with price type "percent" for ' +
30+
message: $.mage.__('Custom options with price type "percent" is not available for ' +
3131
'configurable product.'),
32-
error: true,
32+
error: false,
3333
messageContainer: this.messageSelector
3434
});
3535
},

app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/product-grid.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ define([
245245
}),
246246
usedProductIds = _.values(this.variationsComponent().productAttributesMap);
247247

248-
if (usedProductIds) {
248+
if (usedProductIds && usedProductIds.length > 0) {
249249
filterModifier['entity_id'] = {
250250
'condition_type': 'nin', value: usedProductIds
251251
};

app/code/Magento/Search/Model/Query.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,12 @@ public function getSuggestCollection()
172172
public function loadByQuery($text)
173173
{
174174
$this->_getResource()->loadByQuery($this, $text);
175+
176+
$synonymFor = $this->getSynonymFor();
177+
if (!empty($synonymFor)) {
178+
$this->setQueryText($synonymFor);
179+
}
180+
175181
$this->_afterLoad();
176182
$this->setOrigData();
177183
return $this;

0 commit comments

Comments
 (0)