• Resolved Tushar

    (@tushar4monto)


    Hello

    /wp-json/wc/v2/products/<product_id>/reviews

    If I Uncheck Enable reviews option from an advance tab in edit product page still I get the product review using this API. but in Website, if I set this option to uncheck the reviews tab in product details page will be hidden. Please check below link.

    https://prntscr.com/jvkot3

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Tushar

    (@tushar4monto)

    Hello

    We are waiting for your reply. we are facing issue with REST API. Do you need more details from our side? Please help us

    Thank You

    Howdy ??

    I don’t know that I understand the issue so let me put it in my own words.

    A product does not have reviews enabled but you can still retrieve the reviews via a GET call to the REST API and that seems inconsistent with the experience you have when viewing the same product on the site. Is that correct?

    If so, the reason for the difference is that when displaying, the display is conditional upon whether the comments are open on the product (which is the equivalent of the ‘enable review’ checkbox). That conditional statement can be seen in code here: https://github.com/woocommerce/woocommerce/blob/3.4.2/includes/wc-template-functions.php#L1667-L1673

    When making a GET request to the reviews API endpoint, you are explicitly asking for the reviews and there is no condition that needs to be met and the reviews will be returned by the REST API handler. This is expected behavior.

    Kind regards

    Thread Starter Tushar

    (@tushar4monto)

    Hello

    Thanks for your reply.
    We have one more questions. it is possible to create the fully-functional mobile application like with applications we can
    1) Manage customer ( login/add/edit )
    2) Manage cart with synchronizing with web site too. like Amazon app.
    3) manage checkout like website all payment methods etc there.
    We have checked your App
    https://woocommerce.com/ios/
    there is not any cart and checkout process on your app.
    Our goal to create full-functional application with woocommerce.

    • This reply was modified 6 years, 8 months ago by Tushar.
    jessepearson

    (@jessepearson)

    Automattic Happiness Engineer

    These options you would like sound like you are just wanting the website itself to be on the mobile device. Not all functionality is available in the API due to it is meant to provide a connection to the core WooCommerce data, not remotely operate the store.

    The API will allow you to add and edit customers, but you cannot use it to mark a customer as logged in.
    The cart is managed through sessions on the server along with cookies, and there are no API functions for the cart, so it is not possible to sync through the API.
    Gateways use client and server side checks, so they are not available to function fully through the API unless the developer has created API functionality within the gateway plugin.

    If an app were created where customers never saw the website, the login, cart and checkout would need to be handled through the app itself and another server.

    Thread Starter Tushar

    (@tushar4monto)

    Thanks a lot for your reply in details.

    jessepearson

    (@jessepearson)

    Automattic Happiness Engineer

    @tushar4monto You’re welcome. I am going to mark this thread as resolved. If there’s any related questions, feel free to open it again.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Enable reviews option not working in API’ is closed to new replies.