Skip to content

Need to merge extra field in getJsonResponse result using custom plugin

public function aroundExecute(VendorApiControllerProductPage $subject, Closure $proceed)
    {
        $productId = $this->request->getParam("productId");
        $this->product = $this->productFactory->create()->load($productId);
        $title = $this->product->getData('title');
        $extraInfo['title'] = $title;
        $this->returnArray["extra"] = $extraInfo;
        return $this->returnArray;
    }