Jump to content
thirty bees forum

Customer->customerExists


braffas

Recommended Posts

I don't know if this is the right place to post this, but here goes.

In the method below Customer->customerExists

public static function customerExists($email, $returnId = false, $ignoreGuest = true)
{
    if (!Validate::isEmail($email)) {
        if (defined('_PS_MODE_DEV_') && _PS_MODE_DEV_) {
            die(Tools::displayError('Invalid email'));
        }

        return false;
    }

    $sql = new DbQuery();
    $sql->select('`id_customer`');
    $sql->from(bqSQL(static::$definition['table']));
    $sql->where('`email` = \''.pSQL($email).'\' '.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER));
    $sql->where('`is_guest` = 0');
    $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);

    return ($returnId ? (int) $result : (bool) $result);
}

The $ignoreGuest param is not used by the DB query anymore.

This may give some annoying problems (no errors) with modules that use the method.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...