GPCsolutions / doliwoo

Dolibarr WooCommerce integration
https://gpcsolutions.github.io/doliwoo
39 stars 35 forks source link

Changes Thirdparty #90

Open logach opened 7 years ago

logach commented 7 years ago

$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 commented 7 years ago

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

logach commented 7 years ago

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 https://github.com/GPCsolutions/doliwoo/issues/90#issuecomment-251079391, or mute the thread https://github.com/notifications/unsubscribe-auth/AApJNU8HQU55hMPBrs-nZkhS4okU7bUKks5qwN_6gaJpZM4KMCnz .