Skip to content

Commit 79e52a6

Browse files
author
Igor Melnikov
committed
Merge branch 'upstream-develop' into MAGETWO-47449-product-import-export
2 parents e054606 + 5481fac commit 79e52a6

File tree

94 files changed

+1425
-1523
lines changed

Some content is hidden

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

94 files changed

+1425
-1523
lines changed

app/code/Magento/Authorizenet/view/frontend/web/template/payment/authorizenet-directpost.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
allowtransparency="true"
3030
frameborder="0"
3131
name="iframeTransparent"
32-
style="display:none;width:100%;background-color:transparent">
32+
class="payment-method-iframe">
3333

3434
</iframe>
3535
<form class="form" id="co-transparent-form" action="#" method="post" data-bind="mageInit: {

app/code/Magento/BraintreeTwo/Block/Paypal/Button.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Magento\BraintreeTwo\Model\Ui\ConfigProvider;
1313
use Magento\Framework\View\Element\Template\Context;
1414
use Magento\BraintreeTwo\Gateway\Config\PayPal\Config;
15+
use Magento\Payment\Model\MethodInterface;
1516

1617
/**
1718
* Class Button
@@ -42,6 +43,11 @@ class Button extends Template implements ShortcutInterface
4243
*/
4344
private $configProvider;
4445

46+
/**
47+
* @var MethodInterface
48+
*/
49+
private $payment;
50+
4551
/**
4652
* Constructor
4753
*
@@ -50,6 +56,7 @@ class Button extends Template implements ShortcutInterface
5056
* @param Session $checkoutSession
5157
* @param Config $config
5258
* @param ConfigProvider $configProvider
59+
* @param MethodInterface $payment
5360
* @param array $data
5461
*/
5562
public function __construct(
@@ -58,6 +65,7 @@ public function __construct(
5865
Session $checkoutSession,
5966
Config $config,
6067
ConfigProvider $configProvider,
68+
MethodInterface $payment,
6169
array $data = []
6270
) {
6371
parent::__construct($context, $data);
@@ -66,6 +74,7 @@ public function __construct(
6674
$this->checkoutSession = $checkoutSession;
6775
$this->config = $config;
6876
$this->configProvider = $configProvider;
77+
$this->payment = $payment;
6978
}
7079

7180
/**
@@ -125,7 +134,8 @@ public function getAmount()
125134
*/
126135
public function isActive()
127136
{
128-
return $this->config->isActive() && $this->config->isDisplayShoppingCart();
137+
return $this->payment->isAvailable($this->checkoutSession->getQuote()) &&
138+
$this->config->isDisplayShoppingCart();
129139
}
130140

131141
/**

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
<item name="alias" xsi:type="string">braintree.paypal.mini-cart</item>
5050
<item name="button_id" xsi:type="string">braintree-paypal-mini-cart</item>
5151
</argument>
52+
<argument name="payment" xsi:type="object">BraintreeTwoPayPalFacade</argument>
5253
</arguments>
5354
</type>
5455
</config>

app/code/Magento/Bundle/Test/Unit/Ui/DataProvider/Product/Form/Modifier/BundleSkuTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
namespace Magento\Bundle\Test\Unit\Ui\DataProvider\Product\Form\Modifier;
77

88
use Magento\Bundle\Ui\DataProvider\Product\Form\Modifier\BundleSku;
9-
use Magento\Catalog\Model\AttributeConstantsInterface;
9+
use Magento\Catalog\Api\Data\ProductAttributeInterface;
1010

1111
/**
1212
* Class BundleSkuTest
@@ -31,7 +31,7 @@ public function testModifyMeta()
3131
$sourceMeta = [
3232
'testGroup' => [
3333
'children' => [
34-
AttributeConstantsInterface::CODE_SKU => [
34+
ProductAttributeInterface::CODE_SKU => [
3535
'componentType' => 'testComponent',
3636
],
3737
]

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundleAdvancedPricing.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
*/
66
namespace Magento\Bundle\Ui\DataProvider\Product\Form\Modifier;
77

8+
use Magento\Catalog\Api\Data\ProductAttributeInterface;
89
use Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\AbstractModifier;
9-
use Magento\Catalog\Model\AttributeConstantsInterface as Constants;
1010

1111
/**
1212
* Customize Advanced Pricing modal panel
@@ -32,13 +32,15 @@ public function modifyMeta(array $meta)
3232
unset($parentNode['container_' . self::CODE_MSRP]);
3333
unset($parentNode['container_' . self::CODE_MSRP_DISPLAY_ACTUAL_PRICE_TYPE]);
3434
}
35-
if (isset($parentNode['container_' . Constants::CODE_SPECIAL_PRICE])) {
36-
$currentNode = &$parentNode['container_' . Constants::CODE_SPECIAL_PRICE]['children'];
37-
$currentNode[Constants::CODE_SPECIAL_PRICE]['arguments']['data']['config']['addbefore'] = "%";
35+
if (isset($parentNode['container_' . ProductAttributeInterface::CODE_SPECIAL_PRICE])) {
36+
$currentNode = &$parentNode['container_' . ProductAttributeInterface::CODE_SPECIAL_PRICE]['children'];
37+
$currentNode[ProductAttributeInterface::CODE_SPECIAL_PRICE]['arguments']['data']['config']['addbefore']
38+
= "%";
3839
}
39-
$parentNodeChildren = &$parentNode[Constants::CODE_TIER_PRICE]['children'];
40-
if (isset( $parentNodeChildren[self::CODE_RECORD]['children'][Constants::CODE_PRICE])) {
41-
$currentNode = &$parentNodeChildren[self::CODE_RECORD]['children'][Constants::CODE_PRICE];
40+
$parentNodeChildren = &$parentNode[ProductAttributeInterface::CODE_TIER_PRICE]['children'];
41+
if (isset($parentNodeChildren[self::CODE_RECORD]['children'][ProductAttributeInterface::CODE_PRICE])) {
42+
$currentNode =
43+
&$parentNodeChildren[self::CODE_RECORD]['children'][ProductAttributeInterface::CODE_PRICE];
4244
$currentNode['arguments']['data']['config']['label'] = __('Percent Discount');
4345
}
4446
}

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundlePrice.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
*/
66
namespace Magento\Bundle\Ui\DataProvider\Product\Form\Modifier;
77

8+
use Magento\Catalog\Api\Data\ProductAttributeInterface;
89
use Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\AbstractModifier;
9-
use Magento\Catalog\Model\AttributeConstantsInterface;
1010
use Magento\Ui\Component\Form;
1111
use Magento\Framework\Stdlib\ArrayManager;
1212
use Magento\Catalog\Model\Locator\LocatorInterface;
@@ -49,11 +49,11 @@ public function __construct(
4949
*/
5050
public function modifyMeta(array $meta)
5151
{
52-
if ($groupCode = $this->getGroupCodeByField($meta, AttributeConstantsInterface::CODE_PRICE)
52+
if ($groupCode = $this->getGroupCodeByField($meta, ProductAttributeInterface::CODE_PRICE)
5353
?: $this->getGroupCodeByField($meta, self::CODE_GROUP_PRICE)
5454
) {
5555
$isNewProduct = ($this->locator->getProduct()->getId()) ? false : true;
56-
$pricePath = $this->getElementArrayPath($meta, AttributeConstantsInterface::CODE_PRICE)
56+
$pricePath = $this->getElementArrayPath($meta, ProductAttributeInterface::CODE_PRICE)
5757
?: $this->getElementArrayPath($meta, self::CODE_GROUP_PRICE);
5858

5959
$meta[$groupCode]['children'][self::CODE_PRICE_TYPE] = [
@@ -91,7 +91,7 @@ public function modifyMeta(array $meta)
9191
$meta[$groupCode]['children'][self::CODE_GROUP_PRICE],
9292
[
9393
'children' => [
94-
AttributeConstantsInterface::CODE_PRICE => [
94+
ProductAttributeInterface::CODE_PRICE => [
9595
'arguments' => [
9696
'data' => [
9797
'config' => [

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundleSku.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
*/
66
namespace Magento\Bundle\Ui\DataProvider\Product\Form\Modifier;
77

8+
use Magento\Catalog\Api\Data\ProductAttributeInterface;
89
use Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\AbstractModifier;
9-
use Magento\Catalog\Model\AttributeConstantsInterface;
1010
use Magento\Ui\Component\Form;
1111
use Magento\Framework\Stdlib\ArrayManager;
1212

@@ -36,15 +36,15 @@ public function __construct(ArrayManager $arrayManager)
3636
*/
3737
public function modifyMeta(array $meta)
3838
{
39-
if ($groupCode = $this->getGroupCodeByField($meta, AttributeConstantsInterface::CODE_SKU)) {
40-
$skuPath = $this->getElementArrayPath($meta, AttributeConstantsInterface::CODE_SKU);
39+
if ($groupCode = $this->getGroupCodeByField($meta, ProductAttributeInterface::CODE_SKU)) {
40+
$skuPath = $this->getElementArrayPath($meta, ProductAttributeInterface::CODE_SKU);
4141
$meta[$groupCode]['children'][self::CODE_SKU_TYPE] = [
4242
'arguments' => [
4343
'data' => [
4444
'config' => [
4545
'sortOrder' => $this->getNextAttributeSortOrder(
4646
$meta,
47-
[AttributeConstantsInterface::CODE_SKU],
47+
[ProductAttributeInterface::CODE_SKU],
4848
self::SORT_ORDER
4949
),
5050
'formElement' => Form\Element\Checkbox::NAME,

app/code/Magento/Bundle/Ui/DataProvider/Product/Form/Modifier/BundleWeight.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
*/
66
namespace Magento\Bundle\Ui\DataProvider\Product\Form\Modifier;
77

8+
use Magento\Catalog\Api\Data\ProductAttributeInterface;
89
use Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\AbstractModifier;
9-
use Magento\Catalog\Model\AttributeConstantsInterface;
1010
use Magento\Ui\Component\Form;
1111
use Magento\Framework\Stdlib\ArrayManager;
1212

@@ -37,10 +37,10 @@ public function __construct(ArrayManager $arrayManager)
3737
*/
3838
public function modifyMeta(array $meta)
3939
{
40-
if (($groupCode = $this->getGroupCodeByField($meta, AttributeConstantsInterface::CODE_WEIGHT)
40+
if (($groupCode = $this->getGroupCodeByField($meta, ProductAttributeInterface::CODE_WEIGHT)
4141
?: $this->getGroupCodeByField($meta, self::CODE_CONTAINER_WEIGHT))
4242
) {
43-
$weightPath = $this->getElementArrayPath($meta, AttributeConstantsInterface::CODE_WEIGHT)
43+
$weightPath = $this->getElementArrayPath($meta, ProductAttributeInterface::CODE_WEIGHT)
4444
?: $this->getElementArrayPath($meta, self::CODE_CONTAINER_WEIGHT);
4545
$meta[$groupCode]['children'][self::CODE_WEIGHT_TYPE] = [
4646
'arguments' => [
@@ -76,7 +76,7 @@ public function modifyMeta(array $meta)
7676
$meta[$groupCode]['children'][self::CODE_CONTAINER_WEIGHT],
7777
[
7878
'children' => [
79-
AttributeConstantsInterface::CODE_HAS_WEIGHT => [
79+
ProductAttributeInterface::CODE_HAS_WEIGHT => [
8080
'arguments' => [
8181
'data' => [
8282
'config' => [
@@ -93,7 +93,7 @@ public function modifyMeta(array $meta)
9393
$meta[$groupCode]['children'][self::CODE_CONTAINER_WEIGHT],
9494
[
9595
'children' => [
96-
AttributeConstantsInterface::CODE_WEIGHT => [
96+
ProductAttributeInterface::CODE_WEIGHT => [
9797
'arguments' => [
9898
'data' => [
9999
'config' => [

app/code/Magento/Catalog/Api/Data/ProductAttributeInterface.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,21 @@
1212
interface ProductAttributeInterface extends \Magento\Catalog\Api\Data\EavAttributeInterface
1313
{
1414
const ENTITY_TYPE_CODE = 'catalog_product';
15+
const CODE_TIER_PRICE_FIELD_PRICE = 'price';
16+
const CODE_HAS_WEIGHT = 'product_has_weight';
17+
const CODE_SPECIAL_PRICE = 'special_price';
18+
const CODE_PRICE = 'price';
19+
const CODE_TIER_PRICE_FIELD_PRICE_QTY = 'price_qty';
20+
const CODE_SHORT_DESCRIPTION = 'short_description';
21+
const CODE_SEO_FIELD_META_TITLE = 'meta_title';
22+
const CODE_STATUS = 'status';
23+
const CODE_NAME = 'name';
24+
const CODE_SKU = 'sku';
25+
const CODE_SEO_FIELD_META_KEYWORD = 'meta_keyword';
26+
const CODE_DESCRIPTION = 'description';
27+
const CODE_COST = 'cost';
28+
const CODE_SEO_FIELD_URL_KEY = 'url_key';
29+
const CODE_TIER_PRICE = 'tier_price';
30+
const CODE_SEO_FIELD_META_DESCRIPTION = 'meta_description';
31+
const CODE_WEIGHT = 'weight';
1532
}

app/code/Magento/Catalog/Model/AttributeConstantsInterface.php

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

0 commit comments

Comments
 (0)