xtCommerce 4.0: Enter direct debit data in confirmation mail

29.11.2017
by Meike Müller
E-Commerce
Banner

In the current xtCommerce 4.0 there is unfortunately no possibility to specify the bank details including all direct debit data directly in the confirmation email. This makes it easier to use the direct debit system, because you don't always have to log in to the store. If you need further information or help on the subject of e-commerce and online stores, we will be happy to help you.

THE FOLLOWING PIECE OF CODE WILL HELP:

File: xtFramework/classes/class.order.php


Function:function _sendOrderMail()

INSERT BEFORE:

($plugin_code = $xtPlugin->PluginCode('class.orders.php:_sendOrderMail_bottom')) ? eval($plugin_code) : false;
$ordermail->_sendMail();

ZU:

// get data for payment method banktransfer
if($this->order_data['payment_code'] == "xt_banktransfer")
{
$banktransfer_record = $db->Execute("SELECT orders_data FROM " . TABLE_ORDERS . " WHERE orders_id = '" . (int) $this->order_data['orders_id'] . "'");
$banktransfer_data = unserialize($banktransfer_record->fields['orders_data']);
$ordermail->_assign('banktransfer_owner',$banktransfer_data['banktransfer_owner']);
$ordermail->_assign('banktransfer_number',$banktransfer_data['banktransfer_number']);
$ordermail->_assign('banktransfer_bank_name',$banktransfer_data['banktransfer_bank_name']);
$ordermail->_assign('banktransfer_blz',$banktransfer_data['banktransfer_blz']);
$ordermail->_assign('banktransfer_iban',$banktransfer_data['banktransfer_iban']);
$ordermail->_assign('banktransfer_bic',$banktransfer_data['banktransfer_bic']);
}
($plugin_code = $xtPlugin->PluginCode('class.orders.php:_sendOrderMail_bottom')) ? eval($plugin_code) : false;
$ordermail->_sendMail();
 

Then in the email templates (Contents -> Email Manager) in template (send_order) add these lines:

{if $banktransfer_owner}
<h2>Direct debit</h2>.
<p>account holder: {$banktransfer_owner}<br/>
Bank name: {$banktransfer_bank_name}<br/>
Bank code: {$banktransfer_blz}<br/>
Account number: {$banktransfer_number}<br/>
Iban: {$banktransfer_iban}<br/>
Bic / Swift: {$banktransfer_bic}<br/></p><br />
{/if}

If everything goes smoothly, you now have the direct debit details in the confirmation email.

You are interested in e-commerce or run your own business online? Then feel free to check out our other blog articles on e-commerce!

Meike
Meike
from 29.11.2017

Hello, my name is Meike. I take care of the EXWE back office and am responsible for our social media channels. All of our articles are meant to make your life easier and help you make decisions. Nevertheless, it can happen that something remains unclear, so: If you have questions about this article you can easily reach me at +49 231 93149827.

Show all news (81)

We also have the following interesting posts from our tech blog for you on this topic
Website relaunch: How to prevent ranking loss

You want to keep your Google ranking during the website relaunch? Here you can learn everything about the perfect SEO relaunch and how to avoid SEO mistakes.

Google Analytics 4: We show you what you need to know

Google Analytics 4 - Our guide to switching to the new version GA4 Meta Description: Learn all about the new version and Enhanced E-Commerce Tracking with GA4.

What you need to know about direct-to-consumer business

Direct-to-consumer has some advantages for manufacturers. Find out why you should sell to the end customer yourself, which sales channels there are and more.




info@exwe.de
+49 231 93149827