Skip to Content Skip to Menu

Adress of cb user in paypal

  • m-2013
  • m-2013
  • OFFLINE
  • Posts: 1
  • Thanks: 0
  • Karma: 0
11 years 4 months ago - 11 years 4 months ago #228556 by m-2013
Adress of cb user in paypal was created by m-2013
Hello, in advance sorry for my English...

I use community builder for user accounts + a shop with hikashop. After order on the paypal payment page, the address of the user can be automatically rewritten. and I hope this will be the address with the fields that I have created in community builder. How to rewrite the following function which call the address of the user hikashop for it call the first name, last name and address of the user created with fiels in community builder? Thanks.

if(!empty($method->payment_params->address_type)){
$address_type = $method->payment_params->address_type.'_address';
$app =& JFactory::getApplication();
$address=$app->getUserState( HIKASHOP_COMPONENT.'.'.$address_type);
if(!empty($address)){
if(!isset($method->payment_params->address_override)){
$method->payment_params->address_override = '1';
}
$vars["address_override"]=$method->payment_params->address_override;
$cart = hikashop_get('class.cart');
$cart->loadAddress($order->cart,$address,'object',$method->payment_params->address_type);
$vars["first_name"]=@$order->cart->$address_type->address_firstname;
$vars["last_name"]=@$order->cart->$address_type->address_lastname;
$address1 = '';
$address2 = '';
if(!empty($order->cart->$address_type->address_street2)){
$address2 = substr($order->cart->$address_type->address_street2,0,99);
}
if(!empty($order->cart->$address_type->address_street)){
if(strlen($order->cart->$address_type->address_street)>100){
$address1 = substr($order->cart->$address_type->address_street,0,99);
if(empty($address2)) $address2 = substr($order->cart->$address_type->address_street,99,199);
}else{
$address1 = $order->cart->$address_type->address_street;
}
}
$vars["address1"]=$address1;
$vars["address2"]=$address2;
$vars["zip"]=@$order->cart->$address_type->address_post_code;
$vars["city"]=@$order->cart->$address_type->address_city;
$vars["state"]=@$order->cart->$address_type->address_state->zone_code_2;
$vars["country"]=@$order->cart->$address_type->address_country->zone_code_2;
$vars["email"]=$user->user_email;
$vars["night_phone_b"]=@$order->cart->$address_type->address_telephone;
}elseif(!empty($order->cart->billing_address->address_country->zone_code_2)){
$vars["lc"]=$order->cart->billing_address->address_country->zone_code_2;
}
Last edit: 11 years 4 months ago by m-2013.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum