根据magento中的地址ID和客户ID编辑客户地址 [英] Editing customer address based on address id and customer id in magento

查看:103
本文介绍了根据magento中的地址ID和客户ID编辑客户地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以建议我如何根据地址ID和客户ID更新客户地址.我已经尝试过搜索它,但是它说即使我也尝试过编辑地址也是不可能的.

can anyone suggest me how can I update customer address based on address id and customer id. I have tried searching it but it is saying that edit address is not possible even I tried also it is not happening.

我认为通过sql查询可能是可行的,但是我不知道该写什么sql查询.有人可以帮我吗.真的会很感激.

I think it might be possible through sql query, but I dont know what sql query to write. So can someone help me. Really will appreciate.

推荐答案

在这里:

// change these IDs to match your customer and address
$customerId = 136;
$addressId = 92;

$customer = Mage::getModel('customer/customer')->load($customerId);
$address = $customer->getAddressById($addressId);
$address->setStreet('123 Main Street');
$address->setCity('Anytown');
$address->save();

如果您需要获取地址ID的方法,请告诉我您要完成的工作,并且可以让您知道实现此目的的最佳方法.

If you need ways to obtain address IDs, please let me know what you are trying to accomplish and I can let you know the best way to do so.

这篇关于根据magento中的地址ID和客户ID编辑客户地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆