Skip to main content

Magento 2 check category attribute values in database using mysql query

Magento 2 check category attribute in database using mysql quer

  SELECT * FROM `catalog_category_entity_text` where store_id = 1;  
 SELECT * FROM `catalog_category_entity_datetime` where store_id = 1;  
 SELECT * FROM `catalog_category_entity_decimal` where store_id = 1;  
 SELECT * FROM `catalog_category_entity_int` where store_id = 1;  
 SELECT * FROM `catalog_category_entity_varchar` where store_id = 1;  

Note : In above SQL query store_id 1 is ID of store. kindly you need to check store Id for all store-views in admin and run the above code for each store-views separately.

Comments

Popular posts from this blog

Magento 2 get category collection using specific controllers and category level using object manager

Magento 2 get category collection using object manager <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $category = $objectManager->get('Magento\Framework\Registry') ->registry('current_category'); //get current category $requestInterface = $objectManager->get('Magento\Framework\App\RequestInterface'); //echo $routeName = $requestInterface->getRouteName(); //echo $moduleName = $requestInterface->getModuleName(); $controllerName = $requestInterface->getControllerName(); //echo $actionName = $requestInterface->getActionName(); $parcatId = $category->getId(); // current Category ID $parcategory = $objectManager->create('Magento\Catalog\Model\Category') ->load($parcatId); $parent_category = $parcategory->getParentCategory(); $subcatId = $parent_category->getId(); $subcategory = $objectManager->create('Magento\Catalog\Model\Category...

Magento 2 How to get product collection using controller

Getting product collection in Magento 2 Step 1: Declare in Vendor_ModuleName Block Step 2: Display product collection in phtml file .. Step 1: Declare in Vendor_ModuleName Block You will use a block class of the module Vendor_ModuleName, then possibly inject the object of `\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory` in the constructor of the module’s block class.     app/code/Vendor/ModuleName/Block/ProductCollection.php add code this code  <?php namespace Vendor\ModuleName\Block; class ProductCollection extends \Magento\Framework\View\Element\Template { protected $_productCollectionFactory; public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory, array $data = [] ) { $this->_productCollectionFact...

Magento 2 Get specific attribute (manufacturer) collection in phtml file with images using object manager

Magento 2 Get specific attribute (manufacturer) with images using object manager <?php $om = \Magento\Framework\App\ObjectManager::getInstance(); $categoryFactory = $om->get('\Magento\Catalog\Model\CategoryFactory'); $categoryHelper = $om->get('\Magento\Catalog\Helper\Category'); $categoryRepository = $om->get('\Magento\Catalog\Model\CategoryRepository'); $category = $categoryFactory->create()->load($catId); $categoryProducts = $category->getProductCollection() ->addAttributeToSelect('*'); foreach ($categoryProducts as $_product) { if($_product->getManufacturer()){ $brand_value = $_product->getResource()->getAttribute('manufacturer')->getFrontend()->getValue($_product); $brand_id = $_product->getManufacturer(); $curnt_cat_url = $category->getUrl(); $brandId = '?manufacturer='.$brand_id; $om = \Magento\Framework\App\ObjectManager::...