Try below code: $obj = \Magento\Framework\App\ObjectManager::getInstance(); /** @var \Magento\Catalog\Model\Product $product */ $productObject = $obj->get('Magento\Catalog\Model\Product'); $product = $productObject->loadByAttribute('sku', 'Test Test'); ...
Cookies Consent Popup
- June 06, 2021
- 0 Comments
You can use \Magento\InventoryApi\Api\SourceItemRepositoryInterface class with \Magento\Framework\Api\SearchCriteriaBuilder to get source item data by source code and product SKU.Here are the sample model class <?php namespace MageExpert\Testing\Model; class SourceItemModel { private $searchCriteriaBuilder; private $sourceItemRepository; public function __construct( ...
- June 06, 2021
- 0 Comments
If error in indexing after upgrade then run below sql query in phpmyadminCREATE SQL SECURITY INVOKER VIEW `inventory_stock_1` AS SELECT DISTINCT legacy_stock_status.product_id, legacy_stock_status.website_id, legacy_stock_status.stock_id, legacy_stock_status.qty quantity, legacy_stock_status.stock_status is_salable, product.sku FROM cataloginventory_stock_status` `legacy_stock_status` INNER JOIN `catalog_product_entity`...
- June 06, 2021
- 0 Comments
I have installed Elasticsearch in my Linux. Follow below Steps.Run the below command to Install Elasticsearch In locally. Download and install the public signing key :`wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -`Installing from the APT repositoryedit You may need to install the apt-transport-https package on Debian before proceeding :`sudo apt-get install apt-transport-https`Save the repository definition to /etc/apt/sources.list.d/elastic-7.x.list :`echo "deb https://artifacts.elastic.co/packages/7.x/apt...