添加到购物车文本后如何显示查看购物车按钮?

时间:2019-09-10 10:29:02

标签: wordpress woocommerce

我想在段落(p)标签之间添加添加到购物车的文字。我这样做,但是添加到购物车后,未显示查看购物车按钮。我不知道该怎么解决。请帮帮我!

/**
 * Change product has been added text
 */

add_filter ( 'wc_add_to_cart_message', 'custom_wc_add_to_cart_message', 10, 2 );
function custom_wc_add_to_cart_message( $message, $product_id ) {
    $message = sprintf('<p>"%s" has been added to your cart.</p>', get_the_title( $product_id ));
    return $message;
}

0 个答案:

没有答案