-
' . $this->get_usage_data( $iccid ) . '
-
' . $this->get_qr_and_manual_tabs( $iccid ) . '
fetch_option( \Airalo\Admin\Settings\Option::LANGUAGE ); $translations = file_get_contents( __DIR__ . '../../../languages/translations.json' ); $this->translations = json_decode( $translations, true ); $this->language_texts = $this->translations[$language]; $this->enqueue_assets(); } public function enqueue_assets() { wp_enqueue_style( 'my-esim-page-style', plugin_dir_url( __FILE__ ) . '../../assets/css/myEsimPageStyle.css', [], AIRALO_PLUGIN_VERSION ); wp_enqueue_script( 'my-esim-page-script', plugin_dir_url( __FILE__ ) . '../airalo-js/my_esim_page.js', [], AIRALO_PLUGIN_VERSION, true ); } /** * @param string $text * @return string */ private function t( string $text ) { return $this->language_texts[$text] ?? $text; } /** * @return string */ public function build_html() { $all_orders_details = ( new \Airalo\User\MySimsDetails() )->get_all_user_order_details(); if ( empty( $all_orders_details ) ) { return '
' . $this->t( 'my.esims.no.esims' ) . '
' . $esim['sim_name'] . '
'; if ( strpos( $current_url_path, '?' ) === false ) { $current_url_path = rtrim( $current_url_path, '/' ); $iccid_slug = '?iccid=' . $esim['iccid']; } else { $iccid_slug = '&iccid=' . $esim['iccid']; } $esim_list[] = '' . $sim_name_element . ''; } return '' . $this->t('my.esims.coverage') . '
' . ( $data_usage_item['sim_name'] ?? null ) . '
' . $this->t('my.esims.iccid') . '
' . ( $data_usage_item['iccid'] ?? null ) . '
' . $this->t('my.esims.package') . '
' . ( $data_usage_item['coverage'] ?? null ) . '
' . $this->t('my.esims.package') . '
' . $data_usage_item['status'] . '
' . $this->t('my.esims.date') . '
' . $data_usage_item['expired_at'] . '
' . $this->t('my.esims.package.valid') . '
' . implode( ' ', [$validity_and_data[1], $validity_and_data[2]] ) . '
' . $this->t('my.esims.package.data') . '
' . implode( ' ', [$validity_and_data[3], $validity_and_data[4]] ) . '
' . $this->t('my.esims.remaining-data') . '
' . $remaining_data . ' GB
' . $this->t( 'my.esims.select-platform' ) . '
' . $this->t( 'my.esims.select-device' ) . '
' . $this->t( 'my.esims.installation-instructions' ) . '
' . $this->t( 'my.esims.installation.instructions.description' ) . '
' . $this->t( 'my.esims.installation.manual.sm.dp.activation' ) . '