Isotope Warenkorb

Anzahl der Produkte und Wert des Warenkorbes

Oft kommt die Anforderung nur mal eben die Anzahl der Produkte im Warenkorb anzuzeigen. Dafür bietet Isotope zwar den Warenkorb mini, doch leider kommt man damit nicht an die Anzahl der Produkte so einfach. Hier mal mein Template:

Anzahl der Produkte im Warenkorb

<!-- indexer::stop -->
<div class="<?php echo $this->class; ?> block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
  
  <?php if ($this->headline): ?>
    <a href="" ><?= $this->headline ?> ( <?= $this->collection ? $this->collection->countItems() : 0 ?> ) </a>
  <?php endif; ?>

  <div class="cart_mobile">
    <?php echo $this->products; ?>
  </div>
</div>
<!-- indexer::continue -->

Anzahl der Produktmengen im Warenkorb

<!-- indexer::stop -->
<div class="<?php echo $this->class; ?> block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
  
  <?php if ($this->headline): ?>
    <a href="" ><?= $this->headline ?> ( <?= $this->collection ? $this->collection->sumItemsQuantity() : 0 ?> ) </a>
  <?php endif; ?>

  <div class="cart_mobile">
    <?php echo $this->products; ?>
  </div>
</div>
<!-- indexer::continue -->

Anzahl der Produkte im Warenkorb und die Bestellsumme

<?php
use Isotope\Isotope;
?>
<!-- indexer::stop -->
<div class="<?php echo $this->class; ?> block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?>>
  
  <?php if ($this->headline): ?>
    <a href="" ><?= $this->headline ?> ( <?= $this->collection ? $this->collection->countItems() : 0 ?> [<?= Isotope::formatPriceWithCurrency( $this->collection ? $this->collection->getTotal() : 0 ) ?>] ) </a>
  <?php endif; ?>

  <div class="cart_mobile">
    <?php echo $this->products; ?>
  </div>
</div>
<!-- indexer::continue -->