我想在woocommerce的帐户表页面中隐藏一行。此项目在表class = shop_table subscription_details中称为'end‘或'end date’。
我怎么才能做到这一点将CSS片段?
发布于 2020-12-10 20:28:01
您不应该使用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 );它应该能起到作用
https://stackoverflow.com/questions/65233725
复制相似问题