【问题标题】:Hiding element (row) in woocommerce account pagewoocommerce 帐户页面中的隐藏元素(行)
【发布时间】:2020-12-10 11:34:30
【问题描述】:

我想在 woocommerce 的帐户页面的表格中隐藏一行。此项目在表 class= shop_table subscription_details 中称为“结束”或“结束日期”。

https://github.com/wp-premium/woocommerce-subscriptions/blob/master/templates/myaccount/subscription-details.php

CSS sn-p 怎么办?

【问题讨论】:

  • 这个问题需要您提供更多关于输出标记是什么样子的输入。基于此,可以考虑 CSS 规则。

标签: php css wordpress woocommerce


【解决方案1】:

您不应该使用 CSS 来隐藏它,而是在您的子主题中替换模板。 Woocommerce 使用模板系统,允许干净地修改其插件或自身的模板。

在您的子主题中创建文件夹“woocommerce/myaccount”并从插件中复制subscription-details.php。

然后您将拥有以下路径:

/themes/yourtheme/woocommerce/myaccount/subscription-details.php

来源:https://docs.woocommerce.com/document/template-structure/

然后编辑这个文件并删除这一行:

    'end'                     => _x( 'End date', 'customer subscription table header', 'woocommerce-subscriptions' ),

所以你将拥有:

$dates_to_display = apply_filters( 'wcs_subscription_details_table_dates_to_display', array(
    'start_date'              => _x( 'Start date', 'customer subscription table header', 'woocommerce-subscriptions' ),
    'last_order_date_created' => _x( 'Last order date', 'customer subscription table header', 'woocommerce-subscriptions' ),
    'next_payment'            => _x( 'Next payment date', 'customer subscription table header', 'woocommerce-subscriptions' ),
    'trial_end'               => _x( 'Trial end date', 'customer subscription table header', 'woocommerce-subscriptions' ),
), $subscription );

它应该可以解决问题

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-05-08
    • 1970-01-01
    • 1970-01-01
    • 2020-06-06
    • 2021-01-17
    • 1970-01-01
    • 2014-06-10
    • 2019-09-17
    相关资源
    最近更新 更多