php - 限制 Content Pro 展开发票详细信息
问题描述
我正在寻找有关如何使用 Restrict Content Pro Wordpress 插件扩展发票详细信息的建议。我不确定如何在发票上显示订阅级别的细分。我已经通过他们的代码解决了这个问题。我已经附上了invoice.php,我该如何解决这个问题?
我的难题:我的订阅费是 295 美元。细分为:会员费 - 195 美元,保险单 - 100 美元。我只需要显示故障,它可能非常简单。
我确实尝试只放置一个 ul 标签,然后用 li 标签列出细分。但是,这会引起混乱,因为它会显示所有具有不同级别的发票。
发票代码:
<body>
<div id="main">
<header id="header">
<!-- Logo -->
<div class="logo">
<?php if ( ! empty( $rcp_options['invoice_logo'] ) ) : ?>
<img src="<?php echo esc_attr( $rcp_options['invoice_logo'] ); ?>" />
<?php endif; ?>
</div>
<!-- Invoice Details -->
<div class="alignright">
<h1><?php printf( __( 'Invoice %s', 'rcp' ), $rcp_payment->id ); ?> </h1>
</div>
<?php if( ! empty( $rcp_options['invoice_header'] ) ) : ?>
<p><?php echo $rcp_options['invoice_header']; ?></p>
<?php endif; ?>
</header>
<section id="contacts">
<div class="alignleft">
<header><?php printf( __( 'Invoice %s', 'rcp' ), $rcp_payment->id ); ?></header>
<article>
<?php if ( ! empty( $rcp_options['invoice_company'] ) ) : ?>
<p><strong><?php echo $rcp_options['invoice_company']; ?></strong></p>
<?php endif; ?>
<?php if ( ! empty( $rcp_options['invoice_name'] ) ) : ?>
<p><strong><?php echo $rcp_options['invoice_name']; ?></strong></p>
<?php endif; ?>
<?php if ( ! empty( $rcp_options['invoice_address'] ) ) : ?>
<p><strong><?php echo $rcp_options['invoice_address']; ?></strong></p>
<?php endif; ?>
<?php if ( ! empty( $rcp_options['invoice_address_2'] ) ) : ?>
<p><strong><?php echo $rcp_options['invoice_address_2']; ?></strong></p>
<?php endif; ?>
<?php if ( ! empty( $rcp_options['invoice_city_state_zip'] ) ) : ?>
<p><strong><?php echo $rcp_options['invoice_city_state_zip']; ?></strong></p>
<?php endif; ?>
<?php if ( ! empty( $rcp_options['invoice_email'] ) ) : ?>
<p><strong><?php echo $rcp_options['invoice_email']; ?></strong></p>
<?php endif; ?>
</article>
</div>
<div class="alignright">
<header><?php _e( 'Bill To:', 'rcp' ); ?></header>
<article>
<p><strong><?php echo $rcp_member->first_name . ' ' . $rcp_member->last_name; ?></strong></p>
<p><strong><?php echo $rcp_member->user_email; ?></strong></p>
<?php
/**
* Insert content after the member's name and email.
*
* @param object $rcp_payment Payment object from the database.
* @param RCP_Member $rcp_member Member object.
*/
do_action( 'rcp_invoice_bill_to', $rcp_payment, $rcp_member );
?>
</article>
</div>
</section>
<!-- Items -->
<section id="items">
<header><?php _e( 'Invoice Items:', 'rcp' ); ?></header>
<table>
<tbody>
<tr>
<td class="name"><?php echo $rcp_payment->subscription; ?></td>
<td class="price"><?php echo rcp_currency_filter( $rcp_payment->amount ); ?></td>
</tr>
<?php do_action( 'rcp_invoice_items', $rcp_payment ); ?>
</tbody>
<tfoot>
<?php do_action( 'rcp_invoice_items_before_total_price', $rcp_payment ); ?>
<!-- Total -->
<tr>
<td class="name"><?php _e( 'Total Price:', 'rcp' ); ?></td>
<td class="price"><?php echo rcp_currency_filter( $rcp_payment->amount ); ?></td>
</tr>
<!-- Paid -->
<tr>
<td class="name"><?php _e( 'Payment Status:', 'rcp' ); ?></td>
<td class="price"><?php echo rcp_get_payment_status_label( $rcp_payment ); ?></td>
</tr>
</tfoot>
</table>
</section>
<!-- Additional Info -->
<section id="additional-info">
<div class="alignleft">
<header><?php _e( 'Additional Info:', 'rcp' ); ?></header>
<article>
<p><?php echo __( 'Payment Date:', 'rcp' ) . ' ' . date_i18n( get_option( 'date_format' ), strtotime( $rcp_payment->date, current_time( 'timestamp' ) ) ); ?></p>
</article>
<?php if( ! empty( $rcp_options['invoice_notes'] ) ) : ?>
<article>
<?php echo wpautop( wp_kses_post( $rcp_options['invoice_notes'] ) ); ?>
</article>
<?php endif; ?>
<?php do_action( 'rcp_invoice_additional_info', $rcp_payment ); ?>
</div>
</section>
<?php do_action( 'rcp_invoice_after_additional_info', $rcp_payment ); ?>
<footer id="footer">
<?php if( ! empty( $rcp_options['invoice_footer'] ) ) : ?>
<p><?php echo $rcp_options['invoice_footer']; ?></p>
<?php endif; ?>
<p class="print alignright"><a href="#" onclick="window.print()"><?php _e( 'Print', 'rcp' ); ?></a></p>
</footer>
</div>
解决方案
推荐阅读
- c# - c#打开批处理文件但不执行.bat中的VBScript
- c# - ElasticSearch 简单示例不起作用 c#
- ckeditor - 带有 XPage 的 CKEditor 仅显示 1 行 HTML / DXL 代码
- docker - 在 docker 中执行用户 cron 作业的问题
- sas - SAS substr 合并
- android - 谷歌地图GroundOverlays默认情况下是否具有抗锯齿功能?
- c# - 如何使用 HttpClient 调用具有自定义安全性(非 SOAP)的 SSRS Rest-Api V2.0
- react-native - iOS 设备上的网络请求失败 || 反应原生 || 世博会
- google-colaboratory - 尝试将文件从 Google Drive 复制到 Google Colab 时出现输入/输出错误
- c# - 如何在 kibana 中将日志设置为 ELK,并使用 serilog 进行身份验证