Support » Plugin: YOP Poll » redirect after trying to vote a second time

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author YOP

    (@yourownprogrammer)

    Hi agent14,

    Edit js/yop-poll-public.js and approximately on line 279 you will find

    if ( '' != response.error ) {
    jQuery( '#yop-poll-container-error-' + poll_id + unique_id ).html( response.error );
                    jQuery( '#yop-poll-container-success-' + poll_id + unique_id ).html( '' );
                    popupClose = true;
                }

    Between the braces add

    if( response.error.toLowerCase() == 'you already voted!' ) {
                        window.location = 'new url';
                    }

    so in the end you’ll have

    if( '' != response.error ) {
                    if( response.error.toLowerCase() == 'you already voted!' ) {
                        window.location = 'new url';
                    }
                    jQuery( '#yop-poll-container-error-' + poll_id + unique_id ).html( response.error );
                    jQuery( '#yop-poll-container-success-' + poll_id + unique_id ).html( '' );
                    popupClose = true;
                }

    Regards,

    YOP Team

    thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘redirect after trying to vote a second time’ is closed to new replies.