Support » Plugin: Force Login » Abandoned Cart Lite for WooCommerce links not working in bypass code

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Kevin Vess

    (@kevinvess)

    Hi Miguel,

    Your code did not work because the conditional statement will never return true.

    // Get visited URL without query string
    $url_path = preg_replace('/\?.*/', '', $_SERVER['REQUEST_URI']);
    
    // Allow URL
    if ( '/?wcal_action=track_links&validate=' === $url_path ) {
      $bypass = true;
    }

    Based on your example abandoned cart link and your coded conditional statement, the $url_path variable would equal '/', which would have tested as the following condition:

    if ( '/?wcal_action=track_links&validate=' === '/' ) {
      $bypass = true;
    }

    I suggest you try the following bypass method instead:
    Method 3 – Page URL based on Query String Parameter(s) and/or Value(s)

    Specifically this conditional statement:

    if ( $_GET['wcal_action'] == 'track_links' && isset( $_GET['validate'] ) ) {
      $bypass = true;
    }

    Good luck!

    Hi Kevin,

    It worked! 🙂

    Thank your help!

    Miguel

    I have made a donation for the plugin. 😉

    Plugin Author Kevin Vess

    (@kevinvess)

    Hi Miguel,

    I’m glad you got it working!

    Thanks for the donation, it’s greatly appreciated! 🙌

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.