1

I've to import custumers from a txt file but I don't know what I have to use like univocal attribute to verify the customer presence into database. For example, for the products import I use the sku attribute.

$product_model = mage::getModel('catalog/product');
                $productId = $product_model->getIdBySku($sku);
                if (!$productId){
                    // insert
                }else{
                   // update
                }

Can you help me, please?

1 Answer 1

1

Well I guess you can check by using their email with the following code:

$customer = Mage::getModel('customer/customer')->loadByEmail($customerEmail);
if ($customer->getId()) {
    // Customer exists
} else {
    // Customer doesn't exist
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.