我想配置位于我的 woocommerce 帐户页面中的订阅端点?

I want to configure the subscription endpoint located in my account page of woocommerce?

我想要的是在我的 woocommerce 帐户页面中编辑订阅。我在下面分享了一张图片,其中包含我想要编辑的内容。

这是图片link,我要编辑的用红笔高亮显示:

我想编辑用红笔突出显示的内容。但我无法找到我可以编辑内容的确切页面。 实际上我想更改订阅 table 中更新按钮的 link。 页面的 URL 就像:

https://www.example.com/my-account/subscriptions/ wordpress 的页面菜单中没有订阅页面。

我也无法在 woocommerce 端点看到这个。

有什么办法吗?

首先看一下:Template structure & Overriding templates via a theme…它解释了如何通过您的活动主题正确覆盖 woocommerce 模板。

您要覆盖的模板必须位于主题文件夹内的 woocommerce 文件夹中……

现在在 woocommerce-subscriptions 插件文件夹中,您还有一个模板文件夹,您可以选择需要更改的必要模板,将它们复制到主题中的 woocommerce 文件夹中,注意保持路径(子文件夹层次结构)…

所以你将从:wp-content/plugins/woocommerce-subscriptions/templates/myaccount(里面有5个文件)...复制到wp-content/themes/your-theme/woocommerce/myaccount(其中your-theme是文件夹名称你的主题)…

现在您可以像 woocommerce 一样编辑模板了……

The subscription end point is not listed in woocommerce as it's not a default end point

要重命名 "Subscriptions" 的菜单标签,您可以使用:

add_filter( 'woocommerce_account_menu_items', 'rename_my_account_menu_items', 0, 15 );
function rename_my_account_menu_items( $items ) {

    // HERE set your new label name for subscriptions
    $items['subscriptions'] = __( 'Custom label', 'woocommerce' );

    return $items;
}

代码在您的活动子主题(或主题)的 function.php 文件或任何插件文件中。

已测试并正常工作