Magento obtiene el teléfono del cliente por sql

How to get customer's telephone by sql code,

preguntado el 28 de mayo de 14 a las 13:05

Where do you want to get this? On what page? What did you try? -

1 Respuestas

Magento is based on EAV architectur So if you take a look at eav_attribute table you'll see that telephone attribute is a varchar and the entity_type_id is 2 (it mean it's a customer address attribute) You Sql request may look like :

select customer_address_entity_varchar.value from customer_address_entity_varchar
left join  customer_entity on customer_entity.entity_id = "your_customer_id"
left join  customer_address_entity on customer_address_entity.parent_id = customer_entity.entity_id
join eav_attribute on eav_attribute.attribute_code="telephone"
where customer_address_entity_varchar.attribute_id = eav_attribute.attribute_id

Respondido el 06 de junio de 14 a las 16:06

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.