📌  相关文章
📜  如何添加 woocommerce 购物车计数器 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:53.236000             🧑  作者: Mango

代码示例2
add_filter( 'woocommerce_add_to_cart_fragments', 'misha_add_to_cart_fragment' );
 
function misha_add_to_cart_fragment( $fragments ) {
 
    global $woocommerce;
 
    $fragments['.misha-cart'] = 'Cart (' . $woocommerce->cart->cart_contents_count . ')';
     return $fragments;
 
 }