duanne9313 2017-07-31 02:39
浏览 60
已采纳

更改文本woocommerce迷你按钮

On our Staging-Site for ergotopia.de I am trying to change the button text of the dropdown minicart, like you see in picture. To reduce confusing: On ergotopia.de its the right text, but since updates (which we test on our Staging) it was changing the buttons text, and I am unable to change the text.

enter image description here

I tried the following things, without success:

  1. translations via loco-translate
  2. functions.php with following code:

    add_filter('gettext', 'translate_text'); add_filter('ngettext', 'translate_text');

    function translate_text($translated) { $translated = str_ireplace('Kasse', 'Weiter zur Kasse', $translated); return $translated; }

  3. In Child Theme (childtheme\woocommerce\includes\wc-template-functions.php) I edited the file in line 1487:

    function woocommerce_widget_shopping_cart_proceed_to_checkout() { echo '<a href="' . esc_url( wc_get_checkout_url() ) . '" class="button checkout wc-forward">' . esc_html__( 'Weiter zur Kasse', 'woocommerce' ) . '</a>'; }

Do you know how to change it?

  • 写回答

1条回答 默认 最新

  • doucai5315 2017-08-01 23:41
    关注

    SOLUTION: I had to add priority like

    add_filter('gettext', 'translate_text',999);
    add_filter('ngettext', 'translate_text',999);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度