Use the cart price calculating method inside the handler.

This commit is contained in:
Narek Zakarian 2022-04-06 18:18:05 +04:00
parent f46341466f
commit 515a06542e

View file

@ -361,11 +361,11 @@ class SmartButton implements SmartButtonInterface {
) { ) {
add_action( add_action(
$this->mini_cart_button_renderer_hook(), $this->mini_cart_button_renderer_hook(),
static function () { function () {
// phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison if ( $this->is_cart_price_total_zero() ) {
if ( WC()->cart->get_cart_contents_total() == 0 ) {
return; return;
} }
echo '<p echo '<p
id="ppc-button-minicart" id="ppc-button-minicart"
class="woocommerce-mini-cart__buttons buttons" class="woocommerce-mini-cart__buttons buttons"