Jump to content

Welcome, Guest!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

braffas

Customer->customerExists

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.

Share this post


Link to post
Share on other sites

Nope, Braffas is also my GitHub name

I will check GitHub first next time. Great that it's getting fixed :)

Share this post


Link to post
Share on other sites

Good to here! Help is strongly needed with proofreading the Swedish translation

Share this post


Link to post
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...