I have this situation - I made changes to one of the woocommerce email templates, but I'm sure that these changes will be lost after the next woocommerce update.
As I know, I have to use theme functions to get around this problem.
This is the code before changing:
echo '<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( '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'] ) ) { echo '<li class="' . esc_attr( $field_key ) . '">' . esc_attr( $field['label'] ) . ': <strong>' . wptexturize( $field['value'] ) . '</strong></li>' . PHP_EOL; } } echo '</ul>';
Here is the code for the user account field that I want to insert:
'merkis' => array( 'label' => $merkis, 'value' => $pasutijums )
How can I insert my own code without overriding this main file?
thanks
source share