Help with Woocommerce cart
-
Hello,
I’m trying to use Force login with Woocommerce. I added two pages on whitelist and modify your snippet like this:
/**
* Bypass Force Login to allow for exceptions.
*
* @param bool $bypass Whether to disable Force Login. Default false.
* @param string $url The visited absolute URL.
* @return bool
*/
function my_forcelogin_bypass( $bypass, $url ) {echo $url;
wp_die();$whitelist = array(
home_url( ‘/compra-segura/?’ . $_SERVER[‘QUERY_STRING’] ),
home_url( ‘/carrinho/?’ . $_SERVER[‘QUERY_STRING’] ),
);if ( ! $bypass ) {
$bypass = in_array( $url, $whitelist );
}
return $bypass;}
add_filter( ‘v_forcelogin_bypass’, ‘my_forcelogin_bypass’, 10, 2 );But did not work. I put echo $url; wp_die(); only to know what is the correct url and I found https://mydomain.com/carrinho/.
What I doing wrong?
Could you help me?
Regards.
Jader Silva
- The topic ‘Help with Woocommerce cart’ is closed to new replies.