Skip to main content

Questions tagged [product-attribute]

Questions about creating, managing and using product attributes

Filter by
Sorted by
Tagged with
0 votes
2 answers
1k views

Magento 2 Get product attributeId in foreach loop

I have a collection of product I am looping and displaying for E.G ... $product->getName() ... $product->getProductUrl() ... Now Also I am getting it some option like attributeText foreach ...
0 votes
1 answer
2k views

Bulk adding & updating product attribute

[M1] I have over 2000 products in my Magento store. I want to add a new attribute called 'Warranty Terms' to display it on the frontend. This is going to be the same for all products. I know how to ...
0 votes
1 answer
30 views

Get product attribute value on category page - Magento2

We want to load the product attribute value on the category page, of all attributes with a value "Yes" of label "is_featured". We create the following code in the list.phtml, but ...
1 vote
1 answer
8k views

How to export all the attribute and its options in magento 2

I wish to export all the attribute and its options in magento 2 via script. Please provide me a solution, How to export attributes and its options
4 votes
1 answer
3k views

Color swatch and text swatch issue in magento 2

If I used color and text swatch in magento 2, sequence/order of option isn't changing. I mean I want to show 1. size 2. color but it always show 1. color 2. size if I used dropdown instead of ...
0 votes
1 answer
2k views

Magento 2: Set Product Attribute Dynamically

How to set product attribute dynamically, I am using catalog_product_save_after event and catch the event using Observer. here is my observer <?php namespace Learning\HelloPage\Observer; use ...
0 votes
1 answer
2k views

magento 2: how to checked use default value for product status programmtically?

I have to update and checked checkbox for use default field for product status. But I do not know how to update and checked that checkbox ? here is my code $objectManager = \Magento\Framework\App\...
0 votes
2 answers
3k views

Magento Product custom attribute options not showing up in admin

In my Magento ce 1.9.2.1 website, I have created many product custom attributes by setup-upgrade scripts like below: <?php $installer = new Mage_Eav_Model_Entity_Setup('core_setup'); $installer-&...
3 votes
1 answer
2k views

Edit New and Sale labels on products

I am really struggling to find the file I need to edit to change the text for new and sale labels on products. I'm referring to the labels that appear on products when you set the new date range or ...
1 vote
1 answer
4k views

How to get product parent category id and category id separatly in magento 2.2.6 using product ID?

Problem definition: I have product under below category: Beauty --> Sun --> my-some-product-name. where 'Beauty' is root category and 'Sun' is the subcategory of 'Beauty'. Currently, I am ...
1 vote
2 answers
2k views

Custom Attribute is not saving data in database

I'm trying to add custom text box named cashback in Magento 2 product add/edit page. I added the text box programmatically. But my below code doesn't add column in the table also not saving the value. ...
7 votes
2 answers
5k 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. ...
0 votes
2 answers
2k views

How to use Different units for Magento 1.9.2.2

We recently start a store which includes grocery, clothing, and jewelry on this when I upload product for grocery and other we facing a problem. All product weight are considering Kgs or Lbs but we ...
1 vote
3 answers
2k views

Magento2: create product attribute in non install/upgrade scripts

What is the right way to create a product attribute in a non install or upgrade scripts in Magento2?
0 votes
2 answers
3k views

Magento2: How can create custom datetime product attributes and show timer in frontend?

I want to create custom datetime product attribute with "start from" and "start to" and want to show timer with calculation of both date. I am using custom module and creating attribute by below code ...
0 votes
2 answers
846 views

How to add type and search for Magento2 Products Attributes (dropdown)?

I want to add "type and search" select box feature in Magento 2 product attribute dropdown. It is very difficult to select brand when i have more than 1000 brands . can anyone help me ? ...
2 votes
3 answers
4k views

Get values of your attribute option text from product

I want to get value of attribute option text from product based on store id. I want to get admin text for attribute option. $attribute_option_id = Mage::getResourceModel('catalog/product')->...
0 votes
1 answer
1k views

Magento 2 product attributes hidden in product edit page?

I have a problem with magento 2. I created 2 attribute: show time countdown and show product on homepage. It work properly on localhost and other sites and magento versions. But I get an issue. All ...
1 vote
3 answers
3k views

Magento2 How to Display Product Custom Attribute Value In List Page

i have created one product custom attribute name -> 'is-buynowbutton-show' and i want to get that attribute value in product list page to show buy now based on product setting. Does anyone suggest ...
0 votes
0 answers
13 views

(Magento 2.4) Add custom filtering to product attribute in graphql

I'd like to add a filter in the graphQl product query like this products( pageSize: 5 currentPage: 1 filter: { status: { eq: "1" } ...
1 vote
6 answers
3k views

Add Wysiwyg attribute to Product in Magento 2

How to create Magento 2 Product Attribute with Wysiwyg editor Programmatically.
2 votes
1 answer
2k views

Magento 2: How to Set custom product attribute value on product save

i have created an observer, event on before product save to set custom product attribute value, here is my code. etc/adminhtml/events.xml <?xml version="1.0"?> <config xmlns:xsi="http://www....
2 votes
2 answers
3k views

Magento 2 Rest API - how do I add values to dropdown product attribute

I have problems in adding values to an existing product attribute, using the API POST /products/attributes/:attribute_id/options. The corresponding GET API is working fine, as explained below. I have ...
6 votes
1 answer
2k views

How to get the product id and SKU code of the product selected

I am using a plugin to enable notify me (Out of stock) feature, the plugin is working properly but the problem is it is taking the core product id and storing it in the backend, even after I select a ...
0 votes
0 answers
28 views

Magento 2 : Programmatically Assigning images to product taking too much time

I have around ~10k of products to create programmatically. I also have around 20 custom attributes to each product. Saving the stock, the price, special price, those 20 custom attributes it takes ...
1 vote
1 answer
3k views

Magento 2: Product collection filter with custom attributes with like

I am using magento 2.3.3 i have custom module in that i am using search when any one search i am filter products name like it is working fine but now i want add extra attributes.I have created product ...
0 votes
1 answer
336 views

Magento 2 how to create link_title column for the table catalog_product_link

How to create column called link_title to the catalog_product_link table & what are the steps, need to be followed to set the value to the respected column Did small prototype as followed here ...
2 votes
2 answers
2k views

When i post a URL to Facebook I get html code showing in the post

When I post a link to Facebook I get the HTML code of the title showing in the post. As per this screenshot : http://prntscr.com/e858be Can anyone advise why and if there is a way to stop this from ...
3 votes
1 answer
2k views

Magento 2 Create new "Catalog Input Type for Store Owner" Attribute

I need to create a special input type in adminhtml product form. My input will display as a table but save data as a standard text input. I need to create a "Catalog Input Type for Store Owner". With ...
0 votes
1 answer
2k views

Magento2: Get product date in Knockout Js

How to get special delivery end date in ko js I have implemented KO templated with Js How can I get Value of Product Special delivery date in JS for countdown <referenceContainer name="content"&...
5 votes
1 answer
3k views

Create custom “Catalog Input Type for Store Owner” for magento 2

I need to create a special input type in adminhtml product form. My input will display as a table but save data as a standard text input. Following the module Edge ProductAttachments I've created the ...
2 votes
1 answer
49 views

Problems While Creating Product Attribute With InstallData

I've created InstallData for creating product attribute with default options to be set yes like, used_in_product_listing and is_used_for_promo_rules Probelm is only used_in_product_listing is ...
0 votes
2 answers
1k views

Updating product price from code not reflect in frontend category page until I save from admin

We are updating the product prices every 10min using cron. The prices are pulled from a external API. We are using the following way to update the price, $this->updateProductAttribute('price', $...
1 vote
2 answers
1k views

Update custom attribute value for all products - Magento1.9

I have a Magento store with products count 70,000 approx. I want to update 5 custom attribute's value for all products. I have a CSV file which contains SKU and value of custom attributes for all ...
0 votes
1 answer
34 views

Adding custom product attribute to summary in checkout?

Magento 2.4.6 I added a custom product attribute next to the qty in the checkout summary following the tutorial on Add custom product attribute to checkout summary Magento 2. That works until the ...
10 votes
2 answers
22k views

How to create product's custom attribute with 'yes/no' dropdown using install Setup scripts in Magento 2?

I want to Create a product's custom attribute with 'yes/no' drop-down into my custom module. Please suggest any solution.
2 votes
1 answer
1k views

Call Magento\Catalog\Model\Product::getData() returns null

On a custom template I try to do the following calls: $a = $this->getProduct()->getData('short_description'); $b = $this->getProduct()->getData()['short_description']; $c = $...
0 votes
1 answer
28 views

Reading product attribute value for "All Store Views"?

Magento 2.4.6 Is there a way to read the value of a custom text field attribute value stored in the "All Store Views" scope? Currently I am using $product->getMyAttribute(); which returns ...
0 votes
1 answer
2k views

Multi Select Product Attribute - Magento2.1.2

I have created Multi Select Attribute in my custom module. UpgradeSchema.php <?php namespace Vendor\Module\Setup; use Magento\Eav\Setup\EavSetupFactory; use Magento\Framework\Setup\...
0 votes
1 answer
43 views

Display multiple select product attributes just like category attribute

I'd like to display some multiple select custom product attributes, in a more advanced way, just like category_id field does. (Using checkboxes, displaying selected values like tags with X option on ...
1 vote
1 answer
2k views

Add attribute programmatically

It code from */*/sql/*_setup/install-1.0.0.php $installer = $this; $setup = new Mage_Eav_Model_Entity_Setup('core_setup'); $installer->startSetup(); $setup->addAttribute('catalog_product', '...
0 votes
2 answers
1k views

Magento Get Attribute values Collection by filter

I am using Magento 1.9.3.6 version. I have an attribute called brand. I want to get brand attribute's values collection by filter in order to show it in input text box as autocomplete suggestions. I ...
0 votes
0 answers
9 views

Updating label for product attribute option on 1 storeview only

How can I update storeview label without removing label on the rest of the storeviews? The code works fine for updating just 1 storeview, but it removes all other labels. Updating store 2, removes ...
0 votes
2 answers
2k views

magento 2.4 product collection filter by custom attribute value instead of id

Via backend, I added a dropdown custom attribute on my products. Now I need to filter the product collection based on the value of this dropdown. If I add the option id in the filter, everything ...
0 votes
1 answer
2k views

Magento 2: Set attribute dropdown option programmatically

How to set product's attribute dropdown option programmatically?
0 votes
0 answers
13 views

How to apply custom price for bundle products in Magento?

I want to apply a custom price for the bundle product entered by the admin panel.
3 votes
1 answer
1k views

Magento 2 : Configurable Product Page Price Change

I imported product into magento 2. All of products are configurable products with simple products associated with them. I am using cart2cart to achieve this. There are a bunch of issues that they ...
0 votes
1 answer
2k views

How to add attribute filter in product listing page in magento 1.9?

How to add attribute filter.For eg, When city attribute not set in any product then this product are showing after filter of city. Here is my Product Collection List.php block file public function ...
0 votes
0 answers
11 views

Update Custom Attribute like Price with the subtotal in the minicart

I have created an attribute for the Product like some extra fees. I got the attribute on the mini cart, saved it in the quote also updated their price according to the product quantity. I want to ...
4 votes
2 answers
2k views

How the catalog:product:attributes:clean works?

I have used the below command in Magento CLI, php bin/magento catalog:product:attributes:clean I read the description for this command in forums and stack overflow, they only say Removes unused ...

1
2 3 4 5
37