Skip to content

Commit 53fd511

Browse files
author
Mykhailo Miroshnikov
committed
Merge branch 'develop' into MAGETWO-34476
2 parents 9ab377b + f65cbac commit 53fd511

File tree

108 files changed

+3446
-1037
lines changed

Some content is hidden

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

108 files changed

+3446
-1037
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ atlassian*
2020
/lib/internal/flex/varien/.project
2121
/lib/internal/flex/varien/.settings
2222
/node_modules
23+
/.grunt
2324

2425
/pub/media/*.*
2526
!/pub/media/.htaccess

app/code/Magento/Bundle/view/base/web/js/price-bundle.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ define([
2222
' +<%- finalPrice.formatted %>' +
2323
'<% } %>',
2424
controlContainer: 'dd', // should be eliminated
25-
priceFormat: {}
25+
priceFormat: {},
26+
isFixedPrice: false
2627
};
2728

2829
$.widget('mage.priceBundle', {
@@ -116,17 +117,17 @@ define([
116117
*/
117118
_applyQtyFix: function applyQtyFix() {
118119
var config = this.options.optionConfig;
119-
_.each(config.options, function (option) {
120-
_.each(option.selections, function (item) {
121-
if (item.priceType === '0') {
120+
if (config.isFixedPrice) {
121+
_.each(config.options, function (option) {
122+
_.each(option.selections, function (item) {
122123
if (item.qty && item.qty !== 1) {
123124
_.each(item.prices, function (price) {
124125
price.amount = price.amount / item.qty;
125126
});
126127
}
127-
}
128+
});
128129
});
129-
});
130+
}
130131
},
131132

132133
/**

app/code/Magento/Catalog/Pricing/Price/TierPrice.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ protected function filterTierPrices(array $priceList)
162162
$qtyCache = [];
163163
foreach ($priceList as $priceKey => $price) {
164164
/* filter price by customer group */
165-
if ($price['cust_group'] !== $this->customerGroup && $price['cust_group'] !== $this->groupManagement->getAllCustomersGroup()->getId()) {
165+
if ($price['cust_group'] != $this->customerGroup &&
166+
$price['cust_group'] != $this->groupManagement->getAllCustomersGroup()->getId()) {
166167
unset($priceList[$priceKey]);
167168
continue;
168169
}

app/code/Magento/Catalog/view/base/templates/product/price/tier_prices.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ $product = $block->getSaleableItem();
7373
);
7474
?><?php echo __('each') ?>
7575
<?php if ($block->getShowDetailedPrice() !== false): ?>
76-
<?php echo __('and') ?>&nbsp;<strong class="benefit"><?php echo __('save')?>
77-
<span class="percent tier-<?php echo $index ?>"><?php echo $tierPriceModel->getSavePercent($price['price']) ?></span>%
76+
&nbsp;<?php echo __('and') ?>&nbsp;<strong class="benefit"><?php echo __('save')?>
77+
<span class="percent tier-<?php echo $index ?>">&nbsp;<?php echo $tierPriceModel->getSavePercent($price['price']) ?></span>%
7878
</strong>
7979
<?php endif ?>
8080
<?php endif; ?>

app/code/Magento/Config/Controller/Adminhtml/System/Config/Save.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ protected function _getGroupsForSave()
7272
$groups = $this->getRequest()->getPost('groups');
7373
$files = $this->getRequest()->getFiles('groups');
7474

75-
if (isset($files['name']) && is_array($files['name'])) {
75+
if ($files && is_array($files)) {
7676
/**
7777
* Carefully merge $_FILES and $_POST information
7878
* None of '+=' or 'array_merge_recursive' can do this correct
7979
*/
80-
foreach ($files['name'] as $groupName => $group) {
80+
foreach ($files as $groupName => $group) {
8181
$data = $this->_processNestedGroups($group);
8282
if (!empty($data)) {
8383
if (!empty($groups[$groupName])) {

app/code/Magento/Config/Test/Unit/Controller/Adminhtml/System/Config/_files/files_array.php

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,33 @@
55
*/
66

77
return [
8-
'name' => [
9-
'group.1' => [
10-
'fields' => ['f1.1' => ['value' => 'f1.1.val'], 'f1.2' => ['value' => 'f1.2.val']],
8+
'group.1' => [
9+
'fields' => ['f1.1' => ['value' => 'f1.1.val'], 'f1.2' => ['value' => 'f1.2.val']],
10+
],
11+
'group.2' => [
12+
'fields' => [
13+
'f2.1' => ['value' => 'f2.1.val'],
14+
'f2.2' => ['value' => 'f2.2.val'],
15+
'f2.3' => ['value' => ''],
1116
],
12-
'group.2' => [
13-
'fields' => [
14-
'f2.1' => ['value' => 'f2.1.val'],
15-
'f2.2' => ['value' => 'f2.2.val'],
16-
'f2.3' => ['value' => ''],
17-
],
18-
'groups' => [
19-
'group.2.1' => [
20-
'fields' => [
21-
'f2.1.1' => ['value' => 'f2.1.1.val'],
22-
'f2.1.2' => ['value' => 'f2.1.2.val'],
23-
'f2.1.3' => ['value' => ''],
24-
],
25-
'groups' => [
26-
'group.2.1.1' => [
27-
'fields' => [
28-
'f2.1.1.1' => ['value' => 'f2.1.1.1.val'],
29-
'f2.1.1.2' => ['value' => 'f2.1.1.2.val'],
30-
'f2.1.1.3' => ['value' => ''],
31-
],
17+
'groups' => [
18+
'group.2.1' => [
19+
'fields' => [
20+
'f2.1.1' => ['value' => 'f2.1.1.val'],
21+
'f2.1.2' => ['value' => 'f2.1.2.val'],
22+
'f2.1.3' => ['value' => ''],
23+
],
24+
'groups' => [
25+
'group.2.1.1' => [
26+
'fields' => [
27+
'f2.1.1.1' => ['value' => 'f2.1.1.1.val'],
28+
'f2.1.1.2' => ['value' => 'f2.1.1.2.val'],
29+
'f2.1.1.3' => ['value' => ''],
3230
],
3331
],
3432
],
3533
],
3634
],
37-
'group.3' => 'some.data',
38-
]
35+
],
36+
'group.3' => 'some.data',
3937
];
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Developer\Model\Config\Source;
7+
8+
use Magento\Framework\App\State;
9+
use Magento\Framework\Option\ArrayInterface;
10+
11+
/**
12+
* Class WorkflowType
13+
*
14+
* @package Magento\Developer\Model\Config\Source
15+
*/
16+
class WorkflowType implements ArrayInterface
17+
{
18+
/**
19+
* Constant for
20+
*/
21+
const CONFIG_NAME_PATH = 'dev/front_end_development_workflow/type';
22+
23+
/**
24+
* Constant for server side compilation workflow
25+
*/
26+
const SERVER_SIDE_COMPILATION = 'server_side_compilation';
27+
28+
/**
29+
* Constant for client side compilation workflow
30+
*/
31+
const CLIENT_SIDE_COMPILATION = 'client_side_compilation';
32+
33+
/**
34+
* Return list of Workflow types
35+
*
36+
* @return array Format: array(array('value' => '<value>', 'label' => '<label>'), ...)
37+
*/
38+
public function toOptionArray()
39+
{
40+
return [
41+
['value' => self::CLIENT_SIDE_COMPILATION, 'label' => __('Client side less compilation')],
42+
['value' => self::SERVER_SIDE_COMPILATION, 'label' => __('Server side less compilation')]
43+
];
44+
}
45+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Developer\Model\View\Asset\PreProcessor;
7+
8+
use Magento\Framework\View\Asset\PreProcessor\Chain;
9+
use Magento\Framework\View\Asset\LocalInterface;
10+
11+
class DeveloperChain extends Chain
12+
{
13+
/**
14+
* @param LocalInterface $asset
15+
* @param string $origContent
16+
* @param string $origContentType
17+
* @param null $origAssetPath
18+
*/
19+
public function __construct(
20+
LocalInterface $asset,
21+
$origContent,
22+
$origContentType,
23+
$origAssetPath = null
24+
) {
25+
parent::__construct(
26+
$asset,
27+
$origContent,
28+
$origContentType
29+
);
30+
31+
$this->targetContentType = $this->origContentType;
32+
$this->targetAssetPath = $origAssetPath;
33+
}
34+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Developer\Model\View\Asset\PreProcessor;
7+
8+
use Magento\Framework\App\Config\ScopeConfigInterface;
9+
use Magento\Framework\View\Asset\PreProcessor\ChainFactory;
10+
use Magento\Framework\View\Asset\PreProcessor\ChainFactoryInterface;
11+
use Magento\Framework\ObjectManagerInterface;
12+
use Magento\Developer\Model\Config\Source\WorkflowType;
13+
14+
class DeveloperChainFactory implements ChainFactoryInterface
15+
{
16+
/**
17+
* Object manager
18+
*
19+
* @var ObjectManagerInterface
20+
*/
21+
private $_objectManager;
22+
23+
/**
24+
* @var ChainFactory
25+
*/
26+
private $chainFactory;
27+
28+
/**
29+
* @var ScopeConfigInterface
30+
*/
31+
private $scopeConfig;
32+
33+
/**
34+
* @param ObjectManagerInterface $objectManager
35+
* @param ChainFactory $chainFactory
36+
* @param ScopeConfigInterface $scopeConfig
37+
*/
38+
public function __construct(
39+
ObjectManagerInterface $objectManager,
40+
ChainFactory $chainFactory,
41+
ScopeConfigInterface $scopeConfig
42+
) {
43+
$this->_objectManager = $objectManager;
44+
$this->chainFactory = $chainFactory;
45+
$this->scopeConfig = $scopeConfig;
46+
}
47+
48+
/**
49+
* {inheritdoc}
50+
*/
51+
public function create(array $arguments = [])
52+
{
53+
if (WorkflowType::CLIENT_SIDE_COMPILATION === $this->scopeConfig->getValue(WorkflowType::CONFIG_NAME_PATH)) {
54+
return $this->_objectManager->create(
55+
'Magento\Developer\Model\View\Asset\PreProcessor\DeveloperChain',
56+
$arguments
57+
);
58+
}
59+
return $this->chainFactory->create($arguments);
60+
}
61+
}

0 commit comments

Comments
 (0)