【发布时间】:2015-01-03 18:17:29
【问题描述】:
我是 woocommerce 和 wordpress 的新手,我想要实现的是在感谢页面上仅显示可下载产品的说明。
可能是我错了,但我有这个文件,我正在查看woocommerce->templates->order->order-details.php,它有以下代码在谢谢页面上输出下载链接(我假设我找不到另一个文件这份工作)。
if ( $_product && $_product->exists() && $_product->is_downloadable() && $order->is_download_permitted() ) {
echo 'Click the links below to access your courses. You will also receive an email shortly with the links to download your products.';
$download_files = $order->get_item_downloads( $item );
$i = 0;
$links = array();
foreach ( $download_files as $download_id => $file ) {
$i++;
$links[] = '<small style="font-size: 15pt !important;"><a href="' . esc_url( $file['download_url'] ) . '">' . sprintf( __( 'Download file%s', 'woocommerce' ), ( count( $download_files ) > 1 ? ' ' . $i . ': ' : ': ' ) ) . esc_html( $file['name'] ) . '</a></small>';
}
echo '<br/>' . implode( '<br/>', $links );
}
现在我只想在此处回显可下载产品的文本。但它不显示文本。
我要回显的文字如下红色箭头所指的地方
点击下面的链接访问您的课程。您还将很快收到一封电子邮件,其中包含下载您的产品的链接。;
如果有人能在这方面帮助我,我将不胜感激。
【问题讨论】:
-
产品的链接是否出现在该页面上?
-
@mevius 如果有帮助,我已经用屏幕截图更新了我的问题
-
您想在哪里打印该消息?进那张桌子?
-
看起来您可能正在编辑错误的模板...
-
@Rohil_PHPBeginner 就在表格内“产品”的下方
标签: php wordpress woocommerce