I’m doing something like this foreach ($arrayItemsToReplace as $key => $item){ $product->getMediaGalleryImages()->removeItemByKey($key); $product->getMediaGalleryImages()->addItem($item); } if(count($arrayItemsToReplace)){ try{ $this->productRepository->save($product); But this is triggering me this error on the save action Products “X” and “Y” have the same set of attribute values. I’m also facing this issue with the same piece of code […]
Magento
I’ve created a customer EAV attribute and trying to show this attribute in the product details page but it always return chaced data till I run bin/magento cache:flush full_page. I’ve tried to use sections.xml in the frontend area but it’s not working. section.xml file content: <?xml version="1.0" encoding="UTF-8"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" […]
module.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Greenplank_UploaderFix"> </module> </config> registration.php <?php MagentoFrameworkComponentComponentRegistrar::register( MagentoFrameworkComponentComponentRegistrar::MODULE, 'Greenplank_UploaderFix', __DIR__ ); di.xml <?xml version="1.0" ?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="MagentoFrameworkAppFilesystemDirectoryResolver" type="GreenplankUploaderFixAppFilesystemDirectoryResolver"/> </config> DirectoryResolver.php <?php namespace GreenplankUploaderFixAppFilesystem; use MagentoFrameworkAppFilesystemDirectoryList; /** * Magento directories resolver. */ class DirectoryResolver { /** * @var DirectoryList */ private $directoryList; […]
I am trying to import products programmatically into a Magento 2.4.4 installation but I have problem setting the Salable Quantity. I cannot find a viable solution to this issue, please help if you can. Here is the code I am using to set product Quantity (simplified): use MagentoCatalogApiProductRepositoryInterface; use MagentoInventoryApiApiDataSourceItemInterfaceFactory; […]
I have an error that occurs randomly when I go to create a configurable product. The process is as follows: First I create all the simple products and in an array, I store all the ids of the simple products. Then through the following code, I go to create the […]
I’ve created a CMS page with a form where customers can submit some info & by clicking ‘submit’ Magento sends an email (with all the info provided into the form) to an address that I set by a custom configuration tab (Stores > Configuration > Vendor > Module). I developed […]
after opening customer –> All customer –> edit –> addressees so i want to remove this section any ideas please ? Thank you .
I had read many articles and tried different solutions, but facebook debugger still tells me: The ‘og:image’ property should be explicitly provided, even if a value can be inferred from other tags. In the head tag, I have <meta property=”og:image” Other open graph attributes, like the page title and page […]
i have problem in this page in catalog –> Data Feed that’s after upgrade from 2.1.10 to 2.3.5 , so any idea for how can i solve with explanation for beginner please . this is page source , Thank you .