从Woocommerce谢谢页面上的下载表中更改列标题 [英] Change column titles from downloads table on Woocommerce Thankyou page

查看:50
本文介绍了从Woocommerce谢谢页面上的下载表中更改列标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试修改WooCommerce收到的订单(谢谢)页面上可下载产品的列标题.

I've been trying to modify the column title of downloadable products on WooCommerce Order received (Thank you) page.

具体来说,下载产品"柱子.它将具有标题产品".我正在尝试将其更改为其他内容.

Specifically the "download-product" column. It will have the header 'Product'. I'm trying to change it to something else.

我已经能够删除该表的剩余到期和下载,但我还无法弄清楚如何修改每一列的标题.

I've already been able to remove the Expires and Downloads remaining segments of the table but I haven't been able to figure out how to modify the titles of each column.

任何建议将不胜感激.

推荐答案

以下内容将允许您在下载表上更改列标签"Product"(产品),到谢谢"页面中的其他内容:

The following will allow you to change on downloads table the column label "Product" to something else in Thankyou page:

// Change downloads specific column label name
add_filter( 'woocommerce_account_downloads_columns', 'filter_wc_account_downloads_columns' );
function filter_wc_account_downloads_columns( $columns ) {
    // Targeting Thankyou page only
    if ( is_wc_endpoint_url( 'order-received' ) ) {
        $columns['download-product'] = __( 'Name', 'woocommerce' );
    }
    return $columns;
}

代码进入您的活动子主题(或活动主题)的functions.php文件中.经过测试,可以正常工作.

Code goes in functions.php file of your active child theme (or active theme). Tested and works.

相关:在Woocommerce上显示产品图片我的帐户下载部分

这篇关于从Woocommerce谢谢页面上的下载表中更改列标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆