4
votes
Some Filters not showing on some Categories in Magento 2.4
There maybe a two possibilites:
Please check whether the attribute "newest" is assigned to the attribute set of that category.
There may not be products available with "newest" ...
4
votes
How to add Categery name url in category page
Create Category Rewrites
Step 1: Add the Rewrite
On the Admin Panel, Marketing > [SEO &
Search] > URL Rewrites.
In the upper-right corner, click on Add URL Rewrites. From the
dropdown list ...
3
votes
Accepted
What does "catalog_category_view_type_default_without_children.xml" do exactly?
The catalog_category_view_type_default_without_children.xml file is used for those category which does not have any children category and has disabled the Anchor.
I hope given information will be ...
2
votes
How to get all the Children Categories IDs of the Specific Category in Magento2
$category = $categoryFactory->create()->load($id);
$category->getAllChildren(false) - will return comma separated list of ids
2
votes
Accepted
Magento 2 - Get Category show the same value
ObjectManager::get returns a singleton instance of the class, you are calling getCategoryIds from the same object even you load with a different ID, that is why it returned the same value.
...
2
votes
Undefined index: optgroup in vendor/magento/module-catalog/Ui/Component/Product/Form/Categories/Options.php on line 103
First! confirm your store is in an local envrionment,
Use below SQL to Reset Database Category data;
SET FOREIGN_KEY_CHECKS = 1;
TRUNCATE TABLE catalog_category_entity;
TRUNCATE TABLE ...
2
votes
Accepted
How to solve this Exception #0 (Magento\Framework\Exception\StateException): The bucket doesn't exist
We can resolve exception on category page “Bucket does not exist” by one of the below solution:
One of reason because of Page Cache, Static resource or Indexer not updated. So try remove /var/ and /...
2
votes
Accepted
How can I create my custom category dropdown in admin side(Create category page)
If you want to add the Categories dropdown to the Category Edit pages in admin area, you should create file app/code/Vendor/Module/view/adminhtml/ui_component/category_form.xml in your custom module ...
1
vote
Accepted
Magento 2.4.4 order export csv wrong data
I have fixed using this, try.
File name :Magento\Ui\Model\Export\MetadataProvider
public function getRowData(DocumentInterface $document, $fields, $options): array
{
$row = [];
...
1
vote
Magento 2.4.4 order export csv wrong data
Just checked in version 2.4.3 and 2.4.4 and both versions works correct for Order and export into CSV
First: check your locale in configuration
Second: check the date in database (sales_order)
How and ...
1
vote
Magento 2.4.4 order export csv wrong data
Magento will export the created date in UTC. if your store use another timezone, the time will be diffrent in the order grid (timezone of your store) and in the exported csv.
To get the order created ...
1
vote
How to create row pattern/dynamic rows to the custom category attribute Magento 2
<fieldset name="test">
<settings>
<collapsible>true</collapsible>
<label translate="true">Test</label>
<...
1
vote
Accepted
How can I display category select dropdown on frontend
1.) Create a xml file which loads your Block and Phtml file.
For Example: custom_test_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&...
1
vote
Get all other categories on same level as current category - Magento 2.4.3
Try This
app/code/VendoreName/ModuleName/Block
CustomBlock.php
<?php
namespace VendoreName\ModuleName\Block;
use Magento\Framework\View\Element\Template;
use Magento\Framework\View\Element\...
1
vote
Accepted
Get all other categories on same level as current category - Magento 2.4.3
You can simply use below 2 lines once you have fetched current category
$pcategory = $category->getParentCategory();
$subcats = $pcategory->getChildrenCategories();
1
vote
Magento 2 How to Remove Particular Product Price in Category Page?
Open your list.phtml template file.
app/design/frontend/VENDOR/THEME/Magento_Catalog/templates/product/list.phtml
Search for the below price code, from where your price is displayed.
Replace:
<?= ...
1
vote
Accepted
Magento 2 - Category url load very slow
Generally Category pages or any page will be slow if following not taken care of :
From TTFB perspective or server execution time.
Varnish or Full Page cache is used.
Also to make sure no block is ...
1
vote
How to solve this Exception #0 (Magento\Framework\Exception\StateException): The bucket doesn't exist
Please try with indexing for catalog search full text data
1
vote
Accepted
Magento 2.4 How to get category of current product from within ViewModel without using objectManager?
in order to get rid of the object manager you need to move all classes that are needed to the construct method using dependency injection.
Please have a look and try this modified code
<?php
...
1
vote
How to get category name dynamicaly on product page magento2?
I am expecting you have product object.
If you do not have product then first get object of product using below code.
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product = $...
1
vote
How to get category name dynamicaly on product page magento2?
Product can have multiple categories, like a product is selected in actual category, which could be 2nd or 3rd level, but the same product could also be selected in Sale category, or any other ...
1
vote
Accepted
How can I get the first level category list?
Try:
/** @var \Magento\Catalog\Model\ResourceModel\Category\Collection $collection */
$collection = $this->collectionFactory->create();
$collection->addFieldToFilter('level', 2);
$collection-&...
1
vote
Accepted
Magento 2 How to order categories by entity id?
You can add the MySQL FIELD() expression to your collection:
$menuitems->getSelect()
->order(new \Zend_Db_Expr('FIELD(e.entity_id, ' . implode(',', $order).')'));
1
vote
Magento 2 Get Category Layout Name
$_category->getData('page_layout') should give you the layout name.
1
vote
Magento2: Create toggle button yes/no in admin product page
Try this code, it works, tested:
<?php
declare(strict_types=1);
namespace Vendor\ToggleAttribute\Setup\Patch\Data;
use Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface;
use Magento\...
1
vote
Display out of stock products of specific category in list and search result page
If you're using magento 2.4 then you have to create a plugin for
Magento\Catalog\Model\Layer
We have to set the Go to Stores > Configuration > Catalog > Inventory > Stock Options->...
1
vote
Automatically use Default Value for category/product Changes (always inherit "All Store Views" scope)
I faced same problem and I did this
First I find eav_entity_type for catalog_catagory
SELECT * FROM eav_entity_type
I search attribute Id by attribute code url_key
SELECT * FROM eav_attribute ...
1
vote
Magento 2: Get root category ID programmatically in backend
Try this.
<?php
use Magento\Store\Model\StoreManagerInterface;
class CategoryIdentifier
{
/**
* @var StoreManagerInterface
*/
protected $storeManager;
public function ...
1
vote
"Unique constraint violation found" when removing .html suffix
The other answers here kind of circle around the exact issue without answering it directly. The issue here is not duplicate existing records in the url_rewrite table. The issue is existing rewrites ...
1
vote
Magento 2 : Fatal error - Cannot instantiate abstract class Magento\Wishlist\Block\AbstractBlock
check it out by running
php bin/magento setup:upgrade
if the above cli command is not working then
php bin/magento setup:static-content:deploy -f
php bin/magento cache:clean
if any file permission ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
category × 2680magento2 × 872
magento-1.9 × 534
product × 337
category-products × 128
collection × 119
magento-2.1 × 113
layout × 108
category-tree × 107
magento-1.7 × 106
catalog × 95
attributes × 91
php × 85
admin × 83
url-rewrite × 83
magento-1.8 × 82
products × 82
layered-navigation × 80
magento2.3 × 78
category-attribute × 68
url × 65
filter × 61
menu × 59
product-list × 58
database × 53