Questions tagged [attribute-options]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
6 votes
5 answers
20k views

Get Attribute option Id by Attribute admin value

For a Magento Dropdown Attribute, it is possible to get an Attribute option Id by Attribute admin value?
  • 597
6 votes
4 answers
7k views

Magento 2 - How to get additional options product from quote item

I have some Vitrual product with options, I need to get his options but I can just get the info_buyRequest instead of additional_options Here is my code: $objectManager = \Magento\Framework\App\...
  • 11.4k
6 votes
3 answers
27k views

Get Custom Option Values of a product magento 2

I have two custom options for a product. Color and Size and both are drop-downs. In product detail pages, I have to display all available colors of that product. I tried the following code and it ...
  • 441
5 votes
3 answers
4k views

Can't update or delete attribute options

I have a strange problem with Magento. Recently I'm not able to delete an attribute option or update the postion of an attribute option. When I change the position i.e. from "3" to "0", it will just ...
  • 81
4 votes
2 answers
620 views

Get Product Options for each Product in the Catalog

I am trying to build a script that outputs all the product options for each product in the catalog into a CSV file. I have tried using the code on this page: http://www.atwix.com/magento/configurable-...
  • 1,489
4 votes
1 answer
5k views

Magento 2 how to get product attribute options on checkout cart

How I can get the configurable products attribute options in front end checkout cart page? I have tried with the below answer but can't get any success. Magento 2 - How to get attribute options value ...
3 votes
3 answers
12k views

Create Product Attribute Of Type MULTISELECT or dropdown select & Create Option Labels Diffrent for Diffrent Store using install or upgrade schema

I am creating custom Product Attribute Of type MULTI SELECT, I want to create different option label for each stores for this particular Attribute, I have tried with this below code, $eavSetup->...
  • 1,840
3 votes
3 answers
4k views

Magento 2: How to get value from attribute from store_id 0 (admin/unique)?

I'm trying to get store label for admin (store 0 - zero) but since I have something in "Default Store Label" I'm getting only that value. I need to find the solution to get always only the admin (...
3 votes
1 answer
5k views

Get option label associated with admin store in Magento 2

I want to go through all options of attributes configured for filtering and output the label of the Admin Store View. I only managed to get the Default Store View (store_id 1) label with the following ...
  • 211
3 votes
3 answers
5k views

Magento2 : How to add attribute options values into dropdown attribute programmatically

Need way to add options to already created Color attribute.
  • 1,298
3 votes
1 answer
5k views

how to get swatches attribute option in magento 2

how to get progmatically swatches attribute option data in magento 2. I tried this:- \Magento\Eav\Model\ResourceModel\Entity\Attribute\Option\CollectionFactory $options = $this->...
3 votes
1 answer
97 views

How do I create a configurable product with 3 options

I apologise for the vague title, I didn't know exactly what I'm asking so I'll explain and maybe someone else can come up with a better title...or the solution. I'm trying to create a website that ...
3 votes
4 answers
6k views

How to get option_id of an option by label? (magento 2)

I want to get the option_id of one of the options on an attribute, but I only know the label of the option (by label, I mean the 'value' column in eav_attribute_option_value). How can I get it? ...
  • 483
3 votes
0 answers
203 views

Magento 2: Retrieving and updating Attribute Options and Store Lables

I am currently trying to update an attribute options store label and facing some issues. I can successfully update option store labels by calling $storeLables = []; $optionLabel = $this->...
3 votes
0 answers
83 views

How to disable duplicated values options when adding new option of an attribute magento 2

I have set the attribute color as unque value but still can add same value and i have tried with an event catalog_entity_attribute_save_before but now he delete all the label and values please any ...
3 votes
1 answer
355 views

Configurable Options within a modal for non-selected options

I want to write a frontend functionality for configurable products. If there is no configurable attribute given, I want a modal to popup which asks the user to select options. The options should be ...
3 votes
1 answer
442 views

How to group the options of an attribute in layered navigation frontend

How can I group the options of an attribute alphabetically in layered navigation frontend? I have approx 300 options for an attribute and I need to group them, such as [A-C] [D-F], etc. The idea is ...
  • 31
2 votes
2 answers
1k views

M2.3 - Creating multiple attribute options at once generates error

I am trying to add multiple attribute options to an already existing attribute. During the loop, it will create the first option, and then throw an error. Fatal error: Uncaught TypeError: Argument ...
  • 789
2 votes
2 answers
3k views

Some product options remain disabled after the first selection

I am using Magento CE 1.9.2.4, and the Porto Theme. I have some Configurable Products with a lot of variants (in some cases there are 5 attributes, each with several options). Each variant has a ...
2 votes
1 answer
2k views

Magento 2 Get Attribute option Id issue with core method

I am using below code to get the option Id with an attribute value/label in a custom extension. /* * Get attribute id based on option value */ protected function getAttributeOptionId($attributeCode, $...
  • 1,308
2 votes
1 answer
632 views

How to retrieve option store label?

Could someone teach me how to retrieve the option label for current store view? There is a table eav_attribute_option_value where these information are already stored, but I don't know what model I ...
  • 33
2 votes
1 answer
128 views

Merging Options

Hi to everyone,  can I Merge Options from different Attributes? I have 3 Attributes (Length, Width and Height) that allows Customer to Filter Products by Length and/or Width and/or Height. In ...
  • 51
2 votes
0 answers
41 views

Magento 2.3.4: Add new column to Manage Options of Product Attribute

Like the title, I'm trying add new column to Manage Options. The problem is that the style of the row I want to add is select. It is showing but when I click on the select box, the list of options is ...
2 votes
0 answers
148 views

Magento 2 : Add new Product attribute options

I have added a product attribute programmatically. so in store->product->attribute it shows option values readonly. Is it possible to add new option from admin side ? Ex. because it is system ...
2 votes
3 answers
4k views

Get values of your attribute option text from product

I want to get value of attribute option text from product based on store id. I want to get admin text for attribute option. $attribute_option_id = Mage::getResourceModel('catalog/product')->...
  • 628
2 votes
0 answers
3k views

How to add multi select Custom Attribute Options Programatically

I am working on to create custom attribute, While creating the attribute i need to add multiselect custom attribute option via code. $eavSetup->addAttribute( \Magento\Catalog\...
  • 3,500
2 votes
0 answers
288 views

Manage option value of attribute option disappears

I have an attribute named as Product_type. Catalog > Manage attributes > Attribute Name(Product_type) > Manage Labels/Options > Manage Options (values of your attribute) When I choose Use In Layered ...
  • 628
2 votes
1 answer
380 views

How to add new field in product attribute options in Magento 2

I want to add custom field for attribute options in Magento 2 how can I do?
  • 1,965
1 vote
2 answers
3k views

Get Attribute Option Position from Option value

I have a dropdown attribute with many options. In cart.phtml I already get the attribute value for each item Mage::getModel('catalog/product')->load($_item->getProduct()->getId())->...
  • 597
1 vote
2 answers
656 views

Add new option to existing product attribute

I am trying to use the function addAttributeOption to add a new option to an attribute. I do not want to change the current option order or defaults but simply want to append a new option to the end ...
1 vote
1 answer
889 views

Magento 2: Get all the option label (per store scope) from attribute code

Currently my code is use Magento\Eav\Model\Attribute; use Magento\Eav\Model\AttributeRepository; use Magento\Framework\Api\SearchCriteriaBuilder; $searchCriteria = $this->searchCriteriaBuilder-&...
1 vote
1 answer
2k views

Foreign key constraint fails when trying to add custom product attribute option

I added a product attribute called size from admin with the same settings as color attribute. Now when i programmatically try to add an option to this attribute I get a MySQL error: Cannot save ...
  • 41
1 vote
1 answer
150 views

Programitically created attribute displaying incorrect attribute options

I have written the following code to create an attribute in magento 1.9 $name = $data['name']; $attributeSetId = $data['attributeSetId']; $attributeGroupId = $data['attributeGroupId']; //create a ...
1 vote
1 answer
832 views

How to get list of attribute options in frontend view?

I'm writing a custom display for certain attributes based on its label. Within the 'configurable.phtml' file, it has the following lines: $_product = $this->getProduct(); $_attributes = Mage::...
1 vote
1 answer
2k views

Not able to update or delete attribute option in admin

I am not able to update or delete the product attribute options in admin-end. When I am clicking "save" or "save or continue" after updating or deleting the attribute option, Magento shows me the ...
  • 8,698
1 vote
1 answer
57 views

How do I get all option value id's for a given attribute in a specific category in my custom block?

My shop has an attribute manufacturer. This attribute has option values like adidas and nike etc. I have a custom module with a block I placed the block on a specific category through a widget The ...
  • 1,308
1 vote
1 answer
283 views

How to get drop-down options in more-information tab in Magento 2

I want to get Configurable products dropdown attributes all options show in more-information tab. See Below image:- below all options show in more-information tab. Please Help How to achieve this. ...
  • 3,257
1 vote
1 answer
420 views

Configurable product option values in database

Where are configurable product option values, stored in the database?
1 vote
1 answer
74 views

Select attributes with numeric labels

I believe this is a core Magento bug, but thought I'd come here to ask for some suggestions anyway. I've got an attribute, let's call it colour_code. It's a select attribute (backend is int) and it's ...
  • 1,984
1 vote
1 answer
43 views

How to I add another option to an existing select attribute?

I have created an attribute using the following install script: <?php $installer = $this; $installer->startSetup(); $setup = new Mage_Eav_Model_Entity_Setup('core_setup'); $setup->...
1 vote
1 answer
505 views

Sorting attribute options

I am adding new options to some existing attributes using the method below. $option['attribute_id'] = $attribute->getId(); $option['value'][$value][0] = $value; Mage::getModel('eav/...
  • 2,184
1 vote
0 answers
21 views

How to add existent options inside product options

I trying to add simple products and after associate these products in a configurable product, but some options of these products can't be exists. So, I add options using EVA config and return id of ...
1 vote
0 answers
80 views

The image is not assigning to the correct attribute option after sorting when use visual swatch- Magento 2.3.1

Summary of Issue: I am looking to sort the color attribute options programmatically with input type 'Visual Swatch'. I have made customization in below files to sort the attribute options: File 1:...
  • 553
1 vote
0 answers
55 views

How to get a selected simple product id from configurable option in category product listing in magento 2

How to get a selected simple product id from configurable option in category product listing in magento 2
  • 1,389
1 vote
0 answers
583 views

magento 2.2.2 You need to choose options for your item

I want to add a configurable products to cart via ajax, for this I have tried below code but it always raised the error “You need to choose options for your item”. Code public function execute() {...
  • 119
1 vote
0 answers
22 views

Change store attribute option value to display in product edit magento 1

I added my attribute, but it can not display another store view option value (ex: below picture) in product edit. It always display default value. Please help me find a solution to this problem. ...
  • 307
1 vote
1 answer
2k views

Magento 2 get attribute options by attribute code?

How to get the list of option values for particular attribute code in magento 2? <?php namespace Sample\Shopbyage\Block; use ...
  • 834
1 vote
0 answers
112 views

Add internal code to Eav Attribute option?

I am new to Magento 2. All my data comes from an external db. Before importing my products into Magento, I want to prepare the environment. I am currently trying to set up custom EAV attributes with ...
  • 21
1 vote
1 answer
319 views

Magento BUG : Not able to delete Products Attributes Option/Labels?

If i delete one of the attributes values and save, keep the value exist, it's not delete.. how can i solve the issue magento error. Note: php.ini => max_input_vars = 8000000 (master Value) ...
  • 105
1 vote
1 answer
357 views

Retrieve all the available color in product collection

I have a custom product collection and products inside this collection has variety of colors. I want to retrieve all the colors available inside this product collection and store it in array. $layer ...
  • 1,682