Skip to content

Commit

Permalink
MAGETWO-32341: [GITHUB] Configurable product attribute scope #866
Browse files Browse the repository at this point in the history
  • Loading branch information
igrybkov committed Jan 19, 2015
1 parent 031f7d0 commit 1bcd926
Show file tree
Hide file tree
Showing 23 changed files with 37 additions and 153 deletions.
8 changes: 0 additions & 8 deletions app/code/Magento/Catalog/Api/Data/EavAttributeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ interface EavAttributeInterface extends \Magento\Eav\Api\Data\AttributeInterface

const APPLY_TO = 'apply_to';

const IS_CONFIGURABLE = 'is_configurable';

const IS_SEARCHABLE = 'is_searchable';

const IS_VISIBLE_IN_ADVANCED_SEARCH = 'is_visible_in_advanced_search';
Expand Down Expand Up @@ -95,12 +93,6 @@ public function getPosition();
*/
public function getApplyTo();

/**
* Whether the attribute can be used for configurable products
*
* @return string|null
*/
public function getIsConfigurable();
/**
* Whether the attribute can be used in Quick Search
*
Expand Down
8 changes: 0 additions & 8 deletions app/code/Magento/Catalog/Model/Category/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,6 @@ public function getIsSearchable()
return $this->getData(self::IS_SEARCHABLE);
}

/**
* {@inheritdoc}
*/
public function getIsConfigurable()
{
return $this->getData(self::IS_CONFIGURABLE);
}

/**
* {@inheritdoc}
*/
Expand Down
8 changes: 0 additions & 8 deletions app/code/Magento/Catalog/Model/Resource/Eav/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -536,14 +536,6 @@ public function getPosition()
return $this->getData(self::POSITION);
}

/**
* {@inheritdoc}
*/
public function getIsConfigurable()
{
return $this->getData(self::IS_CONFIGURABLE);
}

/**
* {@inheritdoc}
*/
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ public function canUseAttribute(\Magento\Catalog\Model\Resource\Eav\Attribute $a
{
return $attribute->getIsGlobal() == \Magento\Catalog\Model\Resource\Eav\Attribute::SCOPE_GLOBAL &&
$attribute->getIsVisible() &&
$attribute->getIsConfigurable() &&
$attribute->usesSource() &&
$attribute->getIsUserDefined();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ public function getSuggestedAttributes($labelPart)
)->addFieldToFilter(
'frontend_label',
['like' => $escapedLabelPart]
)->addFieldToFilter(
'is_configurable',
[["eq" => 1], ['null' => true]]
)->addFieldToFilter(
'is_user_defined',
1
Expand Down
12 changes: 0 additions & 12 deletions app/code/Magento/ConfigurableProduct/etc/adminhtml/events.xml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
/**
*
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
*/

$installer = $this;
/* @var $installer \Magento\Catalog\Model\Resource\Setup */

$installer->startSetup();

$table = $installer->getConnection()
->dropColumn(
$installer->getTable('catalog_eav_attribute'),
'is_configurable'

);

$installer->endSetup();
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@
<is_unique>
<input>select</input>
</is_unique>
<is_configurable>
<input>select</input>
</is_configurable>
</fields>
</advanced-properties>
<manage-labels>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@
<is_unique>
<input>select</input>
</is_unique>
<is_configurable>
<input>select</input>
</is_configurable>
</fields>
</advanced-properties>
<manage-labels>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,15 +322,6 @@ class CatalogProductAttribute extends InjectableFixture
'input' => '',
];

protected $is_configurable = [
'attribute_code' => 'is_configurable',
'backend_type' => 'smallint',
'is_required' => '',
'default_value' => '',
'input' => '',
'group' => 'advanced-properties',
];

protected $search_weight = [
'attribute_code' => 'search_weight',
'backend_type' => 'smallint',
Expand Down Expand Up @@ -563,11 +554,6 @@ public function getIsUsedForPromoRules()
return $this->getData('is_used_for_promo_rules');
}

public function getIsConfigurable()
{
return $this->getData('is_configurable');
}

public function getSearchWeight()
{
return $this->getData('search_weight');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,13 +248,6 @@
<default_value>0</default_value>
<input></input>
</is_used_for_promo_rules>
<is_configurable>
<attribute_code>is_configurable</attribute_code>
<backend_type>smallint</backend_type>
<is_required></is_required>
<default_value></default_value>
<input></input>
</is_configurable>
<search_weight>
<attribute_code>search_weight</attribute_code>
<backend_type>smallint</backend_type>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,6 @@ protected function _initData()
'input_value' => 'select',
'group' => self::GROUP_PRODUCT_ATTRIBUTE_MAIN,
],
'is_configurable' => [
'value' => 'Yes',
'input' => 'select',
'input_value' => 1,
'group' => self::GROUP_PRODUCT_ATTRIBUTE_MAIN,
],
'is_searchable' => [
'value' => 'Yes',
'input' => 'select',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ class Curl extends AbstractCurl implements CatalogProductAttributeInterface
'Yes' => 1,
'No' => 0,
],
'is_configurable' => [
'Yes' => 1,
'No' => 0,
],
];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public function __construct(array $defaultConfig = [], array $defaultData = [])
'attribute_code' => 'attribute_dropdown%isolation%',
'frontend_input' => 'Dropdown',
'is_required' => 'No',
'is_configurable' => 'Yes',
'options' => [
[
'is_default' => 'Yes',
Expand All @@ -62,7 +61,6 @@ public function __construct(array $defaultConfig = [], array $defaultData = [])
'attribute_code' => 'attribute_dropdown%isolation%',
'frontend_input' => 'Dropdown',
'is_required' => 'No',
'is_configurable' => 'Yes',
'options' => [
[
'is_default' => 'Yes',
Expand All @@ -82,7 +80,6 @@ public function __construct(array $defaultConfig = [], array $defaultData = [])
'attribute_code' => 'attribute_dropdown%isolation%',
'frontend_input' => 'Dropdown',
'is_required' => 'No',
'is_configurable' => 'Yes',
'options' => [
[
'is_default' => 'Yes',
Expand All @@ -97,7 +94,6 @@ public function __construct(array $defaultConfig = [], array $defaultData = [])
'attribute_code' => 'color_%isolation%',
'frontend_input' => 'Dropdown',
'is_required' => 'No',
'is_configurable' => 'Yes',
'options' => [
[
'is_default' => 'Yes',
Expand All @@ -117,7 +113,6 @@ public function __construct(array $defaultConfig = [], array $defaultData = [])
'attribute_code' => 'size_%isolation%',
'frontend_input' => 'Dropdown',
'is_required' => 'No',
'is_configurable' => 'Yes',
'options' => [
[
'is_default' => 'Yes',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public function __construct(array $defaultConfig = [], array $defaultData = [])
*/
protected function buildNewAttributeData(array $defaultData)
{
unset($defaultData['fields']['is_configurable']);
unset($defaultData['fields']['attribute_code']);
return $defaultData;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"attribute/data/frontend_label";"attribute/data/frontend_input";"attribute/data/options/preset";"attribute/data/is_required";"attribute/data/attribute_code";"attribute/data/is_global";"attribute/data/default_value_text";"attribute/data/default_value_textarea";"attribute/data/is_unique";"attribute/data/is_configurable";"attribute/data/manage_frontend_label";"attribute/data/is_searchable";"attribute/data/is_visible_in_advanced_search";"attribute/data/is_comparable";"attribute/data/is_filterable";"attribute/data/is_filterable_in_search";"attribute/data/is_used_for_promo_rules";"attribute/data/is_html_allowed_on_front";"attribute/data/is_visible_on_front";"attribute/data/used_in_product_listing";"attribute/data/used_for_sort_by";"constraint"
"Text_Field_Admin_%isolation%";"Text Field";"-";"No";"attr_text_%isolation%";"Global";"<b><i>default_value_text%isolation%</i></b>";"-";"Yes";"-";"-";"Yes";"Yes";"Yes";"-";"-";"-";"Yes";"Yes";"-";"Yes";"assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsGlobal, assertProductAttributeDisplayingOnFrontend, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsComparable, assertProductAttributeIsHtmlAllowed, assertProductAttributeIsUsedInSortOnFrontend"
"Dropdown_Admin_%isolation%";"Dropdown";"default";"No";"attr_dropdown_%isolation%";"Global";"-";"-";"-";"Yes";"-";"-";"-";"-";"Filterable (with results)";"Yes";"-";"-";"-";"-";"-";"assertProductAttributeIsFilterable, assertProductAttributeIsFilterableInSearch, assertProductAttributeIsConfigurable"
"Text_Field_Admin_%isolation%";"Text Field";"-";"Yes";"attr_text_%isolation%";"-";"default_value_text%isolation%";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeIsRequired"
"Text_Field_Admin_%isolation%";"Text Field";"-";"No";"attr_text_%isolation%";"-";"default_value_text%isolation%";"-";"Yes";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"-";"assertProductAttributeIsUnique"
attribute/data/frontend_label;attribute/data/frontend_input;attribute/data/options/preset;attribute/data/is_required;attribute/data/attribute_code;attribute/data/is_global;attribute/data/default_value_text;attribute/data/default_value_textarea;attribute/data/is_unique;attribute/data/manage_frontend_label;attribute/data/is_searchable;attribute/data/is_visible_in_advanced_search;attribute/data/is_comparable;attribute/data/is_filterable;attribute/data/is_filterable_in_search;attribute/data/is_used_for_promo_rules;attribute/data/is_html_allowed_on_front;attribute/data/is_visible_on_front;attribute/data/used_in_product_listing;attribute/data/used_for_sort_by;constraint
Text_Field_Admin_%isolation%;Text Field;-;No;attr_text_%isolation%;Global;<b><i>default_value_text%isolation%</i></b>;-;Yes;-;Yes;Yes;Yes;-;-;-;Yes;Yes;-;Yes;assertProductAttributeInGrid, assertAttributeForm, assertAddedProductAttributeOnProductForm, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsGlobal, assertProductAttributeDisplayingOnFrontend, assertProductAttributeDisplayingOnSearchForm, assertProductAttributeIsComparable, assertProductAttributeIsHtmlAllowed, assertProductAttributeIsUsedInSortOnFrontend
Dropdown_Admin_%isolation%;Dropdown;default;No;attr_dropdown_%isolation%;Global;-;-;-;-;-;-;-;Filterable (with results);Yes;-;-;-;-;-;assertProductAttributeIsFilterable, assertProductAttributeIsFilterableInSearch, assertProductAttributeIsConfigurable
Text_Field_Admin_%isolation%;Text Field;-;Yes;attr_text_%isolation%;-;default_value_text%isolation%;-;-;-;-;-;-;-;-;-;-;-;-;-;assertProductAttributeIsRequired
Text_Field_Admin_%isolation%;Text Field;-;No;attr_text_%isolation%;-;default_value_text%isolation%;-;Yes;-;-;-;-;-;-;-;-;-;-;-;assertProductAttributeIsUnique
Loading

0 comments on commit 1bcd926

Please sign in to comment.