0

In my drupal 8 Commerce, I have a view with product and filter criteria.

And I want to know, if it's possible to add result to this view with a result of webservice.

I try to inspect $view->result in hook_views_pre_render

and the result is view\ResultRow with entity Product

enter image description here

Is it possible to add results without creating an entity and from an webservice just read information like this schema:

/myviewurl

  • Product 1 (from drupal db)
  • Product 2 (from drupal db)
  • Product 3 (from drupal db)
  • Product 4 (from webservice not in db)
  • Product 5 (from webservice not in db)
  • Product 6 (from webservice not in db)

1 Answer 1

0

Try hook_views_pre_render hook to alter view result if only you need to display result. You just need to prepare the webservice result as per hook_views_pre_render result data.

Your Answer

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

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