Tôi đang lưu địa chỉ khách hàng trong bảng customer_address_entity
. Tất cả mọi thứ là ok nhưng tôi muốn có được cuối cùng tạo ra entity_id
. Ai đó có thể giúp tôi được không?Cách lấy id được chèn cuối cùng trong mô hình địa chỉ khách hàng Magento
Tôi có mã sau;
$customAddress = Mage::getModel('customer/address');
$customAddress->setData($_custom_address)
->setCustomerId($customer->getId())
->setIsDefaultBilling('0')
->setIsDefaultShipping('1')
->setSaveInAddressBook('1');
try {
$customAddress->save();
} catch (Exception $ex) {
Mage::log("\n Address save Error:: \n" . $ex->getMessage(), null, $this->log_entry_file);
}