New answers tagged

0

app\code\Vendor\Module\etc\webapi_rest\events.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd"> <event name="catalog_product_save_before"> <observer name="...


0

Issue solved. I just had to replace body => with json =>, that was all.


0

I have the same issue. Workaround is to decode product names before sending to Rest API: var product_name_encoded = product_name.replace(/[\u00A0-\u9999<>\&]/g, function(i) { return '&#'+i.charCodeAt(0)+';'; });


0

Refer to the Below Reference. https://devdocs.magento.com/guides/v2.4/rest/tutorials/orders/order-create-quote.html


0

You can use a plugin to add value in API's return result The handler function in the api /V1/cmsPage/:pageId is vendor/magento/module-cms/Model/PageRepository.php:217 you should use the after plugin in the function getById, then use the setData function to add your value to the returned result


0

I think you are trying to add the same attribute twice to a product. {"option":{"attribute_id":"194","label":"color2","position":0,"is_use_default":true,"values":[{"value_index":91},{"value_index":92},{"value_index":93}]}} i only get an error when ...


0

You need to use code like this one. use Magento\Framework\Serialize\Serializer\Json; class SliderImages { protected $serialize; public function __construct(Json $serialize) { $this->serialize = $serialize; } public function getImages() { $results = $model->getData(); return $this->serialize->...


0

I don't see any reason for using the following lines: CURLOPT_ENCODING => "", CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_ENCODING => "", Try removing all these lines, or, if you prefer, test removing one by one.


0

Magento doesn't provide a centralize way to make api REST call to external services. I worked with lot of customers and developers always use their own REST implementation, using multiple libraries like Guzzle, Curl, Zend... That's why I recommand you to use this module to industialize your REST API call through Guzzle library: https://github.com/zepgram/...


0

public function afterGet(OrderItemRepositoryInterface $subject, OrderItemInterface $orderItem) { $customAttrName = $orderItem->getData(self::CUSTOM_ATTR_NAME); $extensionAttributes = $orderItem->getExtensionAttributes(); $extensionAttributes = $extensionAttributes ? $extensionAttributes : $this->extensionFactory->...


0

Check your third party extension which have space into the starting of xml file : like : <?xml version="1.0"?> so remove that and then check.


Top 50 recent answers are included