Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magento 2 REST API compatibility #217

Closed
nghelo opened this issue Nov 25, 2016 · 14 comments
Closed

Magento 2 REST API compatibility #217

nghelo opened this issue Nov 25, 2016 · 14 comments
Assignees

Comments

@nghelo
Copy link

nghelo commented Nov 25, 2016

I'm trying to list all products for each category but I can't list products inside the virtual categories that follow the virtual rules. Is this possible using the Magento 2 REST API?

Thanks.

@romainruaud
Copy link
Collaborator

romainruaud commented Nov 28, 2016

Hello @nghelo and thank you for submitting this issue, and for using our module.

You are right, actually it is impossible to retrieve the product list associated to a virtual categorie via the API. This is a known limitation of the module and we'll probably fix it on a later version.

We keep this issue open and will keep you in touch about this one.

Best regards,

@romainruaud romainruaud self-assigned this Nov 28, 2016
@afoucret
Copy link
Contributor

afoucret commented Dec 2, 2016

Hi @nghelo,

I didn't have time to review this issue before but I think there is an important things here.

As a matter of semantic, It is fully expected that you are not able to list products inside a category if you are using this API : GET /V1/categories/{categoryId}/products. This API is an admin API in Magento whose behavior is to list products attached to the category (or Get products assigned to category in the documentation).

For a standard Magento, it is not consistent with what you will see in the front layered navigation :

  • For layered categories, you will not see products of the children categories. What is annoying if you want to use this API in a front application

  • It does not handle visibility filtering for the products

  • Sorting is not really applied to the category (only position sort is), what is not always relevant with how category is tuned ...

Concerning virtual categories, products are never attached to the category and this behavior appears to be normal and consistent with Magento API semantic.

We are currently working on repairing the Magento Search API (GET /V1/search) whose purpose is to search in products. You can also applies filters (category, price, attributes) just like in the layer navigation and event fulltext search. I will document it when job will be done.

There is a WIP for this there : https://github.com/afoucret/elasticsuite/tree/fix-search_api and should be released in 2.3.0 or 2.4.0 depending how we are fast to implement it.

@afoucret
Copy link
Contributor

afoucret commented Dec 2, 2016

TL;DR : we will not work on the category products API but rather implement the search API to be consistent with the layered navigation / search result

@ddattee
Copy link

ddattee commented Nov 7, 2017

Hi, any news on the search API integration ?

@sedax90
Copy link

sedax90 commented Nov 22, 2017

Hello, any news? The #13 is returning a bad fatal error and is not good...

@sibhis
Copy link

sibhis commented Jan 2, 2018

I followed the fix#14 like https://github.com/afoucret/elasticsuite/tree/fix-search_api. But I still get error message which says
Fatal Error: 'Uncaught TypeError: Argument 1 passed to Smile\ElasticSuiteCore\Model\Search::__construct() must implement interface Magento\Framework\App\ScopeResolverInterface, instance of Magento\Framework\ObjectManager\ObjectManager given...

@sedax90
Copy link

sedax90 commented Jan 8, 2018

@sibhis for me the error was caused by another module and not elasticsuite, try to debug your code

@afoucret
Copy link
Contributor

afoucret commented Jan 22, 2018

See PR #700 which aims to implement search API support.

Done :

  • Support for text search with all ElasticSuite features enabled (boost, relevance config, ...)
  • Support for sort order including category navigation position from the visual merchandiser
  • Filtering support
  • Virtual categories filtering support

Now missing :

  • Aggregation support
  • Automatic handling of visibility and stock configuration.

@afoucret afoucret added this to the 2.5 milestone Jan 22, 2018
@afoucret afoucret removed this from the 2.5 milestone Feb 1, 2018
@afoucret
Copy link
Contributor

afoucret commented Mar 5, 2018

Update :

@Koc
Copy link
Contributor

Koc commented Nov 11, 2018

How it possible query for products fultered by category and some of attributes?

@romainruaud
Copy link
Collaborator

Hello @Koc

Actually, you can use the legacy Magento2 search API according to the documentation and you will obtain results based on Elasticsuite.

What is actually missing is the aggregation support : aggregation are not sent back in the API response. It's scheduled for next major release (2.7) and have max priority.

Regards

@Koc
Copy link
Contributor

Koc commented Nov 12, 2018

Thank you. Aggregation support would be very useful for shops which uses Magento in headless mode.

@romainruaud
Copy link
Collaborator

Search API was fully integrated in latest 2.7.0 release. I close this one.

@overjolted
Copy link

Hello, thank for a great suite, that you guys have developed.
I do have a question though:

How do I create a virtual category and set rules for it via API?

PS To see what it might look like, I manually created a virtual category and set rules for it, but when I retrieve info about this category via API, 'virtual_rule' value is just an empty list. Why is that? Where do I find en example for setting rule for a virtual category via API?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants