Questions tagged [category-tree]

The tag has no usage guidance.

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

Add all products to a new category 2.4.4

In my magento 2.4.4 version i just created a new category. I need to assign all products to this new category. So keep the product to their current category but in addition assign to this new one ...
0 votes
1 answer
24 views

Magento 2 Default category shows on menu even though I have "Include in Menu" disabled

Ever since I did a setup:upgrade I've been having some issues with the Admin not doing what it's supposed to do, particularly on the Catalog > Categories section. As you can see, on the backend I'...
  • 1
0 votes
1 answer
42 views

URL Path incorrect with Magento Rest API

I am using Python to access Magento 2 Rest API categories. The url that I am using is this: https:///rest/<store_code>/V1/categories/15647 The URL Path that is being returned is this: footwear/...
0 votes
1 answer
97 views

Magento 2 GraphQL - How to build a Tree structure in response

I have created a custom module for megamenu. I have created the graphQL query for that also. The query returns the correct result for level 0. How can I get the tree structure? Here is my graphql ...
0 votes
0 answers
13 views

4th level category page redirects to 3rd level category page

We have Categories to the 4th level in our Magento Store and the site's main URL is set without www. So now when we go to the 4th level category and put www with site URL, it redirects to the 3rd ...
0 votes
0 answers
45 views

How to add product collection to category tree

I have created a category tree using the below code. <?php namespace Custom\CustomApi\Model\Category; class Tree { /** * @var \Magento\Catalog\Model\ResourceModel\Category\Tree */ ...
  • 828
0 votes
2 answers
27 views

Category is disbled in admin side but still showing in frontend

Category disabled from backend still showing in frontend. Even if there are no products available in that category and disabled. Enable category and include in menu options are turned off, but still ...
  • 15
0 votes
0 answers
16 views

Can i import/export categoy images using a sheet?

I'm trying to find a way to change the category images using an excel sheet, right now I update the images manually.
0 votes
2 answers
219 views

Get all other categories on same level as current category - Magento 2.4.3

We use the following helper to get the current category: class Category extends \Magento\Framework\View\Element\Template { protected $_registry; public function __construct( \Magento\...
  • 1,504
0 votes
1 answer
156 views

Magento 2 tree view in Stores->Configuration

I'm starting to try to program in Magento. I have a problem creating a category tree in the configuration of my module. I want to be able to choose a category. More than one. Just like in the photo ...
0 votes
0 answers
22 views

Get full name from path - M2

Table name: catalog_category_entity field name = path Field name path having such entries: 1/2/471/3/4 etc.... I want category as having product csv file using path value from database. Default ...
0 votes
2 answers
165 views

How to show all categories under the static text in frontend Menu in MAgento2

How to display all categories under the static text in frontend Menu in Magento2 Example: We have 3 categories created in admin and displaying like below in frontend Menu 1 Menu 2 Menu 3 We need to ...
0 votes
1 answer
102 views

Magento 2 filter category by id in category tree

I'm overriding this default block file and need to filter the category by id. Magento\Theme\Block\Html\Topmenu how to addFieldToFilter to this children protected function _getHtml( Node $...
  • 828
0 votes
2 answers
50 views

How to organize category tree?

My store sells just one type of product (e.g. Computers). What's the best way to organize the category tree? Should I include the main topic in order to permit my customers to browse all my products ...
  • 115
0 votes
2 answers
429 views

How to add category selector on admin product form in magento 2

I added a select category in product form but it doesn't work.After selecting categories and saving the selections are not stored. Please help me with this problem. Maybe i'm missing something someone ...
3 votes
0 answers
115 views

How to Make Category tree Auto expand the assigned subcategory tree in edit product form?

I'm using Magento 2.4.1 and have 4 levels category when editing a product in cms it really cumbersome when I need to locate the hierarchy of my product categories because when it first loads it only ...
  • 68
0 votes
1 answer
236 views

Magento 2 category structure is displayed wrong

For some reason my category structure on the frontend and admin panel show different results. Check image below: On the frontend my category "DATORER" have 4 subcategories but in the admin ...
0 votes
0 answers
143 views

Magento 2 Calling Category Tree with UI component getting error "Call to a member function getData() on null"

I am working on admin custom page and calling Category tree using with UI component with below code: in UI component listing file adding below code: <field name="category_id"> &...
  • 2,767
0 votes
1 answer
36 views

Category Name input field

The category name input field is a required field * but is there a way to save it without a category name? I see the elements here: <div class="admin__field-control" data-bind="css: {...
0 votes
1 answer
171 views

Magento 2.3.5 Categories Automatically Unassigned/Removed From The Product

After upgrading to the latest Magento 2.3.5, Assigned categories have automatically removed from the product after sometime add/edit products. Example: I have assigned the following categories in one ...
1 vote
2 answers
1k views

Magento 2.3 sort categories alphabetically

I want to sort the categories in a Magento 2.3.1 install in alphabetical order (on the frontend!). I'm aware of the fact that you can sort it by dragging it in the Magento admin panel. But since the ...
  • 500
0 votes
1 answer
518 views

SQL code to get the Product details with category tree heirarchy

I'm using Magento 1.9, We have a requirement to show the product details with category tree heirarchy. Have searched this in google and haven't find any answers. I have to create a report(using a BI ...
  • 51
1 vote
0 answers
354 views

Sort Menu items in aphabetical order magento 2 in observer

I am creating menu items in magento 2. I is working fine and generated according to category order in admin dashboard. But I wanted to sort the menu items alphabetically on store front ir-respective ...
0 votes
1 answer
225 views

Sql to delete category and its descendants

I am working with a Magento 2 store with a very large category tree (over 10000 categories). I used CategoryRepository and deleted one by one but this is very time-consuming since delete a brand with ...
2 votes
0 answers
85 views

Tree categories from products collection

If I have a collection like this: $collection = Mage::getResourceModel('catalog/product') ->getCollection() ->addAttributeToFilter('my_custom_attribbute','my custom value'); What is the ...
  • 210
2 votes
2 answers
2k views

Magento 2 : Get category level

I want to get the category level in product/list.phtml to check if (categorylevel == 1) { hide product list }else { show product list } How can I do that? Any helps? Thank in advance.
  • 651
2 votes
1 answer
166 views

How to get the categories child category list per store in magento2 rest api

I need to retrieve categories and child-category list per store. I have two store have store code grocery and fruit.
  • 23
0 votes
1 answer
86 views

URL rewrite magento 2 admin-side issue

Magento2 - facing issue with below error in admin panel error in console category:1 Uncaught SyntaxError: Unexpected token C in JSON at position 473 at JSON.parse (<anonymous>) at getData (...
1 vote
1 answer
937 views

Magento 2 : Add custom array in multiselect UI dropdown in custom UI form

In Magento 2, I want to add multiselect UI dropdown with custom my custom array. I take reference from product edit form "Categories" field and also find out from where UI multiselect tree option ...
  • 16.7k
0 votes
0 answers
150 views

Magento 2 Facing Problem :Could not save product "3194" with position 0 to category 12

I am facing a problem whenever I go into catalog->products->edit product and delete the category from product and click on save button the error is coming. Could not save product "3194" with ...
0 votes
1 answer
54 views

Magento 2.3: Is it possible import/create a category tree with category_id assigned

I have to import a 3rd party catalog into Magento 2.3. I need to recreate in Magento the category tree with the same category_id in the original tree because I need it when I update inventory. How can ...
0 votes
2 answers
1k views

Magento 2 How to get disable/enable child categories?

I am working with display all categories on a custom page, either it is enabled or disabled. When I try to get child categories with "getChildrenCategories()", but it is returning only enabled child ...
  • 1,197
4 votes
0 answers
124 views

Magento 2 How to duplicate the category with same structure?

I want to duplicate the category with the same structure and data. How to duplicate child categories here? It is working correctly for a single category. In my controller file, I have the parent ...
  • 1,197
1 vote
0 answers
95 views

default store view is not selected by deafult when open any category in magento 2 admin

I have migrated Magento 1.9.3.1 to Magento 2.3.0 I am getting an issue in the admin. When I open category in admin side then English store is selected by default. How can I make default_store_view ...
  • 1,965
3 votes
2 answers
3k views

Magento 2 - How to get category name and category tree for product or for category id?

Magento 2.2.7 I have to output category name and "tree" or path for product. For instance if my product is in category Lg775 my output should be: Hardware/Motherboards/Intel/Lg775 so far I have this ...
  • 117
2 votes
0 answers
47 views

Magento2.3.0 How to do in left side navigation custom category tree structure create it?

I am using Magento2.3.0 I need in left side layer navigation instead replace category section there our custom category tree display on it and its work as on fronted side only.If any one this type ...
  • 1,607
1 vote
0 answers
58 views

Problem With Recursion (categories and subcategories)

I'm testing a code from the answer by @digitalsteez on this question: Get Categories and Its Sub Categories I've tested it onto two Magento instance, one has no problems but on the other I'm ...
1 vote
0 answers
105 views

Third level categories Url is not working in magento 2

Shop Colors Rushmore Boston Mill Little Cottonwood This my category structure. But child category URLs are not working. Link: mysite.com/shop/colors/rushmore.html
  • 1,043
0 votes
1 answer
449 views

Magento 2 Auto-remove empty categories from menu?

I am using Magento 2.3.1 and the pearl theme. My site has many different categories and I wanted to know if there is a way to have magento automatically remove categories that don't have product in ...
2 votes
0 answers
169 views

how to create a custom tree similar to the back office category one in Magento 2?

I'm trying to create a left menu like the category one in a custom module to display my own hierarchy. I want to use a custom model from a custom table. I was able to get the category tree in my ...
  • 21
1 vote
2 answers
3k views

Get a list of all category names and ID's - Magento 2

How can I get a list of all category names and their ID's from a store on Magento 2.2? For example something like this Clothes 2 Shirts 5 T-shirts 7 T-shirts 8 Shoes 10 Sport shoes 12 ... It can be ...
  • 111
0 votes
1 answer
458 views

How to customise category top menu navigation by custom category id in Magento 2?

By default Magento 2 showing the all store categories in top menu with a tree structure, I want to filter with custom category ids and only that filtered category need to show in category top menu ...
0 votes
2 answers
255 views

Magento 2 Error “URL key for specified store already exists

Basically i am adding a custom category the problem is when i add two child category with same NAME in to one parent category where child category is already present then this shows error of URL KEY. ...
  • 1,351
3 votes
2 answers
1k views

Magento 2 Add category chooser without UI component

I am trying to add category chooser in my custom admin form without ui component but unfortunately I am getting error in system.log [2019-03-22 09:27:47] main.CRITICAL: Vendor\Module\Block\...
1 vote
0 answers
27 views

How to get category detail along with subcategories and products in PHP file not PHTML?

I have looked over internet but can't find a solution to get detail in my controller or block file i have tried Registry Tried get id of category from param Also tried from Magento\Catalog\Model\...
  • 1,351
2 votes
1 answer
929 views

magento 2 Infortis ultimo theme display category tree menu on the left of the search result page

I am using the Infortis ultimo theme, in the included feature, i was able to add the category tree menu on the left bar of each category page, but how can i add it to the search result page? is this ...
3 votes
2 answers
768 views

Unlink and link product to category

Need a script where current existing products needs to unlink and link to other categories. let me know the process also
2 votes
1 answer
3k views

Multiselect category dropdown on admin form

I have created custom CRUD on new database table. I just wanted to save comma separated categories in a field. I have this code for multiselect categories: $fieldset->addField( 'categories', ...
  • 8,958
0 votes
1 answer
1k views

Magento 2 Product Form Categories Sort Alphabetically From the Backend

I want to sort Categories alphabetically of the product form, how can I? For more clarification please look onto the below picture. As I checked, by default Magento 2 sort according to the category ...
1 vote
0 answers
21 views

How to skip any category in seo meta title template?

We have magento 2 on website we have 4 categories, we sell photocopier parts, let me give an example what issue we are facing and what we want. Konica Minolta - Bizhub Color Series- Bizhub 203 - ...

1
2 3 4 5