Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [custom-attributes]

Denotes questions regarding Magento custom attributes

19
votes
2answers
15k 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/...
11
votes
5answers
20k views

Magento 2: How to display custom attribute in catalog?

I’ve created a new textfield attribute, with the following settings set to yes: Visible on Catalog Pages on Storefront Used in Product Listing The attribute is assigned to an attribute set and it ...
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(); //...
8
votes
2answers
6k views

Magento2 REST Update custom attributes

How can I update the custom attributes such as description? The following code properly update price and product name, but not custom attributes (unchanged). The new product is created properly with ...
7
votes
1answer
496 views

Magento 2 Customer address attribute not saved while creating new order from admin

I have created one "Customer address" type of attribute name "Suburb", It successfully created. It shows on Checkout, Customer create(admin) and Create New Order address(Admin) section, While It ...
7
votes
1answer
564 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
2answers
658 views

Magento 2: Create customer attributes programatically, without install script

How to create customer attributes magento 2 so it works in running script without install script:- /** * @var \Magento\Eav\Setup\EavSetupFactory */ protected $eavEavSetupFactory; ...
5
votes
2answers
506 views

Magento 2 : Unable to set custom customer attributes programmatically

I have a cron job that runs once a day, that reads a file uploaded to the server, and registers users from that file. The code works fine, but now I added a custom attribute to the customer (lets call ...
5
votes
5answers
5k views

Magento2 : How to update attribute option programmatically?

How to update attribute option (update label for a store) programmatically?
5
votes
1answer
5k views

Magento 2 How to add custom product relations?

I am needing to add another related products attribute to associate multiple other products. I have found a solution for Magento 1: http://inchoo.net/magento/how-to-add-custom-product-relations-in-...
5
votes
2answers
894 views

add values for custom attributes programtically

We are creating product programtically & inserting values for default attributes with help of below code. how i can add values for custom attributes . attribute code : delivery_info , attribute ...
5
votes
2answers
5k views

Magento2.1 - Show custom category attribute on frontend

I added a custom category attribute via a module as this tutorial shows, that's working fine; the field is shown and saved correctly in the backend. But I can't figure out how to show it on the ...
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
359 views

Magento 2 : Sort by custom attribute numeric value

I create a custom attribute in Magento 2 backend and make it use for sorting listings. The problem is the value is numeric in this attribute EX: (1,4,5,3,7) other attributes with text value sorting ...
5
votes
4answers
1k views

How to add a unique custom attribute for a customer?

I was able to add a custom attribute called 'Username' to the Magento Customer model. The install-function in InstallData.php looks like this: public function install(ModuleDataSetupInterface $setup,...
4
votes
4answers
6k views

Product custom attribute import with CSV Magento 2.2

I am trying to import product with CSV in Magento2. In first case all attributes are default attributes so import works fine. Now In second case I have added some custom attribute in my Magento 2.2 ...
4
votes
2answers
969 views

Magento 2 how to get custom attribute value in cart page and mini cart

Magento 2 how to get custom attribute value in cart page and weight in mini cart.
4
votes
2answers
227 views

Magento 2 | Access custom order attribute

I created an custom attribute for orders: UpgradeSchema.php <?php use Magento\Framework\Setup\UpgradeSchemaInterface; use Magento\Framework\Setup\SchemaSetupInterface; use Magento\Framework\...
4
votes
3answers
2k views

Magento 2. Add attribute to Catalog Price Rule

Is it possible to add additional (simple string) attribute to the Catalog Price Rule? If it is, please, tell about it in details. Better with working code example. [UPD] I mean add attribute to the ...
4
votes
2answers
3k views

Customer custom attribute not showing in admin form

I successfully add customer custom attribute for magento 2.2.5 like this: $setup->startSetup(); $insertArray = array( 'profile_picture' => array("type" => "varchar", "label" =&...
4
votes
3answers
947 views

(Zend_Db_Statement_Exception): SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'created_at' in where clause is ambiguous

I added sku, country_code and product name in the order grid. All works fine but when I filter Orders by Created at it throws following error Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[...
4
votes
2answers
236 views

Widget/block code in product custom attribute not rendering at front-end magento 2.2.5

I have created custom attribute of Input Type "Text Area" with WYSIWYG option Enable. After that add widget code in that product custom attribute input at store back-end. Its showing same code ...
4
votes
1answer
2k views

Create customer custom attribute with input type checkbox, multiselect, and radio Magento 2

I successfully created custom attribute for customer with input type select/dropdown like this: $code = 'test'; $customerSetup = $this->customerSetupFactory->create(); $customerSetup->...
4
votes
1answer
59 views

How to get custom product attribute

I added new attribute src/app/code/local/PACK/MODUL/sql/pack_modul_setup/mysql4-upgrade-2.1.6-2.1.7.php : <?php $installer = $this; $installer->startSetup(); $installer->addAttribute('...
4
votes
2answers
3k views

How to save custom attribute value in customer entity table using controller

I want to save value in customer entity table in this table. I created one custom field & I want to save value in custom field using controller. But it is not working. How is it possible? ...
4
votes
2answers
4k views

How to create a customer programmatically with custom attributes in Magento 2?

I would like to create a customer account programmatically in Magento 2.0.4. I just have one problem. I don't know how to persist custom attributes. With following code, I got response that my ...
4
votes
2answers
3k views

Get custom attribute dropdown/multiselect options label and value in Magento 2

I created customer custom attribute with input multiselect like this: $code = 'multiselect_test'; $insertData = array( "type" => "text", "backend" => "", "label" ...
4
votes
3answers
3k views

Magento2 : Custom Category Attribute value Not Saving?

I've create a module to add a custom attribute to my categories, however my code doesn't seem to be creating the attribute in my eav_attribute table, the field shows on my category pages but it doesn'...
4
votes
1answer
1k views

Remove custom attribute from attribute set programatically magento2

I am trying to create a custom attribute and add it to a custom created attribute set. The problem is that it is being added to the Default attribute set. How can I make it only appear in my attribute ...
3
votes
4answers
19k 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.
3
votes
1answer
2k 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
2answers
6k views

How to get all children product from parent configurable product in magento2

I need to display some custom attribute from children product in checkout, I study for long time to come out a stupid solution Override Magento\Swatches\Block\Product\Renderer\Configurable Inject ...
3
votes
1answer
3k views

How to add extension attribute Magento 2

I'm trying to add an extension attribute to sales_order (\Magento\Sales\Api\Data\OrderInterface), and I have the following extension_attributes.xml: <config xmlns:xsi="http://www.w3.org/2001/...
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
1answer
2k views

Quick Simple Product Creation: Add new Custom Attribute of MultiSelect each time When I Want to Add New Simple Product

I’ve got a moderately specific question. I’d like to add a new field to the Quick simple product creation section, in associated products, when creating configurable products. Here’s why (so if there ...
3
votes
1answer
1k views

Custom Customer Attribute not Saving Magento 2

I have used the following script to add a custom customer attribute. <?php namespace Harrigo\ContractPricing\Setup; use Magento\Customer\Setup\CustomerSetupFactory; use Magento\Customer\Model\...
3
votes
1answer
5k views

Magento 2 - Save additional data to order

I am trying to build an extension that will check if a specific cookie exists at the time an order is being placed. If the cookie does exist, I would like to save its value to the order in the ...
3
votes
2answers
3k views

Magento 2, add Custom Text Attribute to the Products

I add a Custom TEXT Attribute (more_info) to my Magento 2 Store and I will show the Value to my product.info.main Page. I add mytheme\Magento_Catalog\layout\catalog_product_view.xml <...
3
votes
1answer
1k views

Magento 2.1: Add custom category attribute to topmenu classes

I have created a custom category attribute and it saves correctly in the database. I am now trying to add this attribute's value to the topmenu. So I have created Topmenu.php in my module (...
3
votes
1answer
5k views

Update Custom Attribute Value Programatically

I have created a script that tests importing products programmatically into Magento. Unfortunately, I'm having trouble updating a product's custom attribute value - in this case "manufacturer." When I ...
3
votes
2answers
166 views

How to hide a custom text attribute which displayed in product edit backend

I am using Magento 2.2.5 I need to hide a text attribute which I'm using to save serialized data of custom options of product. I think this can be done using adminhtml/ui_component/product_form.xml ...
3
votes
1answer
901 views

Set manufacturer in REST API

I am trying to set the manufacturer for import logic (REST API) and I have the manufacturer name. However the API is expecting an int for the manufacturer attribute. Is there a way to ...
3
votes
1answer
1k views

Category custom attribute, doesn't save value - Magento 2.1.2

I am creating a custom attribute for categories using this resource. The attribute field "Tagline - Category Head" is shown fine in the backend, but when I type a value and save the category, the ...
3
votes
1answer
3k views

How to display all the attribute values of product attribute?

I'm new to Magento and I'm developing E-commerce site in Magento 2. I have created an attribute "Power Type" (MultiSelect) and gave 4 options to it and assigned it to "default" Attribute set. I ...
3
votes
2answers
89 views

Magento 2 Plugin Not Extending Model - Finally Solved It

I'm trying to use a plugin from the answer on this question Add additional select attributes to grouped product's child collection I would go back and ask the person who answered but I don't ...
3
votes
3answers
715 views

Magento 2: Unable to Save Custom Order Attribute Programatically

I have added one custom attribute to order. but i am not able to save it from my custom file programatically. use \Magento\Sales\Model\Order; $_objectManager = \Magento\Framework\App\ObjectManager::...
3
votes
3answers
2k views

Unset custom data from product attribute

I am trying to update a product with some custom attributes. I need to unset data that is being passed to set the value to none. I am currently on Magento 2.1 ... $updatedProduct->unsetData($...
3
votes
1answer
1k views

Add Custom Attribute in Customer Account admin side and its value from another Module?

I want to add a multiselect dropdown attribute to Customer module in Customer Account Tab (Admin Panel) and Want its value from my another module. Please let me suggest how can I achieve this. I am ...
3
votes
1answer
1k views

Magento 2 : How to save value of custom attribute defined in customer registration form in frontend?

InstallData.php <?php namespace Pulsestorm\NewModule\Setup; use Magento\Customer\Setup\CustomerSetupFactory; use Magento\Customer\Model\Customer; use Magento\Eav\Model\Entity\Attribute\Set as ...
3
votes
1answer
114 views

Accessing custom product attributes on custom form page (not product / category view page)

Is there any way of accessing the current / most recently viewed product on a custom contact form-type page? For example, a user is on a product view page, then clicks a link which takes them to a ...