跳到内容 跳到侧边栏

標籤: 

本主题包含 0 則回覆 ,有 0 声音 。

最后由 hagenD 1 year, 2 months前 更新。

协助者:: Mihai Apetrei.

作者 帖子
2025 年 1 月 30 日 于 下午 12:18

hagenD

Background of the issue:
I am trying to add a filter in functions.php to change the in-stock text for WooCommerce products. The code I used is: add_filter('woocommerce_get_availability', 'ecommercehints_change_in_stock_text', 10, 2); function ecommercehints_change_in_stock_text($availability, $product) { if ($product->is_in_stock()) { $availability['availability'] = __('Auf Lager - in 1-3 Tagen bei Dir', 'woocommerce'); } return $availability; } I want to translate 'Auf Lager - in 1-3 Tagen bei Dir' but cannot find it via String Translation. The issue can be seen at: 隐藏链接

Symptoms:
I expected to see the string 'Auf Lager - in 1-3 Tagen bei Dir' in String Translation, but instead, I got: NO STRING.

Questions:
Why can't I find the string 'Auf Lager - in 1-3 Tagen bei Dir' in String Translation?
How can I translate the custom in-stock text in WooCommerce?