【发布时间】:2015-04-02 10:15:38
【问题描述】:
我正在使用 WooCommerce Print Invoice & Packing List 插件和 Woocommerce 来打印发票。我需要在发票中打印产品的常规价格。请帮助。
谢谢!
【问题讨论】:
标签: woocommerce invoice
我正在使用 WooCommerce Print Invoice & Packing List 插件和 Woocommerce 来打印发票。我需要在发票中打印产品的常规价格。请帮助。
谢谢!
【问题讨论】:
标签: woocommerce invoice
让这个工作 将以下代码添加到您的 invoice.php -
$item['product']->regular_price
【讨论】:
要将常规价格添加到每种产品的发票中,只需将以下代码添加到您的 invoice.php 文件中,就在 SKU 的 dl 标记下方。
在我的示例中,我将其标记为“单价”。如果您愿意,请随意更改。
<dl class="meta">
<?php $description_label = __( 'Unit Price', 'wpo_wcpdf' ); // registering alternate label translation ?>
<?php if( !empty( $item['product']->regular_price ) ) : ?><dt class="sku"><?php _e( 'Unit Price:', 'wpo_wcpdf' ); ?></dt><dd class="sku"><?php echo $item['product']->regular_price; ?></dd><?php endif; ?>
</dl>
【讨论】: