Skip to main content

Questions tagged [product-attribute]

Questions about creating, managing and using product attributes

Filter by
Sorted by
Tagged with
31 votes
5 answers
76k views

Why Can't I Load a Product by SKU using loadBySku()?

Synopsis I wanted to load a product by SKU there are many articles, blog posts, stack overflow results etc. All I want to know is - why does it have to be so difficult to load a product by a SKU? // ...
Ash's user avatar
  • 1,746
30 votes
10 answers
96k views

Magento 2: Get product attribute’s select option id,label for configurable product

How to get an option value based on the option id in Magento, or get an option id based on the option code ? Example: how to get the color attribute option id 10 from the label "Red", and get the ...
user avatar
24 votes
6 answers
60k views

How do I get the current product?

I'm trying to retrieve the current product's attributes in a block in Magento 2. I can get a product, like ID 1: $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $product = $...
Tim Trampedach's user avatar
23 votes
2 answers
127k views

Magento 2 : Get Custom Attribute Value of Product [duplicate]

I'm trying to get custom attribut from my product. I tried various methods like below, but non of them worked. $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); /** @...
xhallix's user avatar
  • 692
18 votes
3 answers
37k views

How to get the product type?

I'm creating a new module in Magento 2. I try to get product information in the phtml file. I have get successfully entity_id and product name information. but when I get product type information is ...
pramod24's user avatar
  • 521
17 votes
2 answers
23k views

Magento 2 : Add Product Attribute Programmatically

How to create Magento 2 Product Attribute Programmatically with type : Text Area.
user avatar
15 votes
3 answers
24k views

Magento : Fastest way to update a product attribute

I'm looking for the fastest and reliable method for mass attribute update. Below are the methods am aware of but I don't know with which I should go. $store_id = 0; Mage::getSingleton('catalog/...
Deepak Mallah's user avatar
15 votes
2 answers
9k views

Magento failing when trying to save product inside event observer on frontend?

I have a function that is tied to an event observer One of the requirements is that when it loops through the order item data, if a certain product attribute is empty it issues a request to get ...
Zxurian's user avatar
  • 161
15 votes
2 answers
39k views

How to export all attributes and attribute sets from one magento installation and import to other installation?

I need to export all the product attributes and attribute sets from my current website (Enterprise Edition 1.12.0.0) and import all of them to a new website (CE 1.8). I've gone through these: ...
Shathish's user avatar
  • 2,689
14 votes
5 answers
19k views

How to show the drop down attribute value using getData() method in magento 2?

When I try to get data from the material attribute like $_product->getData('material'), it shows the integer value. How can I convert it to the actual front-end value and in which file do I have to ...
user avatar
14 votes
2 answers
15k views

Magento 2 get all product attributes without product id

I want to retrieve all product attributes those are available, then convert it to name & value for my select options field. In Magento 1 I can achieve it like this: public function ...
simple guy's user avatar
  • 2,484
14 votes
4 answers
25k views

Get value of selected multiselect attribute

Take the following "car" product: Volkswagen Golf. It has a multiselect attribute car_options with the following possible options and their ids: Airco (id=123) selected Radio (id=124) selected ...
SPRBRN's user avatar
  • 1,307
13 votes
2 answers
36k views

How to get parent product id in magento 2?

How to get a child's parent product id in Magento 2 for the configurable products? I want to get the parent product id of child product in Magento based on child product id.
user avatar
13 votes
4 answers
12k views

Read-Only Product Backend attribute

I would like to create an attribute read only however it look it is not possible. I have tried to pass to addAttribute() 'disabled' =>true or 'readonly' => true with out any success. I have ...
Fra's user avatar
  • 6,985
12 votes
4 answers
17k views

Magento Indexer Not Adding Attribute to flat table in custom attribute

Magento Not adding custom Attribute to flat table..... I have a market place extension...which have some attribute but some attributes not adding to flat table...due to my extension not working.... ...
Deepak Rai's user avatar
  • 1,155
12 votes
9 answers
16k views

How to hide empty attribute in any magento template?

I want to hide the custom attribute in magento template. My magento version is 1.8.1 We have added custom attribute for our product like brand, dimension, product type etc. but sometimes we didn't ...
Keyframe's user avatar
  • 129
12 votes
1 answer
2k views

Product List Attribute Filter Query

I have added one filter in Method _getProductCollection() of the class Mage_Catalog_Block_Product_List as follows. protected function _getProductCollection() { ... $this->...
Magento Learner's user avatar
11 votes
5 answers
29k views

Default value of 'yes/no' dropdown custom product attribute

I install the attribute with the following script: $installer = $this; $installer->startSetup(); $installer->removeAttribute('catalog_product', 'customizableonly'); $installer->addAttribute(...
Syspect's user avatar
  • 1,283
11 votes
1 answer
7k views

Magento 2 - Product sorting issue on category page using product attribute

I made product attribute and assign it on of attribute set so that it will show in the admin product detail page. Based on this product attribute I sort the product collection on category page. The ...
Muhammad Hasham's user avatar
10 votes
2 answers
22k views

How to create product's custom attribute with 'yes/no' dropdown using install Setup scripts in Magento 2?

I want to Create a product's custom attribute with 'yes/no' drop-down into my custom module. Please suggest any solution.
Rajesh Hothi's user avatar
10 votes
2 answers
16k views

Add Custom attributes to Custom attribute set programmatically

Hi Could someone help me with this? I created a custom attribute set and custom attribute as $installer = $this; /* @var $installer Mage_Eav_Model_Entity_Setup */ $installer->startSetup(); //...
Magento_Newbie's user avatar
9 votes
6 answers
27k views

Magento 2: Delete magento product attributes?

How do you delete created product attributes in Magento 2? I can't get rid of it. I have couple of Magento product attributes which not needed
fefe's user avatar
  • 937
9 votes
4 answers
15k views

custom attributes in separate coloumn while export? - Magento 2.0.8

short description what I done: create product attribute set (Chennai) create 21 new product attributes assign to Chennai attribute set set value to attribute while create product export (System->...
Bilal Usean's user avatar
9 votes
4 answers
29k views

How to get the Description of a Magento\Catalog\Model\Product?

I'm in Magento2 and the getDescription(); does not work. I'm in the file Magento_Catalog/templates/product/list.phtml if that's relevant.
Philipp Sander's user avatar
9 votes
1 answer
13k views

Adding custom attributes to product list

I'm very confused with a small issue in my catalog/product/list.phtml file. i'm trying to add the Manufacturer attribute that comes with Magento to my grid listing and have added the following code. ...
Chris Morris's user avatar
  • 1,517
9 votes
2 answers
2k views

Handling grouped product attributes

I'm working on building a new Magento shop (this is my first with Magento). I'm looking to replicate the look of an existing shop for my product pages, at least in terms of layout: http://www....
Tom Green's user avatar
  • 193
8 votes
2 answers
10k views

Magento2 How to add row pattern/dynamic rows to the custom product attribute

Magento2 How to add row pattern/dynamic rows to the custom product attribute. Here is the sample output
raheem.unr's user avatar
8 votes
3 answers
16k views

Find the attribute_id by attribute_code

I need to find the attribute_id values of the attributes image, small_image and thumbnail. I know them for my database - 85, 86 and 87, but I need to make my query dynamic, instead of with hard-coded ...
Syspect's user avatar
  • 1,283
8 votes
2 answers
39k views

Adding Custom Tabs in Product Detail Page

I have created an attribute with "Product Details" as Textarea in admin panel. Now I need to make it display as "Product Details" next to description tab in product detail page for each and every ...
Raj's user avatar
  • 203
8 votes
3 answers
6k views

Magento 2 Reindex Fail `Unknown column 'entity_value.value'` in 'field list'

I am having this error when running php bin/magento indexer:reindex also failing when loading the product: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'entity_value.value' in 'field list',...
Juliano Vargas's user avatar
8 votes
2 answers
13k views

Magento 2 create custom swatch attribute programmatically

I would like to create attributes with swatch option programatically in Magento 2.
Gideon's user avatar
  • 195
8 votes
1 answer
2k views

Product page tabs disappeared in admin after trying to add a new product attribute

I just followed instructions in this link, in order to add a new product attribute. After that most of my product tabs disappeared. Here are my final codes: /app/code/local/MyCompany/MultiSlider/...
chamich's user avatar
  • 443
8 votes
1 answer
4k views

Configurable Products into Grouped Product

I want to add Configurable products inside Grouped product. Example like http://www.mitrelinen.com/products/savoy . Here all prodcuts (Duvet cover, fitted sheet etc) are configurable products ...
Jarnail S's user avatar
  • 4,697
7 votes
3 answers
51k views

how can i get the the attribute label from the attribute value in magento 2? [duplicate]

I got the attribute value 232 from the below code $_product->getData('farben'); How I get its label from this value?
Divya Muralidharan's user avatar
7 votes
6 answers
21k views

How to delete an eav product attribute programmatically

i want to delete a product attribute from eav table pragmatically. I was getting a code which was delete customer attribute. I want just like this code ,which was delete product attribute. <?...
Amit Bera's user avatar
  • 77.6k
7 votes
2 answers
19k views

getAttributeText() use default value regardless what store view the user is on

How would I go about getting the Admin value for an attribute, regardless of the visitor's chosen store view? I've tried: $_product = $this->getProduct(); $_condition = $_product->getAttributeText('...
pallazzio's user avatar
  • 337
7 votes
2 answers
13k views

Magento 2 - Set custom attribute value on cart page

In Magento 1.x I have created following function in Namespace/Modulename/Model/Observer.php public function salesQuoteItemSetCustomAttribute($observer){ $quoteItem = $observer->...
DEEP JOSHI's user avatar
7 votes
2 answers
8k views

Magento 2: On product page HTTP ERROR 500

System: Magento 2.1 Everything was running fine 5 minuts ago. I had 3 Products in my Catalog (all using the same Attribute Set). Then I simply deleted 2 Attributes from my (currently in use) ...
Blackpanther0001's user avatar
7 votes
2 answers
5k views

Set default value to custom attribute for all products

I have created the custom attribute (test) for products as a text field with default value('test') from admin panel And assigned that attribute to default attribute set. Now I can able to see the ...
saravanavelu's user avatar
  • 3,951
7 votes
1 answer
5k views

Display custom attribute on category page

On our category page I want to echo an custom attribute with attribute code "homepage_description". I tried this, but that does not work: <?php echo $_product->getHomepageDescription() ?> ...
JGeer's user avatar
  • 1,420
7 votes
3 answers
4k views

Magento 2: "Empty option" for programmatically populated select attribute

I have a product attribute dropdown select box that I populate via a source model. The population works fine, but I want the first option in the list to be "Select one...". I've used the following ...
Geat's user avatar
  • 854
7 votes
2 answers
13k views

How can I use a custom source model for a multiselect product attribute in Magento 2

I've created an attribute in Magento 2 of the type multiselect and now I want to have it populated by a custom source model. Now I remember from Magento 1 that when you want to do this, you had to ...
Giel Berkers's user avatar
  • 12.3k
7 votes
1 answer
3k views

How to get attributes by attribute set ID in Magento 2?

How can I retrieve a list of attributes and values by given attribute set ID in Magento 2?
nuwaus's user avatar
  • 2,324
7 votes
1 answer
374 views

Magento 2, cannot use all option attributes when creating new configuration product

Using Magento 2.2, Back-end, Catalog-Product. I cannot use all product attributes for a new configuration product. Why can't I use all attributes in Stores -> Configuration? New Product Catalog-...
Bong Channarith's user avatar
7 votes
1 answer
2k views

Magento 2 - duplicate pricing block to show in 2 places on the product page

I'm new to Magento 2 and would like to see if anybody could help me. I need to show the product price in two different places on the product page. If a configurable product the price should render ...
dkweb's user avatar
  • 71
7 votes
2 answers
2k views

Add custom image upload attribute to product

I Have tried to add new image upload attribute to Magento Product using sql upgrade script, but I got the error message like: Invalid backend model specified: catalog/...
Oleg's user avatar
  • 239
7 votes
1 answer
2k views

Magento2 : How to get product dimension units (cm/in)?

I need to get the dimension units for width, height and length. There are solution available only to get the value of these attributes like, $product->getTsDimensionsLength(); $product->...
Vinoth Kumar's user avatar
7 votes
0 answers
252 views

Magento 2.2.5: Adding cart-attribute for cart-rules / conditions tab

I use a product attribute called "carton" which describes in how many carton a product is packed. I want to add a cart-rule which counts the amount of all cartons in the cart (accordingly the amount ...
Sascha Sommer's user avatar
7 votes
2 answers
5k views

Magento 2: Import/Export Product Attribute Set & it's Attributes

I refer Magento 2 - Export/Import Product Attributes but no one answered :( I have already created new Attribute Set & it's Attributes. I have checked Magento Default Import/Export for Products. ...
Jackson's user avatar
  • 9,939
6 votes
2 answers
8k views

Detect default attribute set id

There's 'Default' attribute set in the default Magento installation. You have no ability to remove that attribute set using admin gui (Remove button is hidden for this set). I did not found something ...
Yaroslav Rogoza's user avatar

1
2 3 4 5
37