Skip to content

magento man

How to save hide image programmatically in magento 2 admin product edit?

I want to set & save the hidden product image( Hide from Product Page ) programmatically in Magento 2 in admin panel? I tried this way $product = $this->productLoader->create()->load($productId); $mediaAttribute = array (); $productImage = ‘/Applications/MAMP/htdocs/magento245p1v1/pub/media/catalog/product/W/S/WS03-XS-Red_1219111980.jpg’; $product->addImageToMediaGallery($productImage, $mediaAttribute, false, false);… Read More »How to save hide image programmatically in magento 2 admin product edit?

How to save data to database using interface repository api

I’m a newbie magento 2 developer. I’m currently learning how to store data to database using repository-interface-model-api approach. My code is not working. model ItemRepository class ItemRepository implements ItemRepositoryInterface { private $collectionFactory; protected $itemFactory; public function __construct( CollectionFactory $collectionFactory )… Read More »How to save data to database using interface repository api

Notice: Undefined index: default in vendor/magento/module-catalog/……BatchSizeCalculator.php

I got this error when try to reindex catalog_product_price php bin/magento indexer:reindex catalog_product_price Notice: Undefined index: default in /public_html/vendor/magento/module-catalog/Model/ResourceModel/Product/Indexer/Price/BatchSizeCalculator.php on line 55 and from system.log 2019-11-27 20:03:04] main.ERROR: Cron Job indexer_reindex_all_invalid has an error: Notice: Undefined property: MagentoCatalogModelResourceModelProductIndexerPriceBatchSizeCalculator::$_batchRowsCount in /public_html/vendor/magento/module-catalog/Model/ResourceModel/Product/Indexer/Price/BatchSizeCalculator.php… Read More »Notice: Undefined index: default in vendor/magento/module-catalog/……BatchSizeCalculator.php

Magento 2 GraphQl get store wise product collection

I want to get the product collection store-wise via graphQl. I have set in header parameter “Store”: “ar”, I want to get the product name in the Arabic store, but it’s not working. I have referred this https://devdocs.magento.com/guides/v2.4/graphql/send-request.html#headers