d.iandoli75 Posted March 15, 2019 Share Posted March 15, 2019 (edited) Hi to all, in this row I get the iso code of Billing Address Country: $fattura_invoice->appendChild($domtree->createElement('CustomerProvince', $state->iso_code)); I need to do the same thing but with Shipping Address Country I tried to add code like this: $fattura_invoice->appendChild($domtree->createElement('DeliveryProvince', $delivery_address->state->iso_code)); Whats wrong? Thanks to all Edited March 15, 2019 by d.iandoli75 (see edit history) Link to comment Share on other sites More sharing options...
d.iandoli75 Posted March 15, 2019 Author Share Posted March 15, 2019 I found a mistake in the lines and I Solved. here below the code BEFORE the solution: if (!empty($delivery_address->id_state)){ $state = new State($ga->id_state); // deve cercare l'indirizzo nel delivery_address $fattura_invoice->appendChild($domtree->createElement('DeliveryProvince', $state->iso_code)); here the code AFTER the solution: if (!empty($delivery_address->id_state)){ $state = new State($delivery_address->id_state); // deve cercare l'indirizzo nel delivery_address $fattura_invoice->appendChild($domtree->createElement('DeliveryProvince', $state->iso_code)); My snippet was checking the Object State in the wrong instance. hope this helps someone Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now