Hello. Back again with bug
-
Hello, you code have a bug in 2 latest versions..
I fixed him before but i can’t do that again and again.Please fix that:
You Code
`/**
* Get formatted company address.
*
* @return string
*/
public function get_formatted_company_address() {
$company_phone = self::get_option( ‘template’, ‘company_phone’ );
$company_email_address = self::get_option( ‘template’, ‘company_email_address’ );
$company_registration_number = self::get_option( ‘template’, ‘company_registration_number’ );
$company_vat_id = self::get_option( ‘template’, ‘company_vat_id’ );if ( BEWPI_WC_Core_Compatibility::is_wc_version_gte_3_0() ) {
$formatted_company_address = self::get_formatted_base_address();
} else {
$formatted_company_address = nl2br( self::get_option( ‘template’, ‘company_address’ ) ) . ‘<br>’;
}if ( ! empty( $company_phone ) ) {
$formatted_company_address .= sprintf( __( ‘Phone: %s’, ‘woocommerce-pdf-invoices’ ), $company_phone ) . ‘<br>’;
}if ( ! empty( $company_email_address ) ) {
$formatted_company_address .= sprintf( __( ‘Email: %s’, ‘woocommerce-pdf-invoices’ ), $company_email_address ) . ‘<br>’;
}if ( ! empty( $company_registration_number ) ) {
$formatted_company_address .= sprintf( __( ‘CRN: %s’, ‘woocommerce-pdf-invoices’ ), $company_registration_number ) . ‘<br>’;
}if ( ! empty( $company_vat_id ) ) {
$formatted_company_address .= sprintf( __( ‘VAT ID: %s’, ‘woocommerce-pdf-invoices’ ), $company_vat_id );
}return $formatted_company_address;
}MY CODE
/**
* Formatted company details.
*
* @return string
*/
public function get_formatted_company_details() {
$formatted_company_details = ”;
$company_phone = self::get_option( ‘template’, ‘company_phone’ );
$company_email_address = self::get_option( ‘template’, ‘company_email_address’ );
$company_registration_number = self::get_option( ‘template’, ‘company_registration_number’ );
$company_vat_id = self::get_option( ‘template’, ‘company_vat_id’ );if ( ! empty( $company_phone ) ) {
$formatted_company_details .= sprintf( __( ‘%s’, ‘woocommerce-pdf-invoices’ ), $company_phone ) . ‘<br>’;
}if ( ! empty( $company_email_address ) ) {
$formatted_company_details .= sprintf( __( ‘%s’, ‘woocommerce-pdf-invoices’ ), $company_email_address ) . ‘<br>’;
}if ( ! empty( $company_registration_number ) ) {
$formatted_company_details .= sprintf( __( ‘CRN: %s’, ‘woocommerce-pdf-invoices’ ), $company_registration_number ) . ‘<br>’;
}if ( ! empty( $company_vat_id ) ) {
$formatted_company_details .= sprintf( __( ‘VAT ID: %s’, ‘woocommerce-pdf-invoices’ ), $company_vat_id );
}return $formatted_company_details;
}READ THAT
https://www.ads-software.com/support/topic/roll-back-to-version-3-0-11/
- The topic ‘Hello. Back again with bug’ is closed to new replies.