現在、カートアイコンにカーソルを合わせると、「ショッピングカートを表示する」と表示されます。私のクライアントは、このタイトルが「買い物カゴを見る」と言って欲しいと願っています。WooCommerce Mini Cart Title Atrributeを変更するには
私は運がないテンプレートファイルをどこからでも見てきましたが、その仕事を行うfunction.phpコードスニペットを見つけることができませんでした。私はここで行う
function storefront_cart_link() {
?>
<a class="cart-contents" href="<?php echo esc_url(WC()->cart->get_cart_url()); ?>" title="<?php esc_attr_e('View your shopping cart', 'storefront'); ?>">
<span class="amount"><?php echo wp_kses_data(WC()->cart->get_cart_subtotal()); ?></span> <span class="count"><?php echo wp_kses_data(sprintf(_n('%d item', '%d items', WC()->cart->get_cart_contents_count(), 'storefront'), WC()->cart->get_cart_contents_count()));?></span>
</a>
<?php
}
しかし何がウェブサイト上の任意の影響を与えません。
私が得た最も近い
は、以下のコードで「店頭-woocommerceテンプレート-のfunctions.php」ファイルを見つけることでした。は解決:
add_filter('gettext', 'translate_reply');
add_filter('ngettext', 'translate_reply');
function translate_reply($translated)
{
$translated = str_ireplace('Shipping', 'Delivery', $translated);
$translated = str_ireplace('View your shopping cart', 'View your shopping basket', $translated);
return $translated;
}
これはあなたがしたいことです。http://stackoverflow.com/questions/18481472/change-the-text-of-view-cart-button? –