#!/usr/bin/php billing_type != "sepa") { continue; } if($order->billingaddress_id) { $address = new Address($order->billingaddress_id); } elseif($order->owner_id) { $address = new Address($order->owner_id); } else { echo "No owner or billing contact found for Order ".$order->id."\n"; continue; } if(!$address->id) { echo "Address ".$order->billingaddress_id." not found\n"; continue; } if($address->bank_account_bank || $address->bank_account_owner || $address->bank_account_iban || $address->bank_account_bic) { echo "Billingaddress ".$address->company." ".$address->firstname." ".$address->lastname." (".$address->id.") has bank data set already. Not updating...\n"; continue; } $address->billing_type = $order->billing_type; $address->bank_account_bank = $order->bank_account_bank; $address->bank_account_owner = $order->bank_account_owner; $address->bank_account_iban = $order->bank_account_iban; $address->bank_account_bic = $order->bank_account_bic; //var_dump($address); $address->save(); $i++; } echo "Updated $i addresses with bank account data.\n";