<?php
@session_start();
if(isset($_SESSION['cart'])){
  $count_carts = count(json_decode($_SESSION['cart']));
}else{
  $count_carts = "0";
}

?>
<button id="btn-cart" onclick="page_cart()" style="color:#fff"  data-count="<?=$count_carts?>" class="bg-primary btn-cart badge-bottom-right">
                      <i class="bx bx-cart">
                        </i>
                    </button>