ts_cart_before_page_custom

Sconto quantità sul prodotto
 avatar
unknown
php
a month ago
558 B
3
Indexable
add_action('woocommerce_before_cart', 'ts_cart_before_page_custom');
function ts_cart_before_page_custom() { ?>
    <div class="ts-cart-custom-note">    
        <h2>Sconto quantità</h2>
       <?php 
           $quantita_totale = WC()->cart->get_cart_contents_count();
           if($quantita_totale < 2) {
            $message = 'Acquista 2 o più workshop per ottenere uno sconto';
           } else {
            $message = 'Congratulazioni, hai sbloccato il tuo sconto.';
           }
           ?>
           <p><?= $message; ?></p>
    </div>
<?php
}
Leave a Comment