直接创建Magento客户到Magento数据库

时间:2014-04-11 07:28:37

标签: php database magento yii

我需要的是从直接连接到magento数据库的外部php应用程序(在yii框架中开发)创建magento客户的解决方案。将使用表单输入客户信息。我真正感兴趣的magento客户的唯一字段是客户电子邮件和密码,即我想创建一个客户,其最小字段仅包括电子邮件和密码作为表单条目。但是,如果它们是“必填”字段,我不介意在表单中添加名字和姓氏。我知道,对于Magento客户创建,需要webstore_id和store_id,但这些可以硬编码为默认值。

我在网上找到了一些代码,演示了如何在使用Mage.php文件的同时创建客户。这些教程的一些链接包括: http://www.douglasradburn.co.uk/adding-new-customers-to-the-magento-store-programmatically/ http://inchoo.net/ecommerce/magento/programming-magento/programmaticaly-adding-new-customers-to-the-magento-store/

但在这些教程中,他们对客户信息进行了硬编码。就像我说的,我的要求包括在yii框架中从外部php应用程序在php页面上使用表单。

非常感谢解决方案。

1 个答案:

答案 0 :(得分:0)

在magento中创建一个模块,用于从脚本中检索信息,然后实现这类内容: Create customer programmatically