Questions tagged [eav]

Questions about Magento's Entity Attribute Value (EAV) implementation

Filter by
Sorted by
Tagged with
18
votes
6answers
43k views

Magento 2 - How to get attribute options value of eav entity?

How can I get the attribute options values of eav entity? I found solution only for magento 1.x but M2 I don't know. M1: $attr = Mage::getResourceModel('eav/entity_attribute_collection')->...
35
votes
6answers
6k views

How to create an EAV entity?

How to create an EAV entity? This is a question that pops up a lot on the web. There are some good blog articles that explain how to do that, but none of them are satisfying for me. So I decided to ...
18
votes
2answers
73k 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 ...
19
votes
3answers
1k views

The purpose of 'eav_' tables

I've always wondered what is the meaning of the tables : eav_entity eav_entity_datetime eav_entity_decimal eav_entity_int eav_entity_store eav_entity_text They are always empty. They are created ...
4
votes
4answers
24k 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.
4
votes
2answers
7k views

What are the differences between EAV and Flat catalogs?

Can anyone provide a clarification on the differences between EAV and Flat catalogs, when accessing the sub categories of a category?
3
votes
1answer
679 views

Strange behaviour with loading entity by attribute

Maybe I'm missing something fundamental by how can it be that the following code works fine and finds an entity: $model = Mage::getModel('catalog/category')->loadByAttribute('url_key', $...
39
votes
1answer
2k views

Why is there no partial re-indexing for EAV and tags?

This question was puzzling me for quite a while. Why is the improvement bugfix introduced in Magento 1.13.x.x called partial re-indexing not covering "Product Attributes" and "Tags Aggregation Data" ...
11
votes
1answer
5k views

When we look at an eavSetup what values are available for type and input?

When creating an install script for Magento 2 what values are available for the type and input parts of eavSetup->addAttribute()? Or where could I look to find out? $eavSetup->addAttribute( ...
5
votes
3answers
11k views

Source Model not found for Attribute

Edit: For anyone who may also have this problem, make sure that your spelling is correct, but also that your capitalization is correct. And remember that magento cannot read model files that have any ...
2
votes
1answer
3k views

Inconsistent product attribute index: Duplicate entries in catalog_product_index_eav

I have a strange inconsistency in the attribute index that could not be solved with a full reindex. For a dropdown attribute there are two different values for each store, like this: mysql> ...
5
votes
1answer
2k views

Magento 2 : How to Get all User Defined Attributes in Product Model

I need to get all attributes of catalog_product - entity_type_id which are user defined. I can do this via eav/config analogue in Magento 1, but how can do this in Magento2 ? Something like this ...
4
votes
4answers
4k 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 ...
3
votes
1answer
1k views

What model to use to query customer_entity_varchar table in Magento 2?

I have a custom varchar attribute stored on customers. I've been struggling to find the proper way to query for a specific attribute value without going straight to SQL joins. What is the right way to ...
3
votes
2answers
305 views

How to add custom entity from admin in magento

I am working on a project where I need to add a custom user from the magento admin panel. This user cannot purchase the products. He can only login to his section and write reviews on products or ...
2
votes
1answer
295 views

Magento 2 : Eav module record can't save in custom module table

I create custom EAV module. app/code/VendorName/ModuleName/Model/ResourceModel/Mainpage/Collection.php <?php namespace VendorName\ModuleName\Model\ResourceModel\Mainpage; class Collection ...
1
vote
1answer
118 views

Why entity values are stored in different tables based on attribute type?

The values of customer entities stored in different tables based on the attribute type ex: customer_entity customer_entity_datetime customer_entity_decimal customer_entity_int customer_entity_text ...
28
votes
3answers
32k views

Delete custom EAV attributes from the database

I want to remove unused EAV attributes directly from the database before I move my store live. Attributes can be found in eav_attribute table, can I delete attributes from this table? Is it safe? Or ...
6
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. ...
9
votes
1answer
13k views

Magento2 Adding Custom Order Attribute

How would I add a custom attribute to an Order in Magento. It seems clear for Product and Customer, but I can't find any info for adding extra attributes to orders.
5
votes
1answer
4k views

Magento2 Create eav_attribute for catalog

I'm trying to understand how magento2 is creating attributes in initial installation and using this I'm trying to create my own attribute. For example I'd like to create duplicate of thumbnail ...
9
votes
4answers
5k views

Why do attribute codes have a maximum length?

When trying to create attributes, I've discovered that the maximum length of an attribute code is 30 characters. Turns out though, that this is NOT actually some sort of real restriction - it is a ...
7
votes
1answer
420 views

Use Entity as Attribute of another Entity in Magento

I'm going to follow this tutorial but my question is.. is it possible to use an EAV Entity as attribute of a new EAV Entity? Thanks. EDIT: The tutorial that I originally posted is quite messed up ...
5
votes
1answer
2k views

Custom EAV model in magento 2

How we can create custom Eav entity and model in magento2. I want to create a custom module where new attributes/fields can be created by user. I will use it to show the details in the grid in admin ...
3
votes
2answers
4k views

Magento 2 How to add custom attribute to customer address and how to insert value in that attribute?

I want to add a new custom attribute to "customer_address" that I did with an attribute installer script, now I am able to see that field in "eav_attribute" table. I have created a module and I have ...
2
votes
1answer
3k views

Is it possible to save attribute value per store in custom eav based model?

Let's say I have custom EAV entity type with it's tables that have store field (just like catalog/product tables have). Can default EAV resource model save data per store? From what I have seen, in ...
1
vote
3answers
7k views

How to completely delete EAV attribute and all its data from the database?

What is the correct way to completely remove category attributes from the database? Attributes were added this way using setup script: $setup->addAttribute('catalog_category', 'seo_text', array( ...
8
votes
1answer
2k views

What is the difference between `joinField` and `joinTable` in collections?

In the file app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php, there is a function named joinField and there is another joinTable. If fields are actually columns in the flat tables, what ...
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
6answers
13k 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; ...
4
votes
1answer
9k views

Adding a new eav attribute type “file upload”

I need to have the ability to add a file upload at the admin site and process the files after these have been uploaded. As a first step I like to extend Magento eav attributes with a new custom type "...
3
votes
1answer
879 views

Magento 2 : How to create an EAV entity module?

I want to create EAV entity module. I refer these below links. I want to do the same in Magento 2. How to create an EAV entity? How to do it in Magento 2? Please help me. Thanks. UPDATE: I can ...
2
votes
1answer
354 views

Removing an EAV entity

I'm creating a CRUD module for Magento2 with an EAV entity. My first step is to install and uninstall the module. My EAV entity is similar to products, categories and customers. The install script ...
2
votes
0answers
210 views

Saving values to new EAV Entity Magento [closed]

I posted this question the other day and I've successfully created a new EAV entity with other Entities as Attributes. This new Entity is called Result and has Championship, Event, Athlete, Brand, ...
2
votes
1answer
2k views

Add custom drop-down in Shipping Method

Basically I am trying to add new custom drop-down option with values in Shipping Method option, in one page checkout. I am following this tutorial to create attributes and confused about some issues. ...
1
vote
5answers
6k views

Magento 2 Attempt to load value of nonexistent EAV attribute

I see in my log the nexe warning: [2017-05-05 12:23:53] main.WARNING: Attempt to load value of nonexistent EAV attribute '339' for entity type 'Magento\Catalog\Api\Data\...
0
votes
1answer
204 views

Eav Attribute update problem

I followed this article: http://inchoo.net/magento/creating-an-eav-based-models-in-magento/ I created the Inchoo Blog module, after the firt time it ran the controller code the situation on the ...
0
votes
2answers
302 views

How to set value for radio button in EAV attribute of product type?

We can add simple boolean Radio buttons as EAV attribute in install schema by this code: "type" => "int", "backend" => "", "label" => "Test", "input" => "...
6
votes
3answers
6k views

What are entities in Magento 2?

Entities in Magento 2 are like: Product is an entity? Order/Sale is an entity? Customer/Users/Clients is an entity? etc?? Where can I find a list of all entities? Are they declarated in the DB? For ...
4
votes
2answers
952 views

Raw sql for product collection with addAttributeForSelect() method without loading collection

How can I get raw full sql query from non-loaded product collection with addAttributeToSelect() method without load collection ? This code: $collection = Mage::getModel('catalog/product')->...
2
votes
1answer
1k views

Magento 2 : addAttributeToFilter, addAttributeToSelect, addFieldToFilter not working

I created eav entity module. But, when I use this addAttributeToFilter, addAttributeToSelect, addFieldToFilter function in my custom module collection. It's not working. My collection file : I ...
2
votes
1answer
934 views

Magento 2 : Custom model with EAV attributes. PUT is not working

I'm trying to figure out how works EAV attributes. So I made a simple example with API rest. Everything is working except when I call PUT function: { "sample" : { "id": 22, "name":...
2
votes
1answer
5k views

Custom Attribute and value not Appearing in Flat Product table if Attribute is not in…Product Listing,Product Listing,Layered Navigation

Basically I installed one market place module in my website......that have a validation attribute...but which is not ...Product Listing,Product Listing,Layered Navigation...so when I use Flat Product ....
2
votes
1answer
610 views

Unable to get multi selected eav attribute values in magento

I have a multi select attribute in eav_attribute with attribute_code my_managers, its entity_type_code is customer_address, I want to get selected value,,I am trying to export it to csv,in my ...
2
votes
1answer
403 views

Customer address attributes of type datetime and decimal cannot be cleared from the admin

I have added custom datetime and decimal attributes to the customer address entity using update scripts such that they can be edited via the admin. Although it is possible to add or update the ...
2
votes
1answer
462 views

row_id vs entity_id in magento 2.3 EE

In Magento 2.3 EE, entity_id is missing in EAV tables, instead row_id is available Please explain the difference between row_id and entity_id and the removal of entity_id in EAV tables
2
votes
1answer
684 views

adding addFieldsToFilter() does INNER JOIN on eav tables, removing all products which don't have that attribute

This is either a simple fix, or something that magento does natively and I'll have to do a workaround (which I still need to know what it is). Here is my code: $products = Mage::getModel('catalog/...
1
vote
2answers
1k views

How to create grid using ui component for custom eav model

I have created a new entity type and custom EAV model. Now i am trying to create grid for it using ui component. How we can use the eav data collection instead of flat table for grid?
0
votes
1answer
39 views

Can't create custom attribute for order_address

I need to create a custom attribute on the order address to stock my ERP id of the address for a syncing purpose. I've tried to create a Eav in Maru3l/SyncOrchestra/Setup/InstallData.php. I don't see ...
0
votes
1answer
412 views

Magento: update customer attribute to be “required”

apparently we have to add "||$attribute->getAttributeCode()=="email" in our checkout template to show the e-mail field, because isREquired returns false. See below. My question is: how can I set the ...