• Resolved nartoof

    (@nartoof)


    Hi,

    I’d like to find a solution when user send a review to display it immediatly.

    Is there any way to send and display the review using Ajax ?
    Or any hook I can use to reload the page after the review is sent ?

    Thank you for your help.

    Anthony

    • This topic was modified 4 years, 8 months ago by nartoof.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Gemini Labs

    (@geminilabs)

    Each shortcode can have different options set which potentially means they can display different things. In other words, they are independent from one another which is why new reviews do not appear on the page until after the page is reloaded (one shortcode is used to submit the review, another is used to display them, and another is used to show the summary).

    If you like, you can force the page to reload after a successful submission with the following javascript snippet:

    document.addEventListener('site-reviews/after/submission', function (event) {
        if (false !== event.detail.errors) return; // stop if there were errors
        location.reload(true); // reload the page from the server instead of the browser cache.
    });
    • This reply was modified 4 years, 8 months ago by Gemini Labs.
    Thread Starter nartoof

    (@nartoof)

    Ok I understand it’s not possible to display them immediatly after submit.

    I used your snippet and it works perfectly, thank you.

    Have a nice day.

    Anthony

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Send the review in ajax or force reloading the page’ is closed to new replies.