Tag Archives: magento 2

Uninstall Module Manually for Magento 2

Delete the Module folder from {folder path}\app\code sudo chmod -R 777 var pub php bin/magento setup:upgrade php bin/magento cache:flush sudo rm -rf var/cache/ php bin/magento setup:di:compile Advertisements

Posted in כללי | Tagged | Leave a comment

how to put product into category, data come from csv magento 2

lets say i have this csv file

Posted in כללי | Tagged | Leave a comment

how to remove last category from product in magento 2

$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $productRepository = $objectManager->get(‘\Magento\Catalog\Model\ProductRepository’); $sku = 100101; $product = $productRepository->get(100101); $categories_from_db_by_product = $product->getCategoryIds(); array_pop($categories_from_db_by_product); $product->setCategoryIds($categories_from_db_by_product); $product->save();

Posted in כללי | Tagged | Leave a comment

how to get category id by name magento 2

$collection = $objectManager->create(‘\Magento\Catalog\Model\Category’)->getCollection()->addAttributeToFilter(‘name’,$my_name)->setPageSize(1); $cat_det = $collection->getData(); $category_id = $cat_det[0][‘entity_id’];

Posted in כללי | Tagged | Leave a comment

how to load categories from product magento 2

$categories_from_db_by_product = $product->getCategoryIds(); foreach($categories_from_db_by_product as $category){ $cat = $objectManager->create(‘Magento\Catalog\Model\Category’)->load($category); if($cat->getName() != $categories_from_csv[$i]){ $isIn = true; } }

Posted in כללי | Tagged | Leave a comment

how to get product by sku or id in magento 2

$objectManager =  \Magento\Framework\App\ObjectManager::getInstance();                           $appState = $objectManager->get(‘\Magento\Framework\App\State’);                 $appState->setAreaCode(‘frontend’);                   $productRepository = $objectManager->get(‘\Magento\Catalog\Model\ProductRepository’);                   $id = 1; // YOUR PRODUCT ID;                 $sku = ’24-MB01′; // YOUR PRODUCT SKU                   // get product by product id                 … Continue reading

Posted in כללי | Tagged | Leave a comment

how to start learn magento 2

1- first install :

Posted in כללי | Tagged | Leave a comment