Questions tagged [eav]

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

Filter by
Sorted by
Tagged with
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" ...
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 ...
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 ...
25
votes
0answers
975 views

Magento Profiling - Why so many EAV: Magento\Eav\Model\Config::getAttribute?

I'm just reviewing the speed of a store and just wondering if anyone knows more about why I have over 100 EAV: Magento\Eav\Model\Config::getAttribute 0.006978 rows within my profiler. It's just I do ...
21
votes
2answers
1k views

Magento Each New Invoice Increment Id Increment By 5?

I need to increment each new invoice id by 5, i have tried below code. But changed all invoices, shipments, orders and credit memos. I need each new invoice id increment by 5, shipments increment by ...
19
votes
3answers
5k views

Magento 2: Are Flat Tables Still a Thing?

Are flat tables still a thing we need to worry about in Magento 2? I know there's UI where we can turn the flat tables on, but I'm unsure how well they've been tested, and if they're even needed ...
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 ...
19
votes
3answers
4k views

Property does not have corresponding setter in class Magento\Quote\Api\Data\AddressInterface while change checkout step

1 - I add a eav attribute to customer_address $attributesInfo = [ 'reference' => [ 'label' => 'Reference', 'type' => 'varchar', 'input' => 'text', ...
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')->...
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 ...
18
votes
3answers
5k views

Magento 2: What is the difference between the row_id and entity_id in the %_entity tables?

In Magento 1, there wasn't a column called row_id in the entity tables, you just had the entity_id: CREATE TABLE `catalog_category_entity` ( `entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT ...
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( ...
11
votes
3answers
3k views

Right way to implement getExtensionAttributes()

I was wondering, what's the right way to implement an extensible EAV model. I see that in Magento\Catalog\Model\Product, the method getExtensionAttributes() is implemented like this: public function ...
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 ...
9
votes
1answer
106 views

The _data of an EAV model

I understand that the _data of a simple model (e.g., cataloginventory/stock_item) is an array of field value pairs, which corresponding to the fields of database tables. I was curious to know the ...
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.
8
votes
2answers
1k views

Why attributes of bundle items of a bundle product are also saved to the bundle product itself? (database-wise)

Recently I was studying how the options of the layered navigation filter on the category page are determined and retrieved. I have dug a bit into the models and database for it, and there I found the ...
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 ...
7
votes
6answers
19k 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. <?...
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 ...
7
votes
1answer
600 views

Magento Too many tables error bulk updating products

This morning while selecting and enabling some one hundred products in magento i got this mysql too many table error Below is the snippet from the log file a:5:{i:0;s:92:"SQLSTATE[HY000]: General ...
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 ...
6
votes
3answers
246 views

What is the use of the is_data_sharing field in eav_entity_type?

I am looking in the Magento database structure and found the is_data_sharing field in the table eav_entity_type. I want to know what the use of this field is.
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. ...
6
votes
2answers
3k views

Set dropdown value using text value

I have a small import script that will import product to Magento 1. It works well but there is something not work.If a product attribute happen to be a select type attribute the value will not save. ...
6
votes
2answers
593 views

What is the right way to get both, the admin translation and the frontend value of a multiselect attribute?

I am using the following code to fetch the admin option value as well as the frontend label from an ID list of vales of a multiselect. $attribute = $this->eavConfig->getAttribute('...
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; ...
6
votes
4answers
5k 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
737 views

Custom Entity Models - Using EAV vs Flat

I am working on a module that is essentially replacing a number of Magento features with custom logic. This is mainly due to the fact that I require pricing to 5 decimals of precision, but that is ...
6
votes
2answers
8k views

How can I add customer attribute in Magento 2?

Note: The question was referring to magento2-dev-beta and the code for setup scripts is not the same anymore in Magento 2.x. I'm playing with Magento 2 and I'm stuck in adding attribute for customer ...
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 ...
5
votes
2answers
2k views

“Undefined Index Notice” in EavAttribute.php when adding a swatch option

I am using Magento 2 and I created an attribute called hair_color that is of a visual swatch input type. I have inputted 140 swatch options for this attribute, but on the 141 I keep getting this error:...
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 ...
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 ...
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 ...
5
votes
3answers
3k views

How do I add additional options to customer gender?

I have a client who would like to add the option 'Transgender' in addition to Male and Female in the gender field. Can I do this directly in the database? Would I need to update anything beyond the ...
5
votes
2answers
2k 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 ...
5
votes
2answers
4k views

Invalid argument supplied for foreach in Mage/Eav/Model/Entity/Collection/Abstract.php on line 776

After upgrading magento to 1.8.1.0 (from 1.7.) I am now seeing this error in my system.log: 2014-05-26T10:39:56+00:00 ERR (3): Warning: Invalid argument supplied for foreach() in app/code/core/...
5
votes
1answer
2k views

What's the standard way to load the source model of product attributes, with respect to the default source model?

I have a product attribute with type "select", for example "manufacturer". No source model is defined, so Magento uses the default source model, defined in Mage_Eav_Model_Entity: const ...
5
votes
2answers
2k views

Howto add attribute to multiple attribute sets programmatically in magento2?

Subject. Which classes I need to use to deal with it? It seems that I don't understand much about how attributes work. For example I use this code to add attribute to one attribute set and to one ...
5
votes
2answers
3k views

How can I save store specific product attributes without modifying untouched attributes?

When I try to update a product in a controller in the backend, default values of products are overwritten. For example given a product with id 1 having its name set in store 0 and storeview 1 using ...
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 ...
5
votes
1answer
578 views

Sales flat order: ext_customer_id, ext_order_id

Does anyone know what the purpose is of the order attributes "ext_customer_id" and "ext_order_id"? The Magento code appears to introduce these attributes and they appear on each order, but never ...
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?
4
votes
1answer
9k views

What is the best way to check if an EAV attribute exists in Magento?

Who would know how to check if an attribute exists in magento before adding options to it? Thanks a lot!
4
votes
2answers
1k views

Magento 2: Schema Changes for EE Catalog Staging

Does Magento 2's "EE Catalog Staging" feature rename the entity_id column of the catalog_product_entity_datetime table to row_id? An old client recently reached out to me to say, after upgrading to ...
4
votes
2answers
5k views

Add new column to an EAV table `catalog_product_entity`

I tried to add new column to the table catalog_product_entity via a setup resource. But when i try to save a value to table (using setMyColumnName()), the value is not reflected in the underlying ...
4
votes
2answers
9k views

Filter Category Collection by Enabled, Visible Products

I want a list of category IDs, which have products that have... visibility: Catalog or Catalog and Search status: enabled (for the given store) I can't find a built-in way to do this that is fast. ...
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 "...

1
2 3 4 5
8