drb56625 2017-12-05 11:36
浏览 160
已采纳

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

What i want is to edit a subscription in my account page of woocommerce. i have shared a picture below, of what exactly I want to edit.

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

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

I want to edit the things which are highlighted with red pen. but i am unable to locate the exact page of this where i can edit things. actually i want to change the link of update button in subscription table. the URL of the page is like :

https://www.example.com/my-account/subscriptions/ There is no subscription page in pages menu of wordpress.

I am also unable to see this in endpoint of woocommerce.

These are the end points

Is there any way to do it ?

  • 写回答

1条回答 默认 最新

  • dounei9043 2017-12-05 12:30
    关注

    First have a look to that: Template structure & Overriding templates via a theme… It explains how to override correctly woocommerce templates via your active theme.

    The templates that you will override have to be located in woocommerce folder inside your theme folder…

    Now in the woocommerce-subscriptions plugin folder, you have also a template folder, and you can pick the necessary templates that you need to change, copying them into that woocommerce folder located in your theme, taking care to keep path (subfolder hierarchy)…

    So you will copy from: wp-content/plugins/woocommerce-subscriptions/templates/myaccount(5 files inside)… to wp-content/themes/your-theme/woocommerce/myaccount (where your-theme is the folder name of your theme)…

    Now you can edit templates just like the woocommerce ones…

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

    To rename the menu label for "Subscriptions", you can use this:

    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;
    }
    

    The code goes on function.php file of your active child theme (or theme) or in any plugin file.

    Tested and working

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

悬赏问题

  • ¥15 51单片机最小开发板系统,想让寻迹小车在全检测到黑线(寻迹模块代码在第一块板子上)时蜂鸣器响(在第二块板子上)
  • ¥15 pbootcms多选调用成列表
  • ¥15 51单片机oled显示时钟
  • ¥15 小规模TSP问题的动态规划求解
  • ¥25 kubelet.service: Failed with result 'exit-code'.
  • ¥15 bitvise黑框内一键部署v2ray提示账户没有root怎么解决
  • ¥15 车型识别以及相似度匹配中细节特征提取以及图像模糊问题
  • ¥15 怎么用鸿蒙的ArkTs写出来啊
  • ¥30 websocket服务端多线程通信
  • ¥15 JNA 方法调用.dll异常
手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部