Add guest customer id (WIP)

This commit is contained in:
dinamiko 2021-12-24 12:37:06 +01:00
parent ece3ef95d3
commit d69f1b5a9c
5 changed files with 18 additions and 96 deletions

View file

@ -590,7 +590,7 @@ class SmartButton implements SmartButtonInterface {
return false;
}
return is_user_logged_in();
return true;
}
/**
@ -637,7 +637,7 @@ class SmartButton implements SmartButtonInterface {
$localize = array(
'script_attributes' => $this->attributes(),
'data_client_id' => array(
'set_attribute' => ( is_checkout() && $this->dcc_is_enabled() ) || $this->can_save_vault_token(),
'set_attribute' => $this->can_save_vault_token(),
'endpoint' => home_url( \WC_AJAX::get_endpoint( DataClientIdEndpoint::ENDPOINT ) ),
'nonce' => wp_create_nonce( DataClientIdEndpoint::nonce() ),
'user' => get_current_user_id(),