Questions tagged [category-attribute]

Denotes questions related to attributes of categories.

Filter by
Sorted by
Tagged with
0 votes
1 answer
12 views

magento 2.4 category_form.xml add comment to fields

I'm creating some custom fields for my categories, so I've added a couple of simple text fields in the database with the setup php script, then extended the category_form.xml to show my fields in the ...
  • 147
0 votes
1 answer
104 views

Create attribute using Data Patch in Magento 2

Trying to create Category Attribute, But getting an error. foreach() argument must be of type array|object, null given in Magento_Root/vendor/magento/framework/Setup/Patch/PatchRegistry.php on line ...
  • 3,950
0 votes
0 answers
19 views

Page Builder Banner element for Category with predefined Name and Image

In Page Builder, I can add a Banner component and set its link to a category (or a product etc.). This does not set the banner image nor the (translateable) banner title to the respective attributes ...
  • 117
0 votes
1 answer
50 views

Fetch Category ID in Magento 2.3.7

Excuse my poor presentation of a question I am trying to list products of the same category on any product page of the named category. Here is the code I have, which works perfectly if done for each ...
  • 1
0 votes
1 answer
37 views

How to add product category to product meta title?

I have a product called "Wiper blades 60/50cm" which is listed in the store Category "BMW 3 Series e46" I want to add the Category name to the product meta title so that the meta ...
0 votes
0 answers
88 views

Magento2 remove specific filter on specific category value under Layered navigation

I'm trying to hide/disable a particular attribute filter in layered navigation for a specific category. I do not want to show all filter in left side bar. If I disable in Anchor is "No" ...
2 votes
1 answer
109 views

Cannot get custom category attribute value on the category page issue

I made this code to create the custom attribute: $eavSetup = $this->eavSetupFactory->create(['setup' => $this->moduleDataSetup]); $eavSetup->addAttribute( Category::ENTITY, '...
  • 3,625
0 votes
1 answer
35 views

Category description special character issue - M2

Using this I can update the category description but special characters are removed. $category_Id = 6; $category = $this->categoryFactory->create()->setStoreId(0)->load($category_Id); $...
0 votes
2 answers
97 views

Category description update using repository - M2

Using this I can update the category description but I want to update using the repository. Working good with factory method: $category_Id = 6; $category = $this->categoryFactory->create()->...
0 votes
1 answer
53 views

HOW TO GET PRODUCT ATTRIBUTE AND AVAILABILITY?

I want to get the Product attribute using Object manager and check the availability of the product if its RTS I have to assign that product to a category id.
0 votes
0 answers
40 views

Update category description - M2

I have 1000+ categories, few categories having similar name. Few having same name categories are in different parent categories. Using csv i want to update category description and images. Can any one ...
0 votes
0 answers
17 views

Getting the category of the page the product was added from. Needed to be used in Checkout for shipping method

I've looked high and low for this but have had no luck. I need to get the category of the page that the product was added from. I have written an Observer that hooks into the add to cart event that ...
  • 1
2 votes
1 answer
329 views

Category Name and URL Key issue / Admin / Migration from 1.9.1.0 to 2.4.2

I'm facing an issue further to data migration from magento 1.9.1.0 to 2.4.2 in Admin > Store / Configuration / Category Categories name and url_path are in the database, Category name also. ...
  • 21
0 votes
2 answers
31 views

How to get all the values stored in the new add category attribute in magento 2

I followed some instructions to do "Add new Image attribute for category in magento 2" and I was successful.and now I want to output all newly added images printed out in the same place on ...
0 votes
0 answers
47 views

Category attribute value changes unexpectedly after saving category in Magento 2.4

I created a module that uses an Image Uploader UiComponent to upload an additional image to a category and save its path in the database. The controller I use to do this is basically a copy of the out ...
0 votes
1 answer
19 views

Magento2 Category Attribute

I have created Attribute on category level now I want to fetch the value of this attribute. I have tried below code $_objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $...
  • 3
0 votes
3 answers
284 views

Magento2: create custom attribute description with wysiwyg editor in Category page?

how to create custom attribute description with wysiwyg editor in Category page? like this
  • 1
0 votes
2 answers
971 views

Magento2 : Custom Category Attribute Not Showing on Frontend

I've create a module to add a custom attribute to my categories, however my code doesn't seem to be display the attribute on frontend. i dont know where i am wrong. app/code/Vendor/Module/Setup/...
0 votes
1 answer
497 views

How to filter category with custom attribute Magento 2

I added a custom category attribute type yes/no like this: In eav_attribute table: the problem is when i filter follow this attribute it return empty array: $model = $this->categoryFactory->...
  • 651
1 vote
1 answer
110 views

Magento2: How to get list of category's dropdown attributes?

I am using Magento 2.3 and I want to get list of category's dropdown attributes and their values? For example I have a Furniture category and in this category I have Color and Manufacturer attributes ...
0 votes
2 answers
127 views

data install/upgrade not creating category attribute

i'm trying to add an attribute to the categories, but my setup doesn't add anything the input is visible in the categories, but you even on save the input value stays empty and i can't find any ...
0 votes
1 answer
110 views

Magento 2 - Install category attribute not work

I created a custom form for creating some attributes for the category. My code is this but it doesn't work: InstallData.php <?php namespace Create\Attribute\Setup; use Magento\Framework\Module\...
  • 327
0 votes
2 answers
44 views

Custom category attribute is not being saved - issue

I managed to create my custom attribute: $installer = $setup; $installer->startSetup(); $categorySetup = $this->categorySetupFactory->create(['setup' => $setup]); $...
  • 3,625
2 votes
1 answer
183 views

Install Data is not executed in magento 2

I am trying to create a category attribute: This is my file form Vendor/Module/Setup: use Magento\Catalog\Model\Category; use Magento\Catalog\Setup\CategorySetupFactory; use Magento\Framework\Setup\...
  • 3,625
0 votes
2 answers
244 views

Magento 2 Category Custom attribute doesn't exists error

I have created a module where i have added two custom attribute to category page. Here is my code. Setup\InstallDate.php <?php namespace Vendor\Module\Setup; use Magento\Eav\Setup\...
  • 618
0 votes
1 answer
344 views

Magento 2: how to change Category page design

I have a theme installed on my Magento V2.2.3 site and now i would like to change the category page design with requirements new custom fields for category option on each category if this category ...
  • 618
0 votes
1 answer
264 views

get Custom attributes category Magento 2

after add new custom attribute, i am trying to get my custom attribute category, filter by the parent id, actually it return me a null value or empty array I used $category->getData('label_text'), $...
  • 133
0 votes
1 answer
341 views

Magento 2 adding custom category attribute to backend after being migrated from M1 1.9.4.1

I have a question regarding a custom category attribute that was added via a module/extension in a Magento 1.9.4.1 webshop and now is migrated correctly to the Magento 2 webshop (2.3.4). I checked the ...
0 votes
0 answers
61 views

Can't get custom attribute for value magento 1.9.4.2

I have created a Custom Attribute ( attribute id: custom_attribute ) for the category. It shows up in the backend and able to save the value to it. I just wanted to print the value in the Category ...
  • 101
1 vote
2 answers
460 views

Magento 1.9 How to sort product in category page by stocks product

I want the products to be displayed on the category page, if available That is, first those that are stocks , then those that are not stocks I didn't find anything with the title in the attribute Is ...
0 votes
1 answer
263 views

How to add product category to page title as data attribute?

I am brand new to Magento and am a Wordpress developer and am trying to get my bearings on something that seems like it should be simple to accomplish. I am trying to simply add a data-attribute to my ...
1 vote
0 answers
145 views

Multiple Images for categories in magento 2

I need to upload multiple images for categories like in products in Magento 2. How can I do this? Any help is appreciated. Thank you
  • 164
0 votes
1 answer
215 views

Magento 2 : How can i get all category with all eav attributes in collection?

How can I get all categories with all EAV attributes in the collection? $categories = $objectManager->create('Magento\Catalog\Model\ResourceModel\Category\Collection'); $categories->...
  • 1,029
0 votes
2 answers
687 views

Magento 2 showing category in homepage with products using enable/disable attributes

How to get the all custom category on homepage with products. I want to create these types, Please check screens-short:- https://prnt.sc/r5b2q5 Showing this category:- Above category showing this ...
  • 3,267
1 vote
0 answers
21 views

M2.3 - Adding custom category image removes default thumbnail

I've used this module to add an extra category image field to my categories. The field itself is working fine, but whenever I add an image to it, it removes the default Category Image. When I go to ...
  • 1,218
0 votes
2 answers
59 views

Custom Category Attribute saves in fresh instance but not in migrated instance

I have added custom attribute to category. <?php namespace ................ use Magento\Framework\Module\Setup\Migration; use Magento\Framework\Setup\InstallDataInterface; use Magento\Framework\...
0 votes
1 answer
1k views

Magento 2 wysiwyg editor hide/show button not showing with custom category attribute?

I have create custom category attribute as wysiwyg editor under content fieldset. Attribute is showing and working fine but I want to add Hide/Show Editor button with atribute. How can I do this? ...
1 vote
1 answer
145 views

Wrong sort order on category page Magento 2.3.0

I have created an attribute that is used for sorting on the category pages. The sorting order is numeric. Expectation is that sorting order is: 1. 1 2. 2 3. 11 But the actual sort order is: 1. ...
1 vote
1 answer
272 views

How to remove custom attribute of category using object manager in magento 2

I created 4 custom attributes for category. Now I want to remove it. I want to use object manager for delete attributes and its values. See this image. Created attributes are display in this manner. ...
0 votes
1 answer
298 views

Get Custom Category Attribute Value On List Page : Magento 2

i have created custom category attribute now i want to get the attribute value on list.phtml page i can i achieve this in magento2. <?php if($category->getColThreeCategory()): ?> <...
  • 379
3 votes
1 answer
753 views

Magento 2.3: Create custom category attribute with WYSIWYG

I want to add WYSIWYG enabled textareas as custom fields for categories. I have read all related topics on this site for this issue, but none of the mentioned answers seem to do the trick. Can ...
  • 1,218
1 vote
2 answers
2k views

Magento 2: Get custom category attributes by category id

I have category ID and need to get all custom attribute for example thumbnail image. my code does not return all attributes $category = $this->categoryRepository->get($childId, $this->...
0 votes
3 answers
1k views

Fetch category id's through sql in magento 2.3

I want to get the list of category id's with category name through sql. how can i do that?
  • 720
2 votes
1 answer
594 views

Use Default Value checkbox for custom category ui_component

I added a custom category attribute "Listing Image" and want to display the checkbox "Set Default Value", like "Thumbnail" and "Category Image". I already compared the ui_component, but couldn't find ...
  • 355
0 votes
2 answers
185 views

UpgradeData.php script is not Working

I want to remove some new category attributes but it is not working. Am I missing something? I dont know what is the problem. Please someone help it.. UpgradeData.php <?php namespace Vendor\...
  • 361
1 vote
1 answer
25 views

when i add category it give me this "Secondary Description" attribute value is empty"

Suddenly Magento starts giving this error ... I tried to var_dump() what is missing, also check the file but there is no problem with it.
3 votes
3 answers
1k views

Magento2 How to get category custom image attribute on frontend phtml page

I need to get category custom image attribute on frontend. Anyone have solution for this? Thanks
  • 1,033
2 votes
4 answers
2k views

Magento2: Adding custom attribute to category doesn't show store specific value

I have created a custom category attribute using the custom code from here, attribute created successfully and able to save the value. But I want to save store specific value in this custom attribute,...
1 vote
2 answers
694 views

Magento 2 - Category attribute not getting saved to database

I am facing an issue where if i update few information such as meta title, meta keywords, meta description from admin panel for any category, then the meta title is not getting saved to database. ...
1 vote
1 answer
316 views

How to add select multiple images attribute in category in Magento 2

I want to display more then one images of category in category page so i want to add more then one images in category in backend, please help me

1
2 3 4 5