magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.51k stars 9.31k forks source link

rest api are not available for wish list, review and rating #2495

Closed arunkasyakar closed 8 years ago

arunkasyakar commented 8 years ago

There are no rest api's available for wish list, review and rating related tasks.

choukalos commented 8 years ago

Yes; we won't get to that service for some time as we want to finish fully re-factoring Catalog, Sales, CMS, & Promotions (i.e. that means all client usages use the service, etc). It's currently in our backlog as ticket - MAGETWO-28087. Now if some enterprising community member wanted to build some expertise and re-factor reviews as a service, make it an extensible object of catalog and send us several pull requests (probably one for the service, then refactor internal module to use service, then one for each external module that's been refactored to use the service) that would be really cool - hint / nudge / etc.

alankent commented 8 years ago

If you need them in the shorter term, you can roll your own REST APIs fairly easily. There is the devdocs site, plus you might find http://alankent.me/2015/07/24/creating-a-new-rest-web-service-in-magento-2/ useful if you want to go that route.

realdigid commented 8 years ago

Is this already being worked on? I'm looking to contribute to Magento 2.0 code base looking for a place a start, any suggestions should i just find a few acknowledged issues and fix them? You have internal tickets, how do people contribute effectively if you have an internal ticket system I dont want to work on something that's already being worked on...?

choukalos commented 8 years ago

Hello @realdigid - they're not on our short term roadmap. So if you'd like to work on them please feel free to do so. I'd suggest looking at the customer service and patterning off that. We view services as a 2 step process. First we create a set of APIs for the module (see Alan's link) then we would re-factor the module's internal usages and then all external module usages to use those APIs. I'd suggest that you do a design document for what services ( URL, request/response, what are extensible objects or what would you attach the service as an extensible object to ) and DM me with that. I'll get it to the appropriate architect to review and provide feedback. Re-factoring modules to use the service is pretty straight forward, and also the bulk of the work/time spent, so think most of the PR feedback would be around the APIs. We usually find we have to make tweaks to the APIs when we're refactoring client usages so it pays big dividends to explore what you think you'd have to re-factor when designing the apis.

Thanks! Chuck

qwerty7869 commented 8 years ago

Did anyone have created wishlist and product review rest api?

ghost commented 8 years ago

Hi qwerty7869,

We have created the rest api's for the wishlist and for review . After implementing review and wishlist api we have added the code into the git hub please look at the following for review and wishlist : https://github.com/ajay-ipragmatech/magento2 - This is for review api https://github.com/manish-ip/magento2 - This link is for Wishlist APi

manish-pragma commented 8 years ago

We have created a custom extension for review and wishlist API which is in under process for submission. If you need this then contact us info@ipragmatech.com or wait till submit on Marketplace.

thdoan commented 8 years ago

For anyone who wants a really quick poor man's solution, then you can fake AJAX by replacing the default action (submit form post and redirect to wishlist page) with $.post(). This will allow customers to remain on the same page and you can immediately update the "Wish List" link to say "Wish Listed" and change the heart color to red, etc. Make sure you also chain a .fail() in there to notify customers when (on rare occasions) the product was not added to the wish list successfully.

To determine if a product is already in the wishlist so a product that has already been wishlisted will show "Wish Listed" when you go back to it:

$wishlistHelper = $this->helper('Magento\Wishlist\Helper\Data');
$_inWishlist = false;
foreach ($wishlistHelper->getWishlistItemCollection() as $_wishlist_item) {
  if ($_product->getId() === $_wishlist_item->getProduct()->getId()) {
    $_inWishlist = true;
    break;
  }
}

This is not a perfect solution by any means, but it has been working well for us since Magento 1.x days. In the long run, I do wish that all merchandising functionalities in Magento can be exposed as web services similar to Amazon (e.g., up-sells, cross-sells, customers who bought this also bought these).

piotrekkaminski commented 8 years ago

Thank you for your submission.

We recently made some changes to the way we process GitHub submissions to more quickly identify and respond to core code issues.

Feature Requests and Improvements should now be submitted to the new Magento 2 Feature Requests and Improvements forum (see details here).

We are closing this GitHub ticket and have moved your request to the new forum.