• Resolved mark8181

    (@mark8181)


    Hi guys,

    I am using site reviews on a reviews pages >>> https://www.viverelondra.com/recensioni

    When a visitor submits their review, the popup created with Popup Maker – with functionality to close automatically after the review is submitted – doesn’t actually close automatically.

    I have contacted Popup maker and could not find any solution. The solution offered was to create a thank you page which is not what I need and want.

    They also gave me this final answer: https://www.screencast.com/t/wpN1Tu4735a

    Could you please guys help?

    thank you,
    Marco

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Gemini Labs

    (@geminilabs)

    So you have added the review form to a popup (that you have created with the Popup Maker plugin), and you want it to automatically close once someone has submitted a review. Correct?

    If it closes automatically, how do you alert the user that the submission was successful?

    When a review is submitted successfully, Site Reviews displays a “your review was submitted successfully” notice under the form. If the popup closes automatically, then they will not see this notice.

    Site Reviews provides an example on the FAQ page how to hide the form after a submission:

    So perhaps that is a better solution than simply auto-closing the popup after a successful submission.

    Alternatively, you can add some javascript code that listens for the submission event, and then use it to close the popup on success:

    document.addEventListener('site-reviews/after/submission', function (ev) {
        if (false !== ev.detail.errors) return; // don't close the popup if the submission was unsuccessful
    
        // close the popup with javascript here...
    
    })

    They are correct in that the “WPForms” plugin style option in Site Reviews only matches the display of the Site Reviews form with the CSS of WPForms, but it does not use a WPForm form itself.

    Perhaps direct their support team to this reply and they will probably be able to assist you further.

    • This reply was modified 4 years, 1 month ago by Gemini Labs.
    • This reply was modified 4 years, 1 month ago by Gemini Labs.
    Thread Starter mark8181

    (@mark8181)

    Hi Gemini,

    thank you so much. By auto-closing the popup I actually meant exactly what you suggested me.

    With WPforms and POPup maker, I can set an interval of time to make automatically the popup close after submission, for example after 2 seconds.

    With your script, I achieved a similar result.

    Question about this:

    document.addEventListener('site-reviews/after/submission', function (ev) {
        if (false !== ev.detail.errors) return; // don't close the popup if the submission was unsuccessful
    
        // close the popup with javascript here...
    
    })

    Should I add it right after the first script in the event of submission error?

    Thank you,
    Marco

    Thread Starter mark8181

    (@mark8181)

    When I add the code

    document.addEventListener('site-reviews/after/submission', function (ev) {
        if (false !== ev.detail.errors) return; // don't close the popup if the submission was unsuccessful
    
        // close the popup with javascript here...
    
    })

    It gives me error syntax error, unexpected ‘)’, expecting variable (T_VARIABLE)

    Plugin Author Gemini Labs

    (@geminilabs)

    Should I add it right after the first script in the event of submission error?

    You can add it anywhere on your page as the event listener is added to document.

    It gives me error syntax error, unexpected ‘)’, expecting variable (T_VARIABLE)

    Pasting the code I provided above into the Browser Web Inspector javascript console does not trigger any error for me. This error you are seeing is likely related to something else.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Popup created with site reviews not closing’ is closed to new replies.