2017-09-03 8 views
-2

Woocommerceカートページの「カートに追加」メッセージセクションの「ショッピング続行」ボタンを「チェックアウトに進む」と変更し、チェックアウトページ(/ checkout )。Woocommerce Change Continue Shoppingボタン

リンクの変更に関するプラグインや情報がたくさんあるようですが、リンクとボタンの内容を変更するのに問題があります。

ご協力いただければ幸いです。

+0

をのfunctions.phpあなたにこれを追加してみてください。実際の文字列がどこにあるのかわからないという問題はありますか? – deg

答えて

0

私は歴史の中で最大のコーダではないけど、メタは非常に迅速に取得するプラグインを変更するプラグイン

add_filter('woocommerce_continue_shopping_redirect', 'my_changed_woocommerce_continue_shopping_redirect', 10, 1); 
function my_changed_woocommerce_continue_shopping_redirect($return_to){ 

    $return_to = wc_get_page_permalink('checkout'); 

    return $return_to; 
} 


add_filter('wc_add_to_cart_message_html', 'my_changed_wc_add_to_cart_message_html', 10, 2); 
function my_changed_wc_add_to_cart_message_html($message, $products){ 

    if (strpos($message, 'Continue shopping') !== false) { 
     $message = str_replace("Continue shopping", "Go the checkout", $message); 
    } 

    return $message; 

} 
+0

ありがとう!それは完璧に働いた! –