亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何本地化 Woo 商業權重

如何本地化 Woo 商業權重

PHP
開心每一天1111 2022-09-12 09:12:04
因此,在俄語中,在Woocommerce重量和其他公制系統的設置中。但在產品頁面中,例如它仍然以英語(g - gramm)顯示。我已將文件復制到我的主題中:我應該在此文件中執行哪些操作才能以俄語顯示正確的重量公制系統?此代碼沒有幫助:/wp-content/themes/my_theme/woocommerce/single-product/product-attributes.php<td class="product_weight"><?php echo wc_format_localized_decimal( $product->get_weight() ) . ' ' . __(esc_attr( get_option( 'woocommerce_weight_unit' ) ), 'woocommerce'); ?></td>代碼 :/product-attributes.phpdefined( 'ABSPATH' ) || exit;if ( ! $product_attributes ) {    return;}?><table class="woocommerce-product-attributes shop_attributes">    <?php foreach ( $product_attributes as $product_attribute_key => $product_attribute ) : ?>        <tr class="woocommerce-product-attributes-item woocommerce-product-attributes-item--<?php echo esc_attr( $product_attribute_key ); ?>">            <th class="woocommerce-product-attributes-item__label"><?php echo wp_kses_post( $product_attribute['label'] ); ?></th>            <td class="woocommerce-product-attributes-item__value"><?php echo wp_kses_post( $product_attribute['value'] ); ?></td>        </tr>    <?php endforeach; ?></table>謝謝!
查看完整描述

1 回答

?
手掌心

TA貢獻1942條經驗 獲得超3個贊

完成,剛剛在主題的函數中發布了此代碼.php


function localize_weight_units($weight) {

    return str_replace('g', 'г', $weight);

}

add_filter('woocommerce_format_weight', 'localize_weight_units');


查看完整回答
反對 回復 2022-09-12
  • 1 回答
  • 0 關注
  • 68 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號