Questions tagged [product-attribute]

Questions about creating, managing and using product attributes

Filter by
Sorted by
Tagged with
3
votes
2answers
6k views

Magento 2: Save all product data outside Magento with Images

I have below code with Image Upload which is working fine. But images are not stored in Database Table as mentioned in Order. include('app/bootstrap.php'); use Magento\Framework\App\Bootstrap; $...
13
votes
3answers
10k 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 ...
12
votes
9answers
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 ...
8
votes
2answers
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 ...
2
votes
1answer
404 views

Dependent Custom option in Magento-2

How to create Custom option programatically in which both are drop-down and they are dependent on each other . Dependent in the sense , changing value of second drop-down option based on the value of ...
12
votes
5answers
10k 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 ...
2
votes
2answers
3k views

How to add multi-select category tree at admin end in magento 2?

I would like to display *Category Tree Names** in multi select field in magento 2 admin end? I have tried with below code but displaying only first cateogires could you please any one help on this? ...
8
votes
4answers
21k 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.
1
vote
1answer
619 views

Product edit form issue in admin panel magento2

Here is my etc/adminhtml/events.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events....
1
vote
1answer
3k views

Create product attribute with options in magento2 through rest API

I have created a custom module to create product attribute with option thruogh rest Api. Here is my code samples. etc/webapi.xml <route url="/V1/attribute/attributeCreate" method="POST"> &...
16
votes
2answers
20k views

Magento 2 : Add Product Attribute Programmatically

How to create Magento 2 Product Attribute Programmatically with type : Text Area.
20
votes
5answers
41k 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 = $...
12
votes
2answers
10k 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 ...
2
votes
1answer
3k views

Magento 2 - Display Attribute on Cart Page

I need to display a few attributes in the cart page. How can i accomplish that?
9
votes
4answers
11k 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->...
3
votes
3answers
7k views

Magento 2: Display Custom attribute value under the product name on category page

I want to display custom attribute value under the product name on category page. Attribute type is dropdown and attribute name is Brand. I want to display the brand name under the product name on ...
1
vote
3answers
16k views

How to correctly update product programmatically - Magento 2

The Context: By decision of the client, the Magento Administrator cannot add products by himself, all he can do is edit them, therefore the addition of products must be done programmatically. There ...
15
votes
2answers
38k 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: ...
25
votes
9answers
66k 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 ...
4
votes
4answers
29k views

Find the table for custom attribute values

I’ve installed magento edition version 1.9.2.0 and added a custom attribute catalog_special_name (text field) and i want to know which table stores the custom attribute values for each product.
20
votes
2answers
78k 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(); /** @...
4
votes
3answers
4k views

How to copy a product's attributes value to another attribute?

i want to copy a product's attribute (weight) to another atribute (general_weight). i found this codes, but i don't know what to do with this codes? or where to copy them? $prod=Mage::getModel('...
8
votes
3answers
14k 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 ...
5
votes
2answers
4k views

Magento Enterprise: catalog_product_attribute not reindexed on product save

I'm using Magento ee 1.13.0.2 and discovering the next problem: I have some of the attributes used in layered navigation - color and size. When I add a new product (simple one) and save it - product ...
4
votes
1answer
6k views

create product image attribute in magento2

I am trying to create product attribute of image type. I am already created one custom attribute group and some other attribute in it but image type attribute doesn't look good. InstallData.php $...
3
votes
3answers
4k views

Allow SVG on Product images

How do I allow this attribute type to handle SVG?
4
votes
2answers
8k views

Magento 2 Create Date with Time attribute for product [duplicate]

I have tried to create datetime attribute in Magento 2. Below is my script: $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]); $eavSetup->removeAttribute(\Magento\Catalog\...
3
votes
3answers
2k views

Magento 2 : Validate a condition rules based on product attribute

How to validate a condition rules based on product attribute in magento 2 backend: code: $product_id = '3'; // Crown Summit Backpack sku is 24-MB03 $objectManager = \Magento\Framework\...
0
votes
2answers
462 views

Images Related to Attribute Label in View.phtml

I try to explain my problem. I'm working with a Store created by other people and it's difficult to me understanding everything. The Store have a custom template and, in my view.phtml, I found the ...
15
votes
3answers
20k 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/...
14
votes
4answers
23k 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 ...
9
votes
1answer
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. ...
3
votes
1answer
2k views

Magento 2: How to set default value of quantity in new product page

I am new developer of Magento 2. Is Magento provided a way to set default value of quantity in admin new product page?
5
votes
3answers
34k 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?
4
votes
2answers
1k views

Add video to product programatically

OK, I have some bundled product to create and I want to do it programatically. Problem is, I want to add (to MediaGallery) some videos, as it can be done in case of images. It can be done via ...
2
votes
2answers
4k views

Show value of product attribute of type file in magento2 backend

As Administrator I want to be able to upload files for each products in order to show link on frontend. I created upgrade script to create attribute with this properties: 'type' => 'varchar', '...
10
votes
2answers
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(); //...
8
votes
2answers
14k 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.
7
votes
1answer
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 ...
6
votes
2answers
7k views

How to get configurable attribute label and value in magento 2?

To use Object Manager is not a proper way but this code is for testing purpose only. I want to get attribute value which is available in configurable products. I have tried with below code, but I get ...
6
votes
1answer
4k 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',...
5
votes
3answers
4k views

Product List Page Sort by Most View in magento 2.1

We need to bring most viewed, most subscribed and latest options in the sort menu in product listing page of our magento 2.1 application (magento 2.1.7). I already refered the this link Product List ...
2
votes
1answer
3k views

How to add new column and custom attribute in order email template in Magento 1.9.3?

In this new order email. I want to add a column in this table where i want to show a custom product attribute.. Please tell me how can i add column inside the new Order confirmation email template ...
1
vote
3answers
2k views

Magento2: create product attribute in non install/upgrade scripts

What is the right way to create a product attribute in a non install or upgrade scripts in Magento2?
1
vote
5answers
4k views

How to remove SKU on the product page?

I want to remove the SKU from the product display page. How can I do this?
0
votes
2answers
283 views

Why titles for Description and Short Description not showing on Product Page?

I have Description and Short Description, I see the values of these attributes, but I do not see their titles. Why? I tried to set the titles by doing: app/design/frontend/MyTheme/Magento_Catalog/...
5
votes
4answers
5k views

Magento attribute change backend_type from varchar to text

My product attribute exceeded the 255 character limit of varchar, so I came across the solution to change its backend_type to text. Should this operation be considered safe (in the terms that it will ...
4
votes
1answer
4k views

The configuration parameter “formElement” is a required for custom attribute product field

I just add custom attribute to my product like this: <?php namespace Namespace\Module\Setup; use Magento\Customer\Model\Customer; use Magento\Customer\Setup\CustomerSetup; use Magento\Eav\Setup\...
3
votes
1answer
835 views

Magento2 : How to show the product's attribute value at product details page on PORTO theme?

I have create drop-down attribute on the name of location with drop-down options. I'd like to show the value of this attribute at product details page above add to cart. Copied the file addtocart....
2
votes
1answer
2k views

Global product attribute empty on store view level

We have a strange situation. A global product attribute that is populated at the default config level is empty on store view level. The attribute scope is ofcourse set to global. See the image below ...