Questions tagged [category]

Questions about product categories in the Magento catalog

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

Magento 2 : How to set different list.phtml for each category

I want to do like this list.phtml should be different different call in category page. I created custom category layout and assign phtml file for that. But, layered navigation at bottom after product ...
0
votes
3answers
527 views

Something went wrong while saving the category

I get an error on Magento 2.3.5-p1 when trying to add products to an existing category. The products won't save and I get this message: Argument 1 passed to Magento\Catalog\Model\Category\FileInfo::...
1
vote
0answers
101 views

Magento 2 product is “in stock” and saleable qty is zero 'add to cart' still showing in category page

Using Magento 2.3.5-p1 version Product stock status is "in stock" and saleable qty is zero 'add to cart' still showing in category page but the "add to cart" button not showing in ...
9
votes
4answers
7k views

Magento 2.x Elasticsearch Category Products Not Showing

I tried to upgrade my Magento 2.3.5 install to Magento 2.4.0, but am unable to get category pages to display products. Everything is in Docker, so I am using Elasticsearch 7.6 and have specified ...
1
vote
0answers
108 views

Magento 2 “Add to Cart” button appear on category pages for “Out of Stock” products

Magento 2.3.5 Add to cart button will not show on the category page. It shows instead of "out of stock" Also, there is an issue on Magento GitHub - https://github.com/magento/magento2/issues/...
0
votes
1answer
83 views

Magento 2 - getCategoryIds() returns wrong values

I try to run through each item in the cart and log the category names. But it always prints out the category names of the first item!! The first item in my cart is in the following categories: ...
0
votes
0answers
69 views

Magento 2 - Catalog Layer has been already created

I have upgraded my Magento from 2.3 to 2.4 and i am getting Catalog Layer has been already created error. Everything was working fine on 2.3. Anyone have any idea what could be the issue? Any help is ...
0
votes
1answer
29 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\...
0
votes
1answer
17 views

Error accessing Catalog > Manage Categories

When I am trying to access Catalog > Manage categories, I am having the below error: Source model "defaultcatview/category_attribute_source_view" not found for attribute "...
0
votes
1answer
1k views

Magento 2 : Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails while saving a duplicate category

I have installed Duplicate categories Extension in the client site(Magento 2.3.2), while duplicating categories I'm facing this error, {"0":"SQLSTATE[23000]: Integrity constraint ...
0
votes
1answer
25 views

Category level - Refund, Exchange

How can admin achieve it? I have attached the image in which 2 things admin wants to achieve. Category level - for clothing category admin want to show below add to cart " 7 Days Exchange ...
0
votes
0answers
157 views

Magento2 Category page with color swatches loading too slow

I am using Magento 2.3.5-p1 along with Elastic Load Balancer , My application is hosted in 8GB RAM and 160GB space and MYSQL also hosted on another VM with 8GB ram. I have 40,000 products which all ...
0
votes
0answers
22 views

Migrated to Magento 2.3.4 - Update Anchor settings in Category getting error

If i disable anchor setting i am getting the following error, Note: My site migrated from Magento 1.9.2.3
0
votes
0answers
32 views

Category save issue after upgrade - M2

Getting this "A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later." error after category save. I have ...
0
votes
1answer
39 views

Magento 2.3.4 - After migration from M1 Category link and filterable attributes takes too much time to load

My M1 site consists of 30k products and 100's attributes. Attributes like authors,edition,publisher etc. After successfully migrated to M 2.3.4 If I click category links and left navigation filterable ...
0
votes
1answer
138 views

Magento 2 - Call to a member function addAttributeToFilter() on null

I am working on a module for a customer that is designed to generate a category link to the main artist page for the product. I've created a module that's designed to get the category IDs of the ...
0
votes
1answer
216 views

How to move category in header panel before Sign In Magento 2

Please see the below screenshot. I am trying to move the category menu and want to display HALF TITLE category before sign in header.
0
votes
0answers
15 views

How to change the number of items per row in products grid Magento 2.3.5

How to modify magento 2 to show 3 items per row in product grid instead of the default 4? I tried to play with /var/www/magento2/vendor/magento/theme-frontend-luma/Magento_Catalog/web/css/source/...
0
votes
0answers
21 views

Magento2 - Controller creates duplicate categories

I am creating a custom module to get categories and regarding products from API and uploading them to the site. After creating a controller for Categories, in the backend, there are duplicate ...
1
vote
1answer
217 views

Display custom canonical URL on category page in Magento 2

I've created a module to add a custom category attribute (custom canonical URL) to a category page. The attribute displays in the admin and I can save the value. I've extended _prepareLayout() ...
0
votes
0answers
20 views

Show category slider on product listing page magento 2

I want to show sub-categories slider on category pages / product listing pages in magento 2.3.2. Can anybody help me in this?
0
votes
1answer
37 views

Magento 2 Get Category Layout Name

I want to apply some logic when displaying a category depending on the category layout. The logic should be applied if the category has a custom layout applied i.e. 1 column I can get the category ...
0
votes
2answers
449 views

Magento 2: How to exclude/hide products from Search?

I still want to be able to access to some products through the URL but exclude them from the Search bar I am using elasticsearch7 Thank you in advance EDIT: Ideally, to do it programmatically
1
vote
1answer
49 views

Error when getBlock('category.products.list') in Observer

public function __construct( Config $pageConfig, Category $categoryHelper, UrlInterface $urlBuilder ){ $this->pageConfig = $pageConfig; $this->...
0
votes
1answer
17 views

Where is the .phtml to modify category page filters?

Good afternoon, I have a question, where is the .phtml to modify category page filters (frontend)? I don´t find the file and I need this to modify the words Filter by. Thank you so much!!
0
votes
1answer
33 views

Area code is not set when creating category

I'm using this function to create categories public function fetchOrCreateProductCategory($categoryName, $parentId = 1) { //when parent id is 1, then it's root category $parentCategory = $this-...
0
votes
0answers
32 views

Magento2.3 How to duplicate categories programmatically for different website

I have my all categories in my main website. Now I want to duplicate some of its category to my 2nd Website. I want to do this with script, Is it possible ?
0
votes
1answer
16 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
2answers
34 views

Add class active to the current category Magento 2.3

How I can add a class "active" to the current / selected category? Magento 2.3 <?php // get the list of all categories //echo "Hello"; //echo '<div class="hello"&...
0
votes
0answers
15 views

Magento2 URL rewrite issue

We have a Magento2 site, which has Product and Category URL Suffix as / not .html But in our catalog_product_flat_1 table, the url_path still contains .html which doesn't seem to cause any issues, as ...
0
votes
1answer
17 views

How to move page mail title after category description in magento 2.3.1

app/design/frontend/vendorname/modulename/Magento_Catalog/layout/catalog_category_view.xml <move element="page.main.title" destination="main.category.col.1" after="category....
0
votes
1answer
25 views

Display Sub Categories list on a Category Page in Magento 2.3

How To Display Sub Categories list on a Category Page in Magento 2.3 root_catalog |-First |-Shoes |-T-shirts |-Brands |-Demo |-Test
0
votes
1answer
29 views

Get child category name from category id

I want to get the category name of Parent Category as well as Child Category. For this, I am checking if Category == Parent Category and storing Category name into an array. And If Category is a Sub ...
0
votes
1answer
92 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 ...
2
votes
1answer
52 views

Message on category page

Basically I want to show static content using a block on my category menu in Magento 2.3.5. I have created a category and set Display Mode as Static Block only, Anchor set to No and Added a block from ...
0
votes
1answer
19 views

categories are not shown in menu

I am in Magento 2.3.4, I have added a main category to the root, but the menu does not show me in the front-end of the e-commerce In the image it is shown that the category is enabled to be shown in ...
1
vote
0answers
16 views

How to add all product to a category at once magento 2

I want to add all website product to a specific categories using database query.anyone?
1
vote
0answers
17 views

How to store category id and also category name in custom table two different entity in magento 2?

How to Store category id and also Store category name in custom table two entity public function toOptionArray() { $options = []; $categories = $this->collectionFactory->...
1
vote
1answer
35 views

Magento 2 - Product images not loading in catalog view

I noticed that the product images are suddenly not loading in the category view anymore: in the product view it works just fine. I inspected the HTML source code and noticed that the images are ...
1
vote
2answers
39 views

Magneto2.3-How to make product category mandatory in Magento 2

I am using Magneto 2.3. I want the product category field mandatory. See below my code: [![enter image description here][1]][1] <div class="field"> <label class=&...
0
votes
1answer
36 views

Magento 2: How to get All Active Categories in Custom Module Admin Form Dropdown?

Here is my form UI component code: <field name="category_id"> <argument name="data" xsi:type="array"> <item name="options" xsi:...
0
votes
1answer
114 views

Magento 2 hide sidebar only in category view for mobile

I am trying to hide sidebar in my magento 2 instance with css only for mobile view and only in category view pages. I tried: @media (max-width: 767px) { .category-view .sidebar .sidebar-main { ...
2
votes
3answers
315 views

Using magento 2 accordion widget with href links

I am trying to build a category accordion in my side bar and I am using magento 2 accordion widget https://devdocs.magento.com/guides/v2.4/javascript-dev-guide/widgets/widget_accordion.html <?php $...
1
vote
3answers
181 views

how to get parent category collection dependency injection magento 2.3.1

How can I get a first category level from Magento 2.3, my category setup looks like this now. root_catalog |-First |-Shoes |-T-shirts |-Brands |-Demo |-Test Now First ...
1
vote
1answer
797 views

How to get all Products Count in list.phtml file magento 2?

i want to get Total Count of all Product Review of Specific Category. suppose if Apple category has 15 product and all products have like 15 reviews, so i want that total 15 counts of only Apple ...
1
vote
2answers
742 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 ...
3
votes
0answers
733 views

Magento 2 : Catalog Layer has been already created

On category page I am getting this exception Catalog Layer has been already created I tried to debug it in vendor/magento/module-catalog/Model/Layer/Resolver.php, for the moment i commented the code ...
0
votes
2answers
783 views

Magento 2 - How to change number of products per page dynamically?

In Magento 2, I try to change number of products in category pages dynamically. For exemple categories 1 and 2 will have default number value (10), and category 3 and 4 will have one less product, ...
1
vote
1answer
117 views

Move child product category to parent api

I'm using Magento 2.2 REST api to create and update product category. To change product category parent I use following url and request body and it works fine. HTTP method: PUT url: rest/V1/categories/...
1
vote
1answer
29 views

magento2: Category and product page not working properly - Luma Child

I've created a child theme of the Luma theme with basic theme files. I've default.xml files on the theme layout and web folder (for js and CSS). All pages are working fine but when I started adding ...

1 2 3
4
5
53