/** * Generate Sender part invoice template * @return Ambigous <string, string> */ public static function generate_invoice_sender_part() { $output = ''; $company = get_option('wpshop_company_info', array()); $emails = get_option('wpshop_emails', array()); if (!empty($company)) { $tpl_component['COMPANY_EMAIL'] = !empty($emails) && !empty($emails['contact_email']) ? $emails['contact_email'] : ''; $tpl_component['COMPANY_WEBSITE'] = get_option('siteurl'); foreach ($company as $company_info_key => $company_info_value) { switch ($company_info_key) { case 'company_rcs': $data = !empty($company_info_value) ? __('RCS', 'wpshop') . ' : ' . $company_info_value : ''; break; case 'company_capital': $data = !empty($company_info_value) ? __('Capital', 'wpshop') . ' : ' . $company_info_value : ''; break; case 'company_siren': $data = !empty($company_info_value) ? __('SIREN', 'wpshop') . ' : ' . $company_info_value : ''; break; case 'company_siret': $data = !empty($company_info_value) ? __('SIRET', 'wpshop') . ' : ' . $company_info_value : ''; break; case 'company_tva_intra': $data = !empty($company_info_value) ? __('TVA Intracommunautaire', 'wpshop') . ' : ' . $company_info_value : ''; break; case 'company_legal_statut': $array_state_compagny = wpshop_company_options::get_legal_status(); $data = !empty($array_state_compagny) && !empty($array_state_compagny[$company_info_value]) ? $array_state_compagny[$company_info_value] : __('Auto-Entrepreneur', 'wpshop'); break; default: $data = $company_info_value; break; } $tpl_component[strtoupper($company_info_key)] = $data; } $output = wpshop_display::display_template_element('invoice_sender_formatted_address', $tpl_component, array(), 'common'); } return $output; }