Questions tagged [category-attribute]

Denotes questions related to attributes of categories.

Filter by
Sorted by
Tagged with
11
votes
7answers
45k views

Magento2 - Get category URL by ID

I'm trying to get the URL key of any given category with the ID. I have this; $categoryId = 3; $_objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $object_manager = $_objectManager-...
11
votes
8answers
29k views

Magento 2 Get category id using category title

I would like get category id by only using category title by using this kind of function. ->load($categoryTitle, 'title') ->getId(); Use case: Get category id by title and put id data to array ...
9
votes
5answers
13k views

How to create category attribute programmatically in Magento2

I am workign on custom extension for magento 2 and i need to create category attribute programmatically, List me exact steps, because i am not sure is the code to be placed in InstallData.php or ...
8
votes
1answer
7k views

Remove category attribute

I inserted 2 category attributes using a module with the file mysql4-install-0.1.0.php in a sql folder: $installer = $this; $installer->startSetup(); $installer->addAttribute('...
8
votes
3answers
2k views

Set Use Default Value for all categories attributes Magento 2

I have around 1260 categories.If i switch the store view , the all attributes have own value.But i want to set the all attribute values as parent main store view value. I can not open each category ...
7
votes
1answer
5k views

Display custom attribute on category page

On our category page I want to echo an custom attribute with attribute code "homepage_description". I tried this, but that does not work: <?php echo $_product->getHomepageDescription() ?> ...
7
votes
1answer
2k views

How to add serializable attribute to category?

I tried this $installer->addAttribute( 'catalog_category', 'ser_attr', array( 'input_renderer' => 'namespace_module/block', 'backend' => 'adminhtml/...
7
votes
1answer
1k views

Filtering category collection producing incorrect behaviour with flat catalog enabled

I have some code to perform a basic search of categories. It works by searching the category name and description - attributes that are both core. The code I have is as follows: $_categories = Mage:...
6
votes
3answers
4k views

Admin Category Insert Thumbnail field has disappeared

I have recently installed Magento 1.9.1 and trying to make use of the category thumbnails (as well as the main image). However, I have gone to Admin >> Catalog >> Manage Categories and it ...
6
votes
2answers
16k views

Get custom category attribute

In this class app/code/core/Mage/Catalog/Block/Navigation.php in this method: /** * Render category to html * * @param Mage_Catalog_Model_Category $category * @param int Nesting level number * @...
5
votes
3answers
9k views

Magento 2 create category attribute thumbnail and upload image using File Uploader Component

I've created a custom module to display category thumbnail image. I've read magento dev doc It is displayed in my category section using category_form.xml <?xml version="1.0" encoding="UTF-8"?&...
5
votes
2answers
17k views

How to get the CategoryId using the name in Magento 1.9?

Looking to find the category ID using the Name attribute programmatically. My script returns a 1 when it should be a 19. Here is my code: $collection = Mage::getModel('catalog/category')->...
5
votes
2answers
3k views

Custom Category attribute created but not saved

I've created a custom extension in order to add a custom attribute on product Categories. Here's the code I've used to create it: $installer = $this; $installer->startSetup(); $attribute = array( ...
5
votes
2answers
3k views

Create multiselect with source model in UI component

Since Magento 2.1 you have to define a UI component for custom category attributes (See Magento 2.1: how to create category attrbute programmatically?) I have one multiselect attribute with a custom ...
5
votes
1answer
1k views

How to get first product from category in 1column.phtml?

I'm searching for a way to get the main image from the first (or random) product from the current category and use it as a background for the category title. As the title is created in 1column.phtml (...
4
votes
2answers
3k views

How to set the default value of “Is Active” to “yes” on a new category

I'm trying to set the default value as "Yes" for the Is Active field on New Category. The default value is no, and the store owner gets annoyed when the category doesn't show on the frontend. I've ...
4
votes
6answers
6k views

create category programmatically if not exist - magento 2

I have one custom table, that table have a column name category which contains the events category like entertainment, national events. Now I need to create category from the table? note: create ...
4
votes
1answer
3k views

How do I change the default value of the “position” category attribute?

I would like to update the default position value that products are assigned when they are added to a category. When you update a category from the categories editor, new products are saved with a ...
4
votes
0answers
758 views

Multiple Category Image Attributes Not Working Together (Uncaught TypeError: value.map is not a function)

I've created a custom module to get an additional image uploader on my categories using the following tutorial. https://belvg.com/blog/how-to-add-image-attribute-to-a-category-in-magento-2.html It ...
4
votes
0answers
123 views

Create Custom Attribute Like “Extra Fee” in Category And Calculate It To grand Total [closed]

I Have Created One Attribute In Category Like Extra Fee. But How To Calculate That Extra Fee In Magento Grand Total ?
3
votes
3answers
2k views

After removing category attributes I get errors when reindexing: Undefined offset in Flat.php

After removing category attributes I get these errors in the log file when I reindex "Category Flat Data": ERR (3): Notice: Undefined offset: 149 in [...]\app\code\core\Mage\Catalog\Model\...
3
votes
3answers
3k views

Magento Category collection missing custom attributes

I am currently developing for a shop that doesn't use the product page. On every category with sub categories the sub categories are shown until there are no more sub categories, then the products in ...
3
votes
2answers
711 views

Category attribute is not being saved

I have two custom attributes for categories. The code for both is similar apart from the attribute_code but one is not being saved when trying to add a value in adminhtml. That's the UpgradeData.php ...
3
votes
4answers
3k views

Magento as a product information management (PIM) tool for multiple marketplaces (ebay, amazon, Rakuten, etc)

We are selling products on over 10 different platforms, each of which has different category sets. Also, we are selling internationally and a product can belong to different categories on different ...
3
votes
1answer
363 views

How to validate custom category attribute

How to validate a new custom category attribute in Magento, so that no more than 300 words can be written in that new field? Is that possible? How could I achieve this? Thanks for your contributions.
3
votes
2answers
405 views

Unable to pull Category Description, Mage 1.9 with multiple stores,

so I am not sure how to debug this. I can pull all information from a category but I cannot get the 'description' attribute to pull through. It just appears blank. This doesn't work: <?php ...
3
votes
3answers
446 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
3
votes
1answer
1k views

Magento 2.1 How to Add a Second CMS Block in Category adminhtml

I am trying to add a second cms block in the category backend just below the default one. I copied and altered the category_form.xml and CategorySetup.php from core into a separate module. I think I ...
3
votes
2answers
508 views

Magento 1.9.3 category custom attribute validations

I have created custom attribute in Magento 1.9.3. $pro_attribute = [ 'input' => 'text', 'type' => 'int', 'label' => 'Pro Position', 'visible' => true, 'required' => ...
3
votes
1answer
2k views

Magento: Category Name vs Page Title Name

How can a page title name (not meta) be different from the Category "Name"? For example: Main Category 1: ABC Sub-Category (under ABC): DEF On the navigation menu, the main category is displayed ...
3
votes
1answer
135 views

Getting Custom Image Attribute in Frontend

I've followed a tutorial found here: https://webkul.com/blog/add-custom-image-attribute-category-magento-2/ With a slight modification which can be found in the InstallData, where I specified '...
3
votes
2answers
147 views

Magento 2 - Get Categories by Custom Category Attribute

In Magento2 - I've created a yes/no toggle category attribute named is_featured, its shown as "Homepage Category" in the screenshot below. I'd like to be able to display (on the homepage cms page) ...
3
votes
1answer
518 views

Sort attributes in category edit page

I've added a custom attribute for all the categories. It's currently positioned as the first element in the list when you configure a category. How would I go about about changing it's position in the ...
3
votes
2answers
981 views

Field dependency for category attributes

I add attributes in setup script, all is configured properly and attributes are added to a new tab called "MyGroup": $installer = $this; $installer->startSetup(); $installer->addAttribute('...
3
votes
0answers
28 views

issues while editing the custom attribute for a category in multi-language store

My store is multilanguage and I created an image type attribute for my category. What happens is that when I edit this image with the "all store views" option enabled, it changes correctly in all ...
3
votes
0answers
396 views

No Way to Clear/delete a Selected Image using Media Browser on category edit page

With reference to this Q&A there's another question. How do I clear the image selected using the Media Browser on category edit page in the admin Panel? Here's what I tried: in app/code/...
3
votes
1answer
654 views

How to create and display custom category attributes

As the title says, i want to be able to create and display custom category attributes. I tried this extension: http://www.magentocommerce.com/magento-connect/manage-category-customer-and-customer-...
3
votes
2answers
243 views

Any category created does not show the title Correctly

i have a problem, any category created in my store not show the correct page titles, for example: Page title in category: "Smartphone Sony" What appears in the title of the page ....: "sign in now by ...
2
votes
1answer
2k views

Magento 2.1: how to create category Attribute programmatically?

The custom extension in which I am working is working correctly till 2.0.7, but not in 2.1. So my question is, how to create category attribute programmatically? Below code was working in 2.0.7, but ...
2
votes
1answer
2k views

Add color picker to category attribute

Does anyone know how to add a custom color picker attribute to categories? I've tried the following code in an upgrade-script, unhappily without success. $this->startSetup(); $this->...
2
votes
2answers
2k views

Custom category attribute is not showing in magento2

I have created the custom attribute using the solution given here. Create Custom category Yes/No attribute magento2 The attribute is created and i can see entry in database eav_attribute table. But ...
2
votes
1answer
309 views

Remove store level value for category attribute

On our shop we have a customer category attribute that has been set against each store. Now we want to remove the store level values and replace it with one global level. Now I know how to do this via ...
2
votes
2answers
14k views

Magento 1.9: Remove Category Filter in Layered Nav

After a few minutes of search, I found the solution that I'm looking for, and it's here: How can I disable filter "category" from Sidebar I followed this method by editing the catalog.xml ...
2
votes
2answers
1k views

Magento 2 product attribute filter url rewrite?

I have override url-rewrite router in my custom module,and add my custom rewrite code in override router file. after filter url created like below : http://domainname.com/services.html?manufacturer=...
2
votes
1answer
2k views

Issues with adding image attribute to category - Magento 2

I've added attribute to my category following this guide (https://belvg.com/blog/how-to-add-image-attribute-to-a-category-in-magento-2.html). Looks like I am on right way, but when I try to upload ...
2
votes
1answer
78 views

I'm creating new Attribute for Category and facing an issue in Magento 2.X

My Upgrade Script : <?php namespace MyCompany\MyModule\Setup; use Magento\Framework\Module\Setup\Migration; use Magento\Framework\Setup\UpgradeSchemaInterface; use Magento\Framework\Setup\...
2
votes
2answers
5k views

Get all Magento Categories using SQL query

I have this SQL to get all Magento Categories. SELECT DISTINCT cc.entity_id AS id, cc.`value` AS path, cc1.`value` AS `NAME`, cce.`level`, cce.parent_id FROM ...
2
votes
2answers
2k views

Creating Custom Category Pages design in Magento

I need the "Main Categories" should have their own landing pages. For example, I am clicking on "Category 1" then it should take me to the landing page for categoriy 1 and should have its own design ...
2
votes
1answer
1k views

Magento2: Category custom textarea with wysiwyg editor attribute value blank issue

I have created two custom category attribute with wysiwyg editor and my attributes also shows in categories. But my issue is if i'm adding content in one attribute using wysiwyg editor then another ...
2
votes
2answers
584 views

Magento 2 trying to add an category attribute: DOMDocument::loadXML(): Input is not proper UTF-8, indicate encoding?

I'm trying to add an attribute to the categories, but i'm unable to add the attribute to the admin view by adding the ui_component xml document (module/test/view/adminhtml/ui_component/category_form....

1
2 3 4 5