2014-04-12 3 views

답변

5

그것은이 작업을 수행하는 것은 매우 간단합니다. li 태그 내부에 다음 코드를 추가합니다

<?php 
    echo apply_filters('woocommerce_cart_item_remove_link', sprintf('<a href="%s" class="remove" title="%s">&times;</a>', esc_url($woocommerce->cart->get_remove_url($cart_item_key)), __('Remove this item', 'woocommerce')), $cart_item_key); 
?> 

이것은 당신의 슬라이딩 카트에 각 제품에 대한 삭제 버튼 (A X)를 추가합니다.

이제 끝났습니다.

echo apply_filters('woocommerce_cart_item_remove_link', 
sprintf('<a href="%s" class="remove" title="%s">&times;</a>', 
esc_url(WC()->cart->get_remove_url($cart_item_key)), 
__('Remove this item', 'woocommerce')), $cart_item_key); 

WC()->cart 대신 희망 $woocommerce->cart의 위의 솔루션 중 하나를 작동하지 않는 경우이 다른 사람을 도울 수 있습니다 :

+1

이것은 나를 위해 sprintf와'에코 apply_filters ('woocommerce_cart_item_remove_link'('×', esc_url (WC() 작동하지 않았다 -> cart-> get_remove_url ($의 cart_item_key)) __을 ('이 항목 삭제', 'woocommerce')), $ cart_item_key); '트릭을 수행했습니다. '$ woocommerce-> 장바구니 ...'대신'WC() -> 장바구니 ... '에주의하십시오. 위의 해결책이 작동하지 않는다면 다른 사람에게 도움이되기를 바랍니다. :) –

1

다니엘의 솔루션이 작동하지 않았다 나를 위해, 다음 코드는 일을했다 :)

관련 문제