Questions tagged [attributes]

Magento Entity Attributes

Filter by
Sorted by
Tagged with
8
votes
1answer
2k views

“discount_tax_compensation_amount” attribute in Sales Order Item (Magento 2)

I see there is discount_tax_compensation_amount field in the sales_order_item table. For what purposes this attribute is?
8
votes
2answers
2k views

Make customer attribute unique

is it possible to make a customer attribute unique, preferably on a website basis bit if not then globally? I cant see how to do this. Similar to the email address
8
votes
2answers
2k views

Custom non-attribute based layered navigation. Is this the only way to do it?

Today I have been knocking up a layered navigation option that is not based on an attribute. It is for ratings so the front end can show nice shiny stars. To do this I have: Created a module ...
8
votes
4answers
4k views

Magento 2: Set default attribute option as None

I want to have default attribute value as None but whenever I create an attribute, it's first option value is set as default. Please check attached image. How I can configure it so that it's default ...
7
votes
5answers
24k views

addFieldToFilter() with OR Condition in magento2

$collectionData = $this->_productCollectionFactory->create()->addAttributeToSelect('*') ->addFieldToFilter(['attribute1', 'attribute2'], [ ['in' => $attribute1], ...
7
votes
2answers
7k 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 ...
7
votes
3answers
10k views

Programmatically create new attribute set while inheriting from another

I am programmatically creating attributes and attribute sets. The attributes work like they should, but with the attribute sets I have a problem. When I create an attribute set, I can not let it ...
7
votes
3answers
20k views

Get attribute value/id from attribute text/label

I've a requirement to show attribute labels in URL to filter products. I'm able to generate Url with attribute labels. Now all I've to do is convert attribute label to attribute id/value (ex: 1,2), so ...
7
votes
6answers
21k 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
7
votes
2answers
5k views

Delete unused attribute values

I am using the fastsimpleimport module to create my custom import. This has a setDropdownAttributes() function to automatically create needed attribute values but it does not remove unused values. ...
7
votes
1answer
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() ?> ...
7
votes
2answers
3k views

Attribute property 'system' - what it exactly does

'system' => 0 What that property of (product - only?) does or means? I've noticed that all built-in Magento attribute has it with value 1. So my custom attributes should have 0? is it only for ...
7
votes
6answers
16k views

Magento 2 - Add custom attribute in customer registration form

I want to add a custom attribute in customer registration form. I write a module with the following InstallData.php <?php namespace vendor\TestModule\Setup; use Magento\Customer\Model\Customer; ...
7
votes
2answers
2k views

Filter a collection by NOT FIND_IN_SET

I need to filter a collection by a negative FIND_IN_SET. I know I can do this: $collection->addAttributeToFilter( 'attribute_code', [['finset' => 4], ['null' => true]] ); This ...
7
votes
3answers
3k views

Fastest way to check if products exist

I have an external file containing product details, I'm looping through this file and for each product in said file I have to check if the product already exists in magento. The value to evaluate if ...
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 ...
7
votes
1answer
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?
7
votes
2answers
1k views

How to group numeric attribute ranges similar to prices in layered navigation?

I have a numeric attribute that is a size (in cm). I would like to group products into ranges of the attribute similar to how prices are grouped. So if I have several products with sizes 151cm, 152 ...
7
votes
2answers
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/...
7
votes
1answer
1k views

Filtering category collection producing incorrect behaviour with flat catalog enabled

I have some code to perform a basic search of categories. It works by searching the category name and description - attributes that are both core. The code I have is as follows: $_categories = Mage:...
7
votes
1answer
1k views

Attrbributes Sets & Attributes: Non-Technical Overview/Logic

I work on the 'business' side of Magento (i.e. I'm not a developer). I'm looking to get a better understanding of the theory behind Attributes & Attribute Sets. My goal: Come up with a few rules ...
7
votes
1answer
3k views

Magento 2 Product Attribute Swatch Image

I have created a product attribute that is using an image swatch for each attribute value. My question is how can I go about retrieving the image swatch URL from the attribute within my product view? ...
7
votes
1answer
2k views

How does gallery attribute work

I don't understand what the gallery attribute does? I've imported products and images. The images were imported into an attribute called gallery but they don't show up in the admin or on the front-end....
7
votes
1answer
974 views

In Magento 2 , configurable product options disabled after the first selection.How to reset option?

I am using Magento 2, 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 Simple Product associated with it, ...
7
votes
2answers
4k 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. ...
7
votes
1answer
2k views

Custom /catalogsearch/ filters

Beforehand I have to tell: I'm a total n00b on Magento and what I need to know is more a "common practice" or "standard" about how is something achieved in Magento, since I have to maintain (in record ...
6
votes
3answers
40k views

Creating new attribute using addAttribute() in installation scripts

I'm writing an installation script in an extension that adds some new attributes. I'm using the following. I'm following and old tutorial (http://blog.chapagain.com.np/magento-adding-attribute-from-...
6
votes
5answers
28k 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::...
6
votes
5answers
19k 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?
6
votes
2answers
7k 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 ...
6
votes
2answers
7k views

Programmatically remove attribute from attribute-set

I've tried removing an eav_entity_attribute using this code: $entAttr = Mage::getModel('eav/entity_attribute')->getCollection() ->addFieldToFilter('attribute_set_id',$set->getId()) ...
6
votes
3answers
11k views

Order filter layered navigation magento

I have some attributes (size, color, type ect). I want to order them in layered navigation in category page.
6
votes
4answers
4k views

Magento keeps changing an attribute's backend type from “int” to “varchar”

In Magento, you can't create a custom attribute of type "decimal" or "price". But it's possible to create the attribute as text, and change the backend_type in it's database record from "varchar" to "...
6
votes
2answers
16k views

Get custom category attribute

In this class app/code/core/Mage/Catalog/Block/Navigation.php in this method: /** * Render category to html * * @param Mage_Catalog_Model_Category $category * @param int Nesting level number * @...
6
votes
4answers
10k views

Add an image attribute in Magento product admin

This feels like it should be really simple - but I can't seem to find the answer. I would like to add an attribute in magento where the user can upload an image. I do not want this to appear as a ...
6
votes
1answer
2k views

Configurable Products - attribute label, “use default” issue

When I create a configurable product, in the tab "associated products" the checkbox for "use default", label for attribute is unchecked. I have fixed this altering the product.js (line 404), adding ...
6
votes
3answers
9k views

Change attribute set of existing products

How can I change attribute set of existing products in magento version 1.9. I searched the solution in google got this Flagbit change attribute (for upto 1.6). But I want it for version 1.9 or more.
6
votes
2answers
695 views

How can I create an attribute as “not configurable” from an install script?

When I create a dropdown attribute, Magento is always setting the "Use To Create Configurable Product" as Yes. While in the install script I added in the options array to the ...
6
votes
1answer
3k views

Magento 2 Configurable option not showing my custom theme

Magento 2 Configurable Swatch option option not showing my custom theme but it's working in Default theme My Default theme Custom Theme Product Details page it's working fine only problem is ...
6
votes
1answer
7k views

How can i change the Attribute Set by products? [duplicate]

I need to change Attribute set for some of the products but there is no option to change them.
6
votes
3answers
5k views

Programmatically changed attribute is not visible on frontend (product list)

We have a custom attribute which is added to the default attribute group. Used in product listing is yes and it is added in the config.xml to the product collection. The values of the attribute are ...
6
votes
2answers
2k views

How to display core Country of Manufacture attribute in layered navigation?

I like to have core Country of Manufacture attribute displayed in the layered navigation but it seems simply selecting one of the "Filterable" options in Use In Layered Navigation field is not ...
6
votes
1answer
649 views

Product attribute value - Magento 1.9

I'm looping through the items in cart and printing some values, but I cannot get the product's attribute values. Here's how I'm doing it: $cart = Mage::getModel('checkout/session')->getQuote(); ...
6
votes
1answer
508 views

Magento 2.2.5 Product attribute “use in search” RESETTING after index:reindex

UPDATE:: Today i discover that happen when the cron run index:reindex How can I fix? Today during configuring manufacturer attributes I found a bug or however an anomaly on Magento 2.2.5 I, ...
6
votes
2answers
6k views

Magento2 : How I can add Date of Birth field to customer address

As per Magento default "Date of birthday" is display in customer registration form. I want to show it on customer address form in checkout step. Any way to display it on customer address form. I don'...
6
votes
4answers
7k views

Magento 2 - Get attribute options and sort order

I need to get the label and sort order (as defined in backend) of all the options of a custom attribute, programmatically. I'm using this interface: Magento\Eav\Api\AttributeRepositoryInterface This ...
6
votes
2answers
409 views

Get Magento Manufacturer Logo for Current category in Category Page

I'm using this code to get magento manufacturers' label in current category page. (show brands for just current category not all the brands) $manufacturers = array(); $filterBlockName = 'catalog/...
6
votes
1answer
1k views

Magento 2 : How to get the product attributes based on attribute set id on listing page

I am trying to get product attribute in product listing page based on attribute set id but its not working properly. can anyone help on this. $attributes = $_product->getAttributes(); foreach ($...
5
votes
5answers
13k views

Get Attribute of products of the products in cart at onestepcheckout

I was trying to define some exceptions, and one of them is about the volume of the product. I've got width-length-height attributes in the products. And i was trying to get the total of these 3 ...

1
2
3 4 5
45