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

时间:2017-12-05 19:36:16

标签: php wordpress woocommerce account woocommerce-subscriptions

我想要的是在我的woocommerce帐户页面中编辑订阅。我已经在下面分享了一张我想要编辑的内容。

这是图片的链接,我要编辑的内容用红笔突出显示:

This is the link of picture, what i want to edit is highlighted with red pen

我想编辑用红笔突出显示的内容。但我无法找到我可以编辑的东西的确切页面。 实际上我想更改订阅表中更新按钮的链接。 页面的URL如下:

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

我也无法在woocommerce的终点中看到这一点。

These are the end points

有什么办法吗?

1 个答案:

答案 0 :(得分:0)

首先看看: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是您主题的文件夹名称)... < / p>

现在您可以像编辑艺术品一样编辑模板......

  

订阅终点未在woocommerce中列出,因为它不是默认终点

要重命名“订阅”的菜单标签,您可以使用:

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文件中或任何插件文件中。

经过测试和工作