0

I want to populate custom attribute while creating create product. I have created below plugin which is working fine while saving product using REST Bulk API v1/products.

But it's not working while we are running this bulk product save API asynch/bulk/v1/products.

File location are given below"

app/code/Vendor/Module/etc/webapi_rest/di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">    
    <type name="Magento\Catalog\Api\ProductRepositoryInterface">
        <plugin name="name-integrations" type="Vendor\Module\Plugin\ProductPlugin" sortOrder="10"/>
    </type>
</config>
1
  • Is anyone know the class name of bulk product save? Mar 17 at 11:05

1 Answer 1

1

It looks like bulk product updates don’t use the Magento\Catalog\Api\ProductRepositoryInterface when saving product data. You can see in the queue consumer Magento\Catalog\Model\Attribute\Backend\Consumer::execute() that it is calling Magento\Catalog\Model\Product\Action::updateAttributes().

You didn’t specify what your plugin does, but maybe you can create an observer on the event catalog_product_attribute_update_before which gets emitted during that call chain I mentioned above.

1
  • I want populate custom attribute while create product using bulk API Mar 20 at 11:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.