Questions tagged [category]

Questions about product categories in the Magento catalog

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

Magento 1.9: Product Listing Page Attribute Based Work error

I just display my attributes on the PLP page, but the attributes duplicates or mismatch, actually I am using $attributes = $_product->getAttributes(); for getting appropriate attributes, but my ...
0
votes
1answer
1k views

get products from specific category

I need to get the products from a specific category and display in a specific template style. I know you can do this on a cms page: {{block type="catalog/product_list" name="product_list" category_id=...
1
vote
1answer
45 views

Magento 2 - Assign product to category on frontend

I am creating a frontend from for Sellers to add/edit their product on website, product adding/editing is working perfect. Now I have to assign that product to a category Almost on every article and ...
1
vote
1answer
862 views

Category page image upload issue

I am trying to upload Thumbnail image and image for category page but it is neither uploading nor showing any error. I have cleared cache and also done indexing but still no output Any solution??
0
votes
2answers
28 views

How to load category image in frontend?

We have created a megamenu and want to load the category image on the menu. I'm not sure how to load that. As of now, we have just hardcoded the image. Below is the code: <?php namespace ...
0
votes
4answers
736 views

Export Products on a Category

Is there a way that I can export all products on a certain category via CSV or excel file?
1
vote
1answer
35 views

Magento 1.9: Change Grid/List View Based on Category

My default view is List view, how can I change based on category.
3
votes
3answers
685 views

magento 2 Cant show products on categories

I have added some products in one category. All products are enabled, with quantity and catalog, search option, I have also disabled cache and reindexed multiple times but on the frontend the product ...
0
votes
0answers
9 views

Magento 2.3.1 Category filter option

I need to enable category filter options. I noticed that the "Use in Layered Navigation" dropdown is disabled under product attributes storefront properties. how can I update this to "Filterable (with ...
0
votes
0answers
16 views

How to Filter Current Category Layer's products colletions by instock and qty greater than zero(0) condition in List Page Magento 2

Please check below Code: di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/...
3
votes
1answer
785 views

Category sidebar use SEO url vs cat=

Currently on my site when I visit a top level category from the sidebar the URL is: http://example.com/top-level-category Then when I click a sub-category in the resulting sidebar the URL is: http://...
2
votes
4answers
12k views

Show Specific Categories On Magento Home Page

Hope someone can help me with this. I need to show 3 specific categories on my Magento home page. I have created a "list-homepage.phtml" file and have the following code in this file <?php foreach ...
0
votes
0answers
12 views

Remove single category in sidebar in category list page in magento2

Remove single category in sidebar in category list page in magento2
1
vote
3answers
1k views

Cannot create category in magento2

I am trying magento 2 for first time and it's driving me crazy. I have successfully installed magento 2 on my cloud shared hosting and everything looks ok except these: Cannot create category: there ...
3
votes
4answers
4k views

Magento2: Could not save product “330664” with position 0 to category 3567

When i save product after unassigned all category from product. I am getting error Could not save product "330664" with position 0 to category 3567 I have checked log and i can see same thing in ...
22
votes
8answers
18k views

Hide categories with no active products

Is there a way to hide categories that don't have active products? Or, even better, only show categories that have active products and stock.
0
votes
0answers
9 views

301 Redirect For Category with forward slash

We recently deployed a Magento 2 site. Fresh install on a new https:// domain Set category suffix to blank Not .html or / What is occurring is, I am getting a 301 redirect after some categories: ...
1
vote
1answer
15 views

Magento 2 add parent category class to body for product listing page

I have number of subcategories under a main category called 'services'. I want to add a custom class 'service-listing' to body on all the subcategory pages under this category.
1
vote
0answers
8 views

magento 2 How to customize product list pages of all subcategories under specific category?

I want to customize all subcategory pages whose parent category is 'Services'. The customization includes following: Remove Toolbar Add filter for gender (gender is product attribute) Add custom ...
2
votes
1answer
1k views

Add noindex to single category in Magento 1.9

I want to modify this line for only one category: <meta name="robots" content="INDEX,FOLLOW" /> I want to add noindex like this: <meta name="robots" content="NOINDEX,FOLLOW" /> I tried ...
1
vote
1answer
1k views

Magento 1.9.1 - Unable to edit (click) URL Rewrite fields in backend

I'm trying to edit (or redirect) some category menus to other categories. Example, I have two sub-categories called "Compression Wear" (id 60 - /compression-wear.html) AND "Compression Wear" (id 67 - /...
2
votes
1answer
720 views

Filter (layered navigation) categories

My store has the following categories: - Root - other category - another category - Home - Kitchen - Cabinets - Appliances - Accessories ...
0
votes
1answer
956 views

Magento 2 catalog category link widget is not working

I wanted to insert catalog category in my content, however, it keeps showing a broken image whenever I try to use it. I have also tried manually coding it. Does anyone know the fix for this?
2
votes
2answers
607 views

magento 2 Uncaught TypeError: Argument 2 passed to Magento\Catalog\Block\Product\ImageFactory::getLabel() must be of the type string

In custom theme And category page show this error- Fatal error: Uncaught TypeError: Argument 2 passed to Magento\Catalog\Block\Product\ImageFactory::getLabel() must be of the type string, null given, ...
0
votes
2answers
1k views

How search category by name or new attribute in magento 2

How to get category by name and custom attribute programmatically? Custom attribute is val_code. Custom code was added using InstallData
0
votes
0answers
13 views

Magento 2: Display category description at the top or bottom, depends on category attribute

I am facing the issue. I have 4 levels of categories in my store. For first three levels i display only static block and for last level i display product and static block. Now, when i am on last ...
2
votes
1answer
619 views

How to restore 'sort by position' option for category sorting

In our store the sort by position (ie 'Best Value') option is not being shown when viewing categories. I believe this was removed/hidden by someone in the past but now we want to show it again. I ...
1
vote
0answers
15 views

Custom Canonical Tag in Magento 2 Category with Magework seosuite

I try to show custom canonical for category with Magework seosuite, but this function I think that not is possible. Is there a way to do this, maybe with an extension or plugin of this module ? Thank ...
0
votes
0answers
60 views

Custom Canonical Tag in Magento 2 Category

I am using Mageworx extension for canonical tags, but want to add a custom canonical tag/url in a category, and remove the canonical url generated by the extension. I am using Magento 2.2.5. I used ...
1
vote
0answers
16 views

Magento 2 exclude products from catalog price rules

I'm facing this problem. I have around 70 products in different categories and different attributes sets, but with the same common attribute (SKU). I have 3 catalog price rules which applies ...
0
votes
2answers
724 views

data scraping for categories and products

I want to scrape a data from one of ecommerce website. Where i want to pull all categories and products details. What will be the best method to do it?
1
vote
1answer
21 views

Delete or Save category works in bootstrap file but not in my custom API controller when flat categories are enabled

I am trying to create and delete categories in Magento 2 but am facing some issues while doing it when Flat Categories option is enabled. The weird thing is, my code works fine when called from a ...
0
votes
1answer
23 views

Magento 2 category image 404 with store code in url

I have a phtml file in my theme that is added to category page via XML updates tab. I read image in phtml like so: $this->getUrl('media/catalog/category/').$_category->getImageUrl() My theme ...
0
votes
0answers
18 views

Magento 2: How to redirect the category url path to custom url (to hit search page url)path

My Requirement: I need to redirect the URL while clicking the main category in the menu For example : From https://penqueen.com/test.html To https://penqueen.com/?q=item_class_pink=Ballasts ...
3
votes
4answers
8k views

Magento 2 - Category list for custom magento system configuration section

My problem to get all available categories and display them in a system config multi-select field list. Here is a link for Magento 1.x. How can it be achieved for Magento 2.x?
0
votes
3answers
25 views

Magento 2.2.8 - Add Custom Attribute To Category

I need to add a wysiwyg attribute to the Magento categories, this needs to sit within the 'General Information' tab. I can't seem to get it to work and I've had a look around on StackOverflow and I ...
1
vote
2answers
219 views

Magento 2.2.6 : Add custom phtml file after product price in category page

I want to add custom code in my catalog category view page. I don't want to override product/list.phml file . But, Just display my custom code in catagory view page after product price. How to add ...
0
votes
0answers
17 views

How to create a category in Magento using SQL

My attempts at creating a category with PHP fails while flat_categories are enabled in the system. Reference here. So, I want to create a new category in Magento 2 using SQL. How would I do that?
1
vote
0answers
25 views

Layered navigation and categories filter

I'm using multiple layered navigation filter (https://github.com/SlavaYurthev/MultipleLayeredNavigation-M2) is allows to select multiple categories at once. But categories filter is not working, I ...
0
votes
1answer
17 views

magento 2 get first level category from current catgeory ID in controller

I am trying to get first level category from current category ID in my controller . For example- I have Maincategory SubCategory1 SubCategory2 SubChild1 SubChild2. ...
0
votes
1answer
39 views

How to load Category image in top menu?

I have loaded the category and sub-category, now I need to load image as well but I'm not sure how to do that. Below is the code I have used: In block file: public function getStoreCategories($...
0
votes
0answers
4 views

Import category url key and meta tag programmatically

I want to import my magento2.1 categories url_key and meta title programmatically. how can i do?
2
votes
1answer
379 views

Magento 2: Product not showing in category page

I changed reindex mode Update by Schedule and add some product using custom script. But now when I run reindex command (CLI) then none of the products are showing into category page. Product is ...
0
votes
1answer
623 views

Magento 2 - On category save 'URL key for specified store already exists' error occurred

After migration process, I can not save category page. I try all solution but not getting the success it gives an error like below image. http://prntscr.com/irfiml
0
votes
0answers
7 views

Magento 2: root category settings for SEO?

Default Magento (2) never displays the root/default category in the frontend. However, in the backend there is a whole lot of settings in: CATALOG -> CATALOG -> Categories Why should I put effort in ...
0
votes
1answer
28 views

Magento 2: load disabled category childrens

I need to get all category children of a specific category but disabled categories too. I have this category tree: + Root (ID: 2) // enabled | + Main 1 (ID: 3) // enabled | | + Sub 1 (ID: 4) // ...
2
votes
2answers
425 views

Cannot delete category if flat catalog index is enabled

I am using the following code to delete a category from my Magento installation programmatically: $hostId = $model->getId()->getHost(); $category = \Mage::getModel('catalog/...
2
votes
0answers
60 views

Magento sub-categories listing on category pages cache issue

I have the following static block to display my sub-categories in the categories page: <div class="category-products2"> <ul class="products-grid subGrid"> <?php $_categories=$this->...
0
votes
1answer
23 views

it is possible to remove sidebar for specific category product listing?

my file : Vendor/theme/Magento_Catalog/templates/category/products.phtml i made this changes ` if($category_name == 'Featured Product'){?> <!-- when Featured Products --> &...
2
votes
1answer
47 views

How layer navigation counter works in Magento 2

I want to add some conditions for the layer navigation counter. Basically I want to skip from counting some products. In vendor/magento/module-catalog-search/Model/Layer/Filter/Category.php in ...