Skip to content
This repository has been archived by the owner on May 24, 2021. It is now read-only.

Changes Thirdparty #90

Open
logach opened this issue Oct 2, 2016 · 2 comments
Open

Changes Thirdparty #90

logach opened this issue Oct 2, 2016 · 2 comments

Comments

@logach
Copy link

logach commented Oct 2, 2016

$ref = get_user_meta( $user_id, 'billing_company', true );
$individual = 0;
if ( '' === $ref ) {
// We could not find a company, let's get an indivual
// Completamos el nombre completo, no solo el apellido.
// First Change....
$ref = get_user_meta( $user_id, 'billing_first_name', true )." ".get_user_meta( $user_id, 'billing_last_name', true );
$individual = 1;
}

    $new_thirdparty = new Dolibarr_Thirdparty();

    $new_thirdparty->ref        = $ref; // Company name or individual last name
    $new_thirdparty->individual = $individual; // Individual
    //
     // Enviamos Tambien el Nombre completo del cliente
     //  Second Change
    $new_thirdparty->firstname = get_user_meta( $user_id, 'billing_first_name', true )." ".get_user_meta( $user_id, 'billing_last_name', true );
    $new_thirdparty->status    = '1'; // Active
    $new_thirdparty->client    = '1'; // Is a client
    $new_thirdparty->supplier  = '0'; // Is not a supplier
    //
     // Para la direccion esta el billing_address_1 en las nuevas versiones
     // woocommerce 2.6.3
     // and last Change 
    $new_thirdparty->address = get_user_meta( $user_id, 'billing_address_1', true );
    $new_thirdparty->zip = get_user_meta( $user_id, 'billing_postcode', true );
    $new_thirdparty->town = get_user_meta( $user_id, 'billing_city', true );
    $new_thirdparty->country_code = get_user_meta( $user_id, 'billing_country', true );
    $new_thirdparty->phone = get_user_meta( $user_id, 'billing_phone', true );
    $new_thirdparty->email = get_user_meta( $user_id, 'billing_email', true );
@rdoursenaud
Copy link
Member

Sorry, I don't understand what it is. Please explain!

@logach
Copy link
Author

logach commented Oct 3, 2016

all right

when he checkout is not still realized the screen was blank and did not follow,
revising create the thirdparty and put the billing_address
He failed because the code had billing_address and was
billing_address_1, change it and it worked well

The rest is just for convenience because it creates thirdparty
with last name and I've put the full name.

Could you guide me what the import of images from the dolibarr.

best regards

2016-10-03 7:59 GMT-03:00 Raphaël Doursenaud notifications@github.com:

Sorry, I don't understand what it is. Please explain!


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#90 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AApJNU8HQU55hMPBrs-nZkhS4okU7bUKks5qwN_6gaJpZM4KMCnz
.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants