Magento 2 : Created Custom Product Attribute but Not showing in Configuration Section
I Have Created custom attribute for configurable products. It is Showing in Add configurable Product section.
But I Can't get those attributes in below section.
$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
$eavSetup->addAttribute(
MagentoCatalogModelProduct::ENTITY,
'paper_size',
[
'group' => 'Pricing Calculator',
'type' => 'varchar',
'backend' => '',
'frontend' => '',
'sort_order' => 10,
'label' => 'Card Size',
'input' => 'select',
'class' => '',
'source' => 'LtsMultipleDropdownModelConfigSourceOptionssize',
'global' => MagentoEavModelEntityAttributeScopedAttributeInterface::SCOPE_GLOBAL,
'visible' => true,
'required' => false,
'user_defined' => false,
'default' => '',
'searchable' => true,
'filterable' => true,
'comparable' => false,
'visible_on_front' => true,
'used_in_product_listing' => true,
'unique' => false,
'apply_to'=>'configurable'
]
);
magento-2.1.3 magento-2.1.4
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
|
show 4 more comments
I Have Created custom attribute for configurable products. It is Showing in Add configurable Product section.
But I Can't get those attributes in below section.
$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
$eavSetup->addAttribute(
MagentoCatalogModelProduct::ENTITY,
'paper_size',
[
'group' => 'Pricing Calculator',
'type' => 'varchar',
'backend' => '',
'frontend' => '',
'sort_order' => 10,
'label' => 'Card Size',
'input' => 'select',
'class' => '',
'source' => 'LtsMultipleDropdownModelConfigSourceOptionssize',
'global' => MagentoEavModelEntityAttributeScopedAttributeInterface::SCOPE_GLOBAL,
'visible' => true,
'required' => false,
'user_defined' => false,
'default' => '',
'searchable' => true,
'filterable' => true,
'comparable' => false,
'visible_on_front' => true,
'used_in_product_listing' => true,
'unique' => false,
'apply_to'=>'configurable'
]
);
magento-2.1.3 magento-2.1.4
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Show your custom attribute code
– Priyank
Apr 3 '17 at 8:41
Have you set this attribute in attribute set?
– Rakesh Jesadiya
Apr 3 '17 at 9:07
custom attribute code added.
– Somnath Mondal
Apr 3 '17 at 9:07
Custom Attributes are set in Default Attribute Set.
– Somnath Mondal
Apr 3 '17 at 9:11
are you created product is contains default attribute set?
– Rakesh Jesadiya
Apr 3 '17 at 9:14
|
show 4 more comments
I Have Created custom attribute for configurable products. It is Showing in Add configurable Product section.
But I Can't get those attributes in below section.
$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
$eavSetup->addAttribute(
MagentoCatalogModelProduct::ENTITY,
'paper_size',
[
'group' => 'Pricing Calculator',
'type' => 'varchar',
'backend' => '',
'frontend' => '',
'sort_order' => 10,
'label' => 'Card Size',
'input' => 'select',
'class' => '',
'source' => 'LtsMultipleDropdownModelConfigSourceOptionssize',
'global' => MagentoEavModelEntityAttributeScopedAttributeInterface::SCOPE_GLOBAL,
'visible' => true,
'required' => false,
'user_defined' => false,
'default' => '',
'searchable' => true,
'filterable' => true,
'comparable' => false,
'visible_on_front' => true,
'used_in_product_listing' => true,
'unique' => false,
'apply_to'=>'configurable'
]
);
magento-2.1.3 magento-2.1.4
I Have Created custom attribute for configurable products. It is Showing in Add configurable Product section.
But I Can't get those attributes in below section.
$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
$eavSetup->addAttribute(
MagentoCatalogModelProduct::ENTITY,
'paper_size',
[
'group' => 'Pricing Calculator',
'type' => 'varchar',
'backend' => '',
'frontend' => '',
'sort_order' => 10,
'label' => 'Card Size',
'input' => 'select',
'class' => '',
'source' => 'LtsMultipleDropdownModelConfigSourceOptionssize',
'global' => MagentoEavModelEntityAttributeScopedAttributeInterface::SCOPE_GLOBAL,
'visible' => true,
'required' => false,
'user_defined' => false,
'default' => '',
'searchable' => true,
'filterable' => true,
'comparable' => false,
'visible_on_front' => true,
'used_in_product_listing' => true,
'unique' => false,
'apply_to'=>'configurable'
]
);
magento-2.1.3 magento-2.1.4
magento-2.1.3 magento-2.1.4
edited Apr 3 '17 at 9:06
asked Apr 3 '17 at 7:55
Somnath Mondal
2614
2614
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ yesterday
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Show your custom attribute code
– Priyank
Apr 3 '17 at 8:41
Have you set this attribute in attribute set?
– Rakesh Jesadiya
Apr 3 '17 at 9:07
custom attribute code added.
– Somnath Mondal
Apr 3 '17 at 9:07
Custom Attributes are set in Default Attribute Set.
– Somnath Mondal
Apr 3 '17 at 9:11
are you created product is contains default attribute set?
– Rakesh Jesadiya
Apr 3 '17 at 9:14
|
show 4 more comments
Show your custom attribute code
– Priyank
Apr 3 '17 at 8:41
Have you set this attribute in attribute set?
– Rakesh Jesadiya
Apr 3 '17 at 9:07
custom attribute code added.
– Somnath Mondal
Apr 3 '17 at 9:07
Custom Attributes are set in Default Attribute Set.
– Somnath Mondal
Apr 3 '17 at 9:11
are you created product is contains default attribute set?
– Rakesh Jesadiya
Apr 3 '17 at 9:14
Show your custom attribute code
– Priyank
Apr 3 '17 at 8:41
Show your custom attribute code
– Priyank
Apr 3 '17 at 8:41
Have you set this attribute in attribute set?
– Rakesh Jesadiya
Apr 3 '17 at 9:07
Have you set this attribute in attribute set?
– Rakesh Jesadiya
Apr 3 '17 at 9:07
custom attribute code added.
– Somnath Mondal
Apr 3 '17 at 9:07
custom attribute code added.
– Somnath Mondal
Apr 3 '17 at 9:07
Custom Attributes are set in Default Attribute Set.
– Somnath Mondal
Apr 3 '17 at 9:11
Custom Attributes are set in Default Attribute Set.
– Somnath Mondal
Apr 3 '17 at 9:11
are you created product is contains default attribute set?
– Rakesh Jesadiya
Apr 3 '17 at 9:14
are you created product is contains default attribute set?
– Rakesh Jesadiya
Apr 3 '17 at 9:14
|
show 4 more comments
4 Answers
4
active
oldest
votes
1- Please check that Attribute you have created is assigned to the
attribute set.
2- Please run the reindex command
php bin/magento indexer:reindex
3- flush the cache
php bin/magento cache:flush
add a comment |
Make sure to add the custom attribute to the 'Attribute Set' the configurable product is using.
You can have different configurable products using different attribute sets. Check the attribute set used for your configurable product here:
- Catalog -> Product -> [Edit] -> General -> Attribute Set
Add the custom attribute to the attribute set used by your configurable product here:
- Store - Attribute Set -> [Edit] -> drag unsigned attributes to the attribute set
add a comment |
See how the attribute grid collection is created in
MagentoConfigurableProductUiDataProviderAttributes::getData
then MagentoConfigurableProductModelConfigurableAttributeHandler::getApplicableAttributes
return $collection->addFieldToFilter(
'frontend_input',
'select'
)->addFieldToFilter(
'is_user_defined',
1
)->addFieldToFilter(
'is_global',
MagentoEavModelEntityAttributeScopedAttributeInterface::SCOPE_GLOBAL
);
You should set is_user_defined to true.
(test on Magento 2.2)
add a comment |
This will surely work:
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
$eavSetup->addAttribute(
MagentoCatalogModelProduct::ENTITY,
'paper_size',
[
'type' => 'int',
'backend' => '',
'frontend' => '',
'label' => 'Size',
'input' => 'select',
'class' => '',
'source' => '',
'global' => MagentoCatalogModelResourceModelEavAttribute::SCOPE_GLOBAL,
'visible' => true,
'required' => false,
'user_defined' => true,
'default' => 0,
'searchable' => true,
'filterable' => true,
'comparable' => true,
'visible_on_front' => true,
'used_in_product_listing' => true,
'unique' => false,
'apply_to' => implode(',', [Type::TYPE_SIMPLE, Type::TYPE_VIRTUAL, Configurable::TYPE_CODE]),
'is_used_in_grid' => true,
'is_visible_in_grid' => true,
'is_filterable_in_grid' => true,
'visible_in_advanced_search' => true
]
);
}
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f167354%2fmagento-2-created-custom-product-attribute-but-not-showing-in-configuration-se%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
1- Please check that Attribute you have created is assigned to the
attribute set.
2- Please run the reindex command
php bin/magento indexer:reindex
3- flush the cache
php bin/magento cache:flush
add a comment |
1- Please check that Attribute you have created is assigned to the
attribute set.
2- Please run the reindex command
php bin/magento indexer:reindex
3- flush the cache
php bin/magento cache:flush
add a comment |
1- Please check that Attribute you have created is assigned to the
attribute set.
2- Please run the reindex command
php bin/magento indexer:reindex
3- flush the cache
php bin/magento cache:flush
1- Please check that Attribute you have created is assigned to the
attribute set.
2- Please run the reindex command
php bin/magento indexer:reindex
3- flush the cache
php bin/magento cache:flush
answered May 23 '17 at 4:46
Abhinav Singh
2,007610
2,007610
add a comment |
add a comment |
Make sure to add the custom attribute to the 'Attribute Set' the configurable product is using.
You can have different configurable products using different attribute sets. Check the attribute set used for your configurable product here:
- Catalog -> Product -> [Edit] -> General -> Attribute Set
Add the custom attribute to the attribute set used by your configurable product here:
- Store - Attribute Set -> [Edit] -> drag unsigned attributes to the attribute set
add a comment |
Make sure to add the custom attribute to the 'Attribute Set' the configurable product is using.
You can have different configurable products using different attribute sets. Check the attribute set used for your configurable product here:
- Catalog -> Product -> [Edit] -> General -> Attribute Set
Add the custom attribute to the attribute set used by your configurable product here:
- Store - Attribute Set -> [Edit] -> drag unsigned attributes to the attribute set
add a comment |
Make sure to add the custom attribute to the 'Attribute Set' the configurable product is using.
You can have different configurable products using different attribute sets. Check the attribute set used for your configurable product here:
- Catalog -> Product -> [Edit] -> General -> Attribute Set
Add the custom attribute to the attribute set used by your configurable product here:
- Store - Attribute Set -> [Edit] -> drag unsigned attributes to the attribute set
Make sure to add the custom attribute to the 'Attribute Set' the configurable product is using.
You can have different configurable products using different attribute sets. Check the attribute set used for your configurable product here:
- Catalog -> Product -> [Edit] -> General -> Attribute Set
Add the custom attribute to the attribute set used by your configurable product here:
- Store - Attribute Set -> [Edit] -> drag unsigned attributes to the attribute set
answered Sep 7 '18 at 11:15
Rus Dragos
268
268
add a comment |
add a comment |
See how the attribute grid collection is created in
MagentoConfigurableProductUiDataProviderAttributes::getData
then MagentoConfigurableProductModelConfigurableAttributeHandler::getApplicableAttributes
return $collection->addFieldToFilter(
'frontend_input',
'select'
)->addFieldToFilter(
'is_user_defined',
1
)->addFieldToFilter(
'is_global',
MagentoEavModelEntityAttributeScopedAttributeInterface::SCOPE_GLOBAL
);
You should set is_user_defined to true.
(test on Magento 2.2)
add a comment |
See how the attribute grid collection is created in
MagentoConfigurableProductUiDataProviderAttributes::getData
then MagentoConfigurableProductModelConfigurableAttributeHandler::getApplicableAttributes
return $collection->addFieldToFilter(
'frontend_input',
'select'
)->addFieldToFilter(
'is_user_defined',
1
)->addFieldToFilter(
'is_global',
MagentoEavModelEntityAttributeScopedAttributeInterface::SCOPE_GLOBAL
);
You should set is_user_defined to true.
(test on Magento 2.2)
add a comment |
See how the attribute grid collection is created in
MagentoConfigurableProductUiDataProviderAttributes::getData
then MagentoConfigurableProductModelConfigurableAttributeHandler::getApplicableAttributes
return $collection->addFieldToFilter(
'frontend_input',
'select'
)->addFieldToFilter(
'is_user_defined',
1
)->addFieldToFilter(
'is_global',
MagentoEavModelEntityAttributeScopedAttributeInterface::SCOPE_GLOBAL
);
You should set is_user_defined to true.
(test on Magento 2.2)
See how the attribute grid collection is created in
MagentoConfigurableProductUiDataProviderAttributes::getData
then MagentoConfigurableProductModelConfigurableAttributeHandler::getApplicableAttributes
return $collection->addFieldToFilter(
'frontend_input',
'select'
)->addFieldToFilter(
'is_user_defined',
1
)->addFieldToFilter(
'is_global',
MagentoEavModelEntityAttributeScopedAttributeInterface::SCOPE_GLOBAL
);
You should set is_user_defined to true.
(test on Magento 2.2)
answered Dec 20 '17 at 11:28
Chuongnh
392
392
add a comment |
add a comment |
This will surely work:
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
$eavSetup->addAttribute(
MagentoCatalogModelProduct::ENTITY,
'paper_size',
[
'type' => 'int',
'backend' => '',
'frontend' => '',
'label' => 'Size',
'input' => 'select',
'class' => '',
'source' => '',
'global' => MagentoCatalogModelResourceModelEavAttribute::SCOPE_GLOBAL,
'visible' => true,
'required' => false,
'user_defined' => true,
'default' => 0,
'searchable' => true,
'filterable' => true,
'comparable' => true,
'visible_on_front' => true,
'used_in_product_listing' => true,
'unique' => false,
'apply_to' => implode(',', [Type::TYPE_SIMPLE, Type::TYPE_VIRTUAL, Configurable::TYPE_CODE]),
'is_used_in_grid' => true,
'is_visible_in_grid' => true,
'is_filterable_in_grid' => true,
'visible_in_advanced_search' => true
]
);
}
add a comment |
This will surely work:
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
$eavSetup->addAttribute(
MagentoCatalogModelProduct::ENTITY,
'paper_size',
[
'type' => 'int',
'backend' => '',
'frontend' => '',
'label' => 'Size',
'input' => 'select',
'class' => '',
'source' => '',
'global' => MagentoCatalogModelResourceModelEavAttribute::SCOPE_GLOBAL,
'visible' => true,
'required' => false,
'user_defined' => true,
'default' => 0,
'searchable' => true,
'filterable' => true,
'comparable' => true,
'visible_on_front' => true,
'used_in_product_listing' => true,
'unique' => false,
'apply_to' => implode(',', [Type::TYPE_SIMPLE, Type::TYPE_VIRTUAL, Configurable::TYPE_CODE]),
'is_used_in_grid' => true,
'is_visible_in_grid' => true,
'is_filterable_in_grid' => true,
'visible_in_advanced_search' => true
]
);
}
add a comment |
This will surely work:
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
$eavSetup->addAttribute(
MagentoCatalogModelProduct::ENTITY,
'paper_size',
[
'type' => 'int',
'backend' => '',
'frontend' => '',
'label' => 'Size',
'input' => 'select',
'class' => '',
'source' => '',
'global' => MagentoCatalogModelResourceModelEavAttribute::SCOPE_GLOBAL,
'visible' => true,
'required' => false,
'user_defined' => true,
'default' => 0,
'searchable' => true,
'filterable' => true,
'comparable' => true,
'visible_on_front' => true,
'used_in_product_listing' => true,
'unique' => false,
'apply_to' => implode(',', [Type::TYPE_SIMPLE, Type::TYPE_VIRTUAL, Configurable::TYPE_CODE]),
'is_used_in_grid' => true,
'is_visible_in_grid' => true,
'is_filterable_in_grid' => true,
'visible_in_advanced_search' => true
]
);
}
This will surely work:
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
$eavSetup->addAttribute(
MagentoCatalogModelProduct::ENTITY,
'paper_size',
[
'type' => 'int',
'backend' => '',
'frontend' => '',
'label' => 'Size',
'input' => 'select',
'class' => '',
'source' => '',
'global' => MagentoCatalogModelResourceModelEavAttribute::SCOPE_GLOBAL,
'visible' => true,
'required' => false,
'user_defined' => true,
'default' => 0,
'searchable' => true,
'filterable' => true,
'comparable' => true,
'visible_on_front' => true,
'used_in_product_listing' => true,
'unique' => false,
'apply_to' => implode(',', [Type::TYPE_SIMPLE, Type::TYPE_VIRTUAL, Configurable::TYPE_CODE]),
'is_used_in_grid' => true,
'is_visible_in_grid' => true,
'is_filterable_in_grid' => true,
'visible_in_advanced_search' => true
]
);
}
answered Jul 5 '18 at 14:29
VIPIN A ROY
17013
17013
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f167354%2fmagento-2-created-custom-product-attribute-but-not-showing-in-configuration-se%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Show your custom attribute code
– Priyank
Apr 3 '17 at 8:41
Have you set this attribute in attribute set?
– Rakesh Jesadiya
Apr 3 '17 at 9:07
custom attribute code added.
– Somnath Mondal
Apr 3 '17 at 9:07
Custom Attributes are set in Default Attribute Set.
– Somnath Mondal
Apr 3 '17 at 9:11
are you created product is contains default attribute set?
– Rakesh Jesadiya
Apr 3 '17 at 9:14