As type string:(but I need as an object) <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="MagentoSalesApiDataOrderInterface"> <attribute code="admin_user" type="string"/> </extension_attributes> </config> should be something like: <attribute code="admin_user" type="pathtoobject"/> Plugin: <?php declare(strict_types=1); namespace CollinsOrderTrackingPlugin; use MagentoSalesApiDataOrderInterface; use MagentoSalesApiDataOrderSearchResultInterface; use MagentoSalesApiOrderRepositoryInterface; use CollinsOrderTrackingModelAttributesFactory; use MagentoBackendModelAuthSession; use CollinsOrderTrackingModelResourceModelAttributeCollectionFactory; use CollinsOrderTrackingApiAttributesRepositoryInterface; use MagentoFrameworkApiSearchCriteriaBuilder; use MagentoFrameworkSessionSessionManagerInterface; […]
Magento
I have created an attribute type: Test but I want to display in the grid customer. https://prnt.sc/aRyraGEP7kKf
I have created the custom HTML and CSS banner for magento page. On localhost it is showing as below: On magento localhost is showing as below: below is code of banner in localhost <!doctype html> <html lang="en"> <head> <!-- Required meta tags --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> […]
I just start in Magento 2 and I came across problem. When I select a simple product, that belong to a configurable product, my code returns the product id from the configurable product. I can print the childs of this configurable product but I need to have exactly the product […]
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 […]
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 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 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; […]