Jump to content
xt:Commerce Community Forum

Lastschrift Bankdaten Kunden in neue Bestellung aus Datenbank


Recommended Posts

Gibt es die Möglichkeit bei "Lastschrift" (banktransfer) die bereits schon vorhanden Bankdaten aus der Datenbanktabelle banktransfer des jeweiligen Kunden für weitere Bestellungen automatisch in das Bestellformular (checkout_payment.php) übernehmen zu lassen damit der Kunde die Bankdaten nicht erneut eingeben muss ??

Danke

Gruß

xt:Commerce v3.0.4 SP2.1

Ich habe folgendes gefunden - funktioniert aber scheinbar nur beim xtcModified (Datei banktransfer.php im Verzeichnis root/includes/modules/payment)

function selection()

{

global $order;

$banktransfer_text='banktransfer_';

$banktransfer_blz_text=$banktransfer_text. 'blz';

$banktransfer_number_text=$banktransfer_text.'number';

$banktransfer_bankname_text=$banktransfer_text.'bankname';

$banktransfer_owner_text=$banktransfer_text.'owner';

$blz=$_GET[$banktransfer_blz_text];

$number=$_GET[$banktransfer_number_text];

$bankname=$_GET[$banktransfer_bankname_text];

$owner=$_GET[$banktransfer_owner_text];

$billing_name=trim($order->billing['firstname'] . ' ' . $order->billing['lastname']);

if (!$owner)

{

$owner=$billing_name;

}

if (

$_SESSION['customers_status']['customers_status_id']<>DEFAULT_CUSTOMERS_STATUS_ID_GUEST &&

$_SESSION['customer_country_id']==STORE_COUNTRY

)

{

$post_blz=$_POST[$banktransfer_blz_text];

$post_number=$_POST[$banktransfer_number_text];

$post_bankname=$_POST[$banktransfer_bankname_text];

$post_owner=$_POST[$banktransfer_owner_text];

if (!$post_owner)

{

$post_owner=$billing_name;

}

if ($post_blz && $post_number && $post_bankname && $post_owner)

{

//We are here apparently after a payment error => use posted data (if completely available),

//as it might differ from last payment data

$blz=$post_blz;

$number=$post_number;

$bankname=$post_bankname;

$owner=$post_owner;

}

else

{

//Try to find last order for customer with banktransfer payment and fetch bank data from there

$banktransfer_query = xtc_db_query("select bt.banktransfer_owner,bt.banktransfer_number, bt.banktransfer_bankname, bt.banktransfer_blz from banktransfer bt, orders o where o.customers_id=".$_SESSION['customer_id']." and o.orders_id=bt.orders_id LIMIT 1");

while ($bank_data=xtc_db_fetch_array($banktransfer_query))

{

$this_blz=$bank_data[$banktransfer_blz_text];

if ($this_blz)

{

$blz=$this_blz;

$number=$bank_data[$banktransfer_number_text];

$bankname=$bank_data[$banktransfer_bankname_text];

$owner=$bank_data[$banktransfer_owner_text];

}

}

}

}

$title_text='title';

$field_text='field';

$selection = array(

'id' => $this->code,

'module' => $this->title,

'description'=>$this->info,

'fields' => array(array(

$title_text => MODULE_PAYMENT_BANKTRANSFER_TEXT_NOTE,

$field_text => MODULE_PAYMENT_BANKTRANSFER_TEXT_BANK_INFO),

array(

$title_text => MODULE_PAYMENT_BANKTRANSFER_TEXT_BANK_OWNER,

$field_text => xtc_draw_input_field('banktransfer_owner', $owner,'size="50"')),

array(

$title_text => MODULE_PAYMENT_BANKTRANSFER_TEXT_BANK_BLZ,

$field_text => xtc_draw_input_field($banktransfer_blz_text,$blz, 'size="8" maxlength="8"')),

array(

$title_text => MODULE_PAYMENT_BANKTRANSFER_TEXT_BANK_NUMBER,

$field_text => xtc_draw_input_field($banktransfer_number_text, $number, 'size="16" maxlength="32"')),

array(

$title_text => MODULE_PAYMENT_BANKTRANSFER_TEXT_BANK_NAME,

$field_text => xtc_draw_input_field($banktransfer_bankname_text,$bankname,'size="50"')),

array(

$title_text => '',

$field_text => xtc_draw_hidden_field('recheckok', $_POST['recheckok']))

));

if (MODULE_PAYMENT_BANKTRANSFER_FAX_CONFIRMATION =='true')

{

$selection['fields'][] = array(

$title_text => MODULE_PAYMENT_BANKTRANSFER_TEXT_NOTE,

$field_text => MODULE_PAYMENT_BANKTRANSFER_TEXT_NOTE2 . '<a href="' . MODULE_PAYMENT_BANKTRANSFER_URL_NOTE .

'" target="_blank">' . MODULE_PAYMENT_BANKTRANSFER_TEXT_NOTE3 . '</a>' . MODULE_PAYMENT_BANKTRANSFER_TEXT_NOTE4);

$selection['fields'][] = array(

$title_text => MODULE_PAYMENT_BANKTRANSFER_TEXT_BANK_FAX,

$field_text => xtc_draw_checkbox_field('banktransfer_fax' , 'on'));

}

return $selection;

}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
  • Create New...