2017-02-27 54 views
1

是否有任何解決方案在WooCommerce結賬頁面上顯示「回到購物車」按鈕?返回購物車結賬頁面的按鈕

其實只有一個完整的訂單按鈕,但我們需要一個返回按鈕,如果用戶想糾正他的命令。

謝謝。

回答

1

是它可能與結賬頁面上的「返回購物車」按鈕,顯示自定義通知。這裏是woocommerce_before_checkout_form動作鉤子鉤住定製功能:

add_action('woocommerce_before_checkout_form', 'return_to_cart_notice_button'); 
function return_to_cart_notice_button(){ 

    // HERE Type your displayed message and text button 
    $message = __('Go back to the Cart page', 'woocommerce'); 
    $button_text = __('Back to Cart', 'woocommerce'); 

    $cart_link = WC()->cart->get_cart_url(); 

    wc_add_notice('<a href="' . $cart_link . '" class="button wc-forward">' . $button_text . '</a>' . $message, 'notice'); 
} 

代碼放在您的活動子主題(或主題)的function.php文件或也以任何插件文件。

的代碼測試和工程。

+0

有沒有解決方案來獲取頁面底部的按鈕?也許在「立即訂購」按鈕旁邊 - 按鈕? – user6573193

+0

@ user6573193對不起,但這是另一個問題...並且要在「現在訂購」附近有這個按鈕,這會變得非常混亂。一般來說,在所有好的網絡商店中,在頂部酒吧有一個**迷你車,**按鈕,可以回到購物車...... – LoicTheAztec

相關問題