예제 #1
0
Mage::app ( 'default' );

$av = new ICC_Avectra_Model_Account();

/*
 * 850739
 *
 * 820110
 */

//
// 8063540
/// 5225406 org


$user = $av->getUserByRecNo(8063540)->WEBWebUserGetByRecno_CustomResult;

print_r($user);

//echo "\n\n------------createNewUser---------------\n\n";


echo "\n\n---------updateUser------------------\n\n";
$aff = $av->updateUser($user->CurrentKey);

print_r($aff->getData());

die;

$aff = $av->getUserOrgCustomerNo($user->CurrentKey);
 protected function setCustomerData($order)
 {
     // name
     $this->CustomerName = trim($order->getCustomerFirstname() . " " . $order->getCustomerLastname());
     if (empty($this->CustomerName)) {
         $this->CustomerName = $this->BillToAddress->ContactName;
     }
     $this->CustomerEmail = $order->getCustomerEmail();
     $this->CustomerPhone = preg_replace("[^0-9]", "", $order->getBillingAddress()->getTelephone());
     // Data not stored on order.
     // Will always be blank if this is a guest.
     $avcustomer = new ICC_Avectra_Model_Account();
     $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
     if ($customer->getCustomerNo()) {
         $this->CustomerId = $customer->getCustomerNo();
         $this->INDNumber = $customer->getCustomerNo();
         //	if( $customer->getOrgCustomerNo() != null)
         //		$this->ORGNumber    = $customer->getOrgCustomerNo();
         $user = $avcustomer->getUserByRecNo($this->CustomerId)->WEBWebUserGetByRecno_CustomResult;
         $orgcustno = null;
         $orgcustno = $avcustomer->getUserOrgCustomerNo($user->CurrentKey);
         if ($orgcustno) {
             if (is_array($orgcustno)) {
                 $orgcustno = $orgcustno[0];
             }
             $this->ORGNumber = $orgcustno;
         }
     }
     if ($customer->getMemberStatus()) {
         $this->MemberFlag = $customer->getMemberStatus();
     } else {
         $this->MemberFlag = "";
     }
 }