Questions tagged [attributes]

Magento Entity Attributes

Filter by
Sorted by
Tagged with
64
votes
3answers
63k views

Adding custom attribute to Customer

We need a simple way to add an attribute to a customer record that is not editable by the customer or admin, only programatically. Essentially, we have an ExpressionEngine site coupled with Magento. ...
8
votes
2answers
27k views

Adding custom attribute to customer registration form

I needed to create two new customer attributes. I have followed the guide from: http://www.fontis.com.au/blog/magento/know-more-about-your-customers-adding-custom-signup-attributes to create these ...
22
votes
2answers
24k views

product attribute to quote item and order item

What is the correct way in Magento to have a product attribute be automatically persisted to quote an item and then finally to order item? Is it as simple as a little config XML or is it a manual ...
13
votes
3answers
9k 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 ...
18
votes
5answers
14k views

Get product attribute in cart in Magento2

I'm trying to grab a product attribute in the cart template. But I just does not work! The attribute is set to Visible on Catalog Pages on Storefront = yes and Used in Product Listing = yes I use a ...
27
votes
4answers
41k views

Upgrade script - Create new select attribute with options

I would like to create a new product attribute with some predefined options using an upgrade script. I have an upgrade script working, so the only thing i dont know how to do is to add the drop down ...
9
votes
6answers
10k views

Configurable product attribute sort order in Dropdown 2.12

The order of the dropdown is not consistent with the order of the attribute itself. Within the attribute size I have it ordered Newborn 0-3 mo and in the dropdown it shows up as 0-3 Newborn the ...
9
votes
2answers
7k views

Magento 2 how to save custom field added in the form of customer group?

I've added some custom fields to the form of customer group by using upgradeSchema.php. After that I found that the original fields like customer group code and tax id are saved by using setter ...
7
votes
2answers
6k views

layered navigation isn't populated by collection attributes — CMS page

I'm attempting to add layered navigation to a CMS page containing a widget that contains a custom product collection (products that are 'new'). Within this widget are fuctions that, given the correct ...
6
votes
5answers
26k views

Get product attribute 'option label'?

I have manage to retrieve the value for an attribute relative to a particular product $store_id = Mage::app()->getStore()->getStoreId(); $attribute_code = 'code'; $value = Mage::...
18
votes
2answers
71k views

How to get attribute “option label/attribute text” having “attribute value” (option_id)?

Suppose I have an attribute that is a collection of option (dropdown/multiselect). I can retrieve the attribute value for a given product: $store_id = [something]; $productId = [something]; // this ...
2
votes
1answer
973 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? ...
13
votes
6answers
38k views

Magento 2 - How to get attribute of product?

How to get attribute of product?
12
votes
2answers
22k views

Select more than one item in layered navigation (multiple select/checkboxes)

How do you convert the standard layered navigation to use checkboxes or multiple select inputs for attributes of type dropdown or multiselect? For example if a user selects blue and red for the ...
16
votes
3answers
27k views

Filtering results using LIKE

Consider these three "haystack" strings: a) foo bar b) welcome to foo bar industries c) foo barer And now my "needle": foo bar (Heh) I would like my filter to match my needle with haystack ...
15
votes
6answers
11k views

How Magento2 add attribute option programmatically (not in setup)

I try to add options for size and color attributes in my importer modul but I don't how...: private function addOption($attributeCode, $value) { $ob = $this->_objectManager; /* @var $...
8
votes
1answer
17k views

Changing the Attribute Set for a Simple Product

Basically the subject. I have a simple product created with a particular attribute set. Is there a way to change the attribute set associated with this product without having to create a new one?
1
vote
3answers
4k 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 ...
8
votes
2answers
14k views

Collections - Filtering multiple multi-select attribute values

That's not a typo. I am aware that I need to use 'finset' to filter my multi-select attributes; however, I am trying to filter multiple values at once and getting: Incorrect parameter count in the ...
19
votes
1answer
24k views

How to disable “Add to Cart” on specific products, and instead display “View Details” button in category list view?

I was wondering how to disable Add to Cart button on a few specific products, and I found an abandoned guide on how to do this, which worked, but it was somewhat incomplete, as it only was just a ...
13
votes
1answer
18k views

How to get all options for all store views for a single attribute?

I am trying to retrieve all options for all store views for a single attribute e.g. color. For the attribute color I have created two options blue and white. I have tried the following code that is ...
19
votes
2answers
16k views

How to add a customer custom-attribute in the customer address edit form?

I added a customer custom attribute as customer_address type and it runs correctly in the admin and in onepagecheckout as well as in shipping & billing address. I created: my_namespace/my_module/...
10
votes
4answers
14k views

Hide Attributes and Other Fields in Product Edit Backend

To make editing of products (and maybe also categories) for the shop owner easier, we would like to hide some unnecessary tabs and fields from some users in the admin backend. This means: Hiding some ...
4
votes
2answers
21k views

Getting attribute from simple products of configurable products

After having to work on someone else's Magento webshop, I found a huge performance issue. The shop consists of configurable products. In the overview, an attribute from the simple products is shown. ...
5
votes
1answer
8k views

How to show layered navigation filter all time

I have seen lots of people who discussed about this issue, also given plenty of ideas, but i am still stuck at the issue. As per the answer at this link, i have written the new function to get the ...
4
votes
4answers
801 views

Hide an attribute in Layering Navigation for a specified category

Is it a way to hide an attribute in Layering Navigation for a specified category? I have a category which join products with different attribute sets. In this case layering navigation becomes very ...
4
votes
4answers
6k views

show attributes in description.phtml

I found it is hard to show the attributes in Description.phtml,it is hard to me. i wish to show some attributes as Brand,Color,Name in Description.phtml ,i copied the attributes.phtml and change some ...
2
votes
1answer
3k views

Product attributes and label attribute group

I would like to show the various attributes divided into groups as created in the set of attributes, such as general attribute 1 attribute 2 ... other info attribute 1 attribute 2 ... How do ...
2
votes
2answers
132 views

Magento 2.2.3 - Add custom required validation for company

I want to add validation only for billing address on the checkout page. By default in the backend, the company name is optional. But if when I go to the checkout page and click on the Place Order ...
9
votes
1answer
5k views

Whats the best way to check if a custom attribute exists in Magento2

In being careful, I want to check if my custom attribute exists before I attempt to utilize it in any way. I need to check against all attributes collection, not just the product collection. My ...
5
votes
1answer
860 views

Magento2: How to update products position in category via CSV?

I want update product position attribute in category through the CSV feed. Anyone have any idea OR sample CSV which can accomplish my requirement.
0
votes
2answers
452 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 ...
10
votes
1answer
7k views

set attributes to 'use default value' for a list of products

I want to set the images to 'use default value' for a list of product, and for a list of store view. I know how to do it individually for each product : setData(attributeName,false), and so i can do a ...
16
votes
2answers
15k views

How to Programmatically set a Product's Multi-Select Attribute by Labels

If have a multiselect attribute and want to set the selection on a product. $selectedOptions = "red,green,blue"; $product->..... // # what to do? How can I do that?
12
votes
2answers
1k views

how to save image custom attribute in magento 2

I need to display few images of product in frontend based on condition: use for virtual mirror should be checked. <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for ...
13
votes
4answers
21k 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 ...
5
votes
1answer
1k views

Magento 2 - “Property \”Slider\“ does not have corresponding setter in class ”Magento\\Eav\\Api\\Data\\AttributeOptionInterface\“.”

I am trying to override Magento\Eav\Api\Data\AttributeOptionInterface in my custom module. I want to add one new option to existing interface. The idea behind is, As of now we can only pass defined ...
4
votes
1answer
7k views

Show custom attribute in Order view backend

I would like to be able to see additional attributes within the order items. So far I'm in the sales/order/view/items/renderer/default.phtml - and I've got the attributes with this snippet: $...
7
votes
2answers
2k views

Adding a product attribute with values and mark one value as default

I know how I can add a product attribute from an installer script, but how do I tell Magento to use one of the values as default value? (or more values in case it's a multiselect attribute). I use ...
4
votes
3answers
9k views

Is there a way to add Category column to admin Product Grid?

I am trying to add a column to a module that will shows products and the related category. I have been able to show the product names etc put I am not able to get the category name to show in the grid....
1
vote
0answers
98 views

Manage Attribute Sets :: How to solve Magento 1.9.2.3 Unassigned Attributes Fields Empty?

After added new attributes, Unassigned Attributes field is empty, ver Magento 1.9.2.3 Note : What are all the possibilities of error?
12
votes
2answers
41k 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
2answers
3k views

How to add dropdown attribute to custom module in magento 2.0

I wanted to add dropdown attribute called 'customer type' with drop down options 'buyer' and 'seller' to my custom module. How can I make it to my upgrade schema?
3
votes
3answers
23k views

How to get the customer attribute value?

What I want add customer attribute show the new attribute in front(dashboard) page Problem I have created customer attribute with this code below: <?php define('MAGENTO', realpath(dirname(...
3
votes
4answers
8k views

Configurable Product options box not showing on the front end

The drop down selection box is not showing for configurable products, the configurable product itself is showing but not the options to choose which simple product is selected. It is probably notable ...
2
votes
1answer
4k views

Filter by Product's Custom Options or set diffrent options for each products from Attributes Sets

I don't know what is the best way of doing this. The idea is that I have about 500 products. I created 11 Attribute Sets (to cover 11 product categories). These attributes are filterable. But I need ...
2
votes
3answers
4k views

Programatically delete custom attribute options

I'm trying to delete all custom attribute options not contained within a specific options array as follows: /** @var \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute */ $...
1
vote
1answer
2k views

Display custom attribute in invoice pdf magento

I am having custom attribute called FREE OFFER. now i need to display the values of attribute FREE OFFER in invoice PDF. I displayed the attribute in invoice. but when i click print the output PDF ...
10
votes
2answers
15k 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(); //...
4
votes
1answer
3k views

add attribute to admin user

I need to add a field that I did to the customer, but also to the admin user. I have the customer one working, $installer->addAttribute('customer', 'ldap_user', array( 'type' => '...