• Resolved microcoder

    (@microcoder)


    I’m using this plugin with WooCommerce and it works well except when we’re updating/creating products through the REST API.

    If I’m changing the post (product) title with a PUT request (wc/v3/products), then the post is updated and I can see the new title in the frontend.

    But if I’m changing only the post image with a PUT request, then the image will not be visible.

    It works if I’m updating the product in the admin.

    The same problem occurs when I’m creating a product with the REST API (POST /wc/v3/products/*). It doesn’t show up in the frontend until I’m updating the product in the admin.

    Any solution for this?
    I guess it can be some action hooks that are not triggered when the REST API is used for updating the data?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor digamberpradhan

    (@digamberpradhan)

    Hi @microcoder ,

    I am presuming these are for the paid addon – Typesense for WooCommerce. If so, please go to https://forum.codemanas.com/ or
    drop us a mail at support[@]codemanas.com

    The wordpress forum rules doesn’t allow us to provide support for premium products here.

    Thread Starter microcoder

    (@microcoder)

    Actually I’m using Search with Typesense (not Typesense for WooCommerce).

    I did not need the WooCommerce-functionality so I’m fine with this free plugin. Typesense for WooCommerce seemed unnecessary as my site is kind of custom and has no use of the WooCommerce-functionality (frontend) from the paid plugin.

    But if my problem is solved in Typesense for WooCommerce, that could be interesting to start using the plugin.

    After some investigation I found that my problems are the following:

    1. When I’m updating only the post image with the REST API the “wp_after_insert_post” is not triggered => no update in Typesense.
    2. When I’m creating a new post with the REST API => The post category is not found when I’m using the “cm_typesense_data_before_entry” hook. And because of that the post will not show up when I’m filtering on that category.

    Maybe this is out of scope of this support as it’s kind of custom. I just wanted to check if someone had a similar problem and knew a solution.

    Plugin Contributor digamberpradhan

    (@digamberpradhan)

    @microcoder oh ok,

    The wp_after_inser_post should be triggered even after post is entered via rest api. That’s the reason we used wp_after_insert_post instead of wp_insert_post

    /wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php

    If you are using woocommerce rest endpoints though – it may be that woocommerce has their own custom triggers using the rest endpoints.
    Having said that the premium addon also uses the same hook.

    We haven’t received other users reporting this issue but I will need to do some more testing before I can confirm this issue.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘REST API updates not visible’ is closed to new replies.