Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
magento 有什么方法可以检测地址是否已经存在。
客户可以在 OnePageCheckout 中决定是使用现有地址还是输入新地址。如果它是现有的,我不想/不需要验证它。
那么有什么办法可以查出是不是新地址呢?
您可以使用以下代码获取已登录客户地址的完整列表:
$customer = Mage::getSingleton('customer/session')->getCustomer(); foreach ($customer->getAddresses() as $address) { Zend_Debug::dump($address->debug()); }