HTML Zeile zu BACS hinzufügen
-
Hallo zusammen!
Ich soll bei der Bankverbindungs-Email eine Zeile mit „Bitte bei Bezahlung die Bestellnummer sowie Datum der Veranstaltung angeben!“ hinzufügen.
Ich habe es in derclass-wc-gateways-bacs.php
mit folgendem Code probiert:/** * Get bank details and place into a list format. * * @param int $order_id Order ID. */ private function bank_details( $order_id = '' ) { if ( empty( $this->account_details ) ) { return; } // Get order and store in $order. $order = wc_get_order( $order_id ); // Get the order country and country $locale. $country = $order->get_billing_country(); $locale = $this->get_country_locale(); // Get sortcode label in the $locale array and use appropriate one. $sortcode = isset( $locale[ $country ]['sortcode']['label'] ) ? $locale[ $country ]['sortcode']['label'] : __( 'Sort code', 'woocommerce' ); $bacs_accounts = apply_filters( 'woocommerce_bacs_accounts', $this->account_details ); if ( ! empty( $bacs_accounts ) ) { $account_html = ''; $has_details = false; foreach ( $bacs_accounts as $bacs_account ) { $bacs_account = (object) $bacs_account; if ( $bacs_account->account_name ) { $account_html .= '<h3 class="wc-bacs-bank-details-account-name">' . wp_kses_post( wp_unslash( $bacs_account->account_name ) ) . ':</h3>' . PHP_EOL; } $account_html .= '<ul class="wc-bacs-bank-details order_details bacs_details">' . PHP_EOL; // BACS account fields shown on the thanks page and in emails. $account_fields = apply_filters( 'woocommerce_bacs_account_fields', array( 'bank_name' => array( 'label' => __( 'Bank', 'woocommerce' ), 'value' => $bacs_account->bank_name, ), 'account_number' => array( 'label' => __( 'Account number', 'woocommerce' ), 'value' => $bacs_account->account_number, ), 'sort_code' => array( 'label' => $sortcode, 'value' => $bacs_account->sort_code, ), 'iban' => array( 'label' => __( 'IBAN', 'woocommerce' ), 'value' => $bacs_account->iban, ), 'bic' => array( 'label' => __( 'BIC', 'woocommerce' ), 'value' => $bacs_account->bic, ), ), $order_id ); foreach ( $account_fields as $field_key => $field ) { if ( ! empty( $field['value'] ) ) { $account_html .= '<li class="' . esc_attr( $field_key ) . '">' . wp_kses_post( $field['label'] ) . ': <strong>' . wp_kses_post( wptexturize( $field['value'] ) ) . '</strong></li>' . PHP_EOL; $has_details = true; } } $account_html .= '</ul>'; echo "<strong>Bitte bei Bezahlung die Bestellnummer sowie Datum der Veranstaltung angeben!<strong>"; } if ( $has_details ) { echo '<section class="woocommerce-bacs-bank-details"><h2 class="wc-bacs-bank-details-heading">' . esc_html__( 'Our bank details', 'woocommerce' ) . '</h2>' . wp_kses_post( PHP_EOL . $account_html ) . '</section>'; } } }
Offensichtlich funktioniert der nicht… Ich frage mich nur, warum? Der Text wird in der E-Mail nicht ausgegeben…
Ansicht von 5 Antworten - 1 bis 5 (von insgesamt 5)
Ansicht von 5 Antworten - 1 bis 5 (von insgesamt 5)
- Das Thema „HTML Zeile zu BACS hinzufügen“ ist für neue Antworten geschlossen.