<?php

use Isotope\Interfaces\IsotopePrice;
use Isotope\Isotope;

?>
<div class="iso--product-box variant-v2" data-aos="animate__fadeInUp">

    <form id="<?= $this->formId; ?>" name="iso<?= rand(); ?>" method="post" enctype="<?= $this->enctype; ?>">
        <div class="formbody gy-0 row" itemscope itemtype="http://schema.org/Product">
            <input type="hidden" name="FORM_SUBMIT" value="<?= $this->formSubmit; ?>">
            <input type="hidden" name="REQUEST_TOKEN" value="{{request_token}}">
            <input type="hidden" name="AJAX_PRODUCT" value="<?= $this->product_id; ?>">
            <input type="hidden" name="AJAX_MODULE" value="<?= $this->module_id; ?>">

            <div class="col-12">
                <?= $this->getGallery('images')->generateMainImage(); ?>
            </div>
            <div class="col-12">
                <div class="content_container ">
                    <div class="product--title">
                        <h3 itemprop="name">
                            <?php if ($this->href): ?>
                            <a href="<?= $this->href; ?>"
                               title="<?= $this->label_detail; ?>"><?php endif; ?><?= $this->highlightKeywords($this->generateAttribute('name')); ?><?php if ($this->href): ?></a>
                        <?php endif; ?>
                        </h3>
                    </div>

                    <?php if ($this->sku): ?>
                        <!-- <div class="sku" itemprop="sku"><?= $this->generateAttribute('sku'); ?></div> -->
                    <?php endif; ?>

                    <?php if ($this->teaser): ?>
                        <div class="teaser"><?= $this->highlightKeywords($this->generateAttribute('teaser')); ?></div>
                    <?php endif; ?>

                    <?php /* @var IsotopePrice $price */
                    if ($price = $this->product->getPrice()): ?>
                        <div class="offer" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
                            <meta itemprop="priceCurrency" content="<?= Isotope::getConfig()->currency ?>">
                            <div class="price h1" itemprop="price"
                                 content="<?= Isotope::roundPrice($price->getAmount(1, $this->product->getOptions())) ?>"><?= $this->generatePrice(); ?></div>

                            <?php if ($this->generateAttribute('baseprice')): ?>
                                <div class="baseprice">(<?= $this->generateAttribute('baseprice'); ?>)</div>
                            <?php endif; ?>
                            <span class="tax-note">
                    Preis inkl. MwSt., zzgl. Versandkosten
                </span>
                        </div>
                    <?php endif; ?>


                    <?php if ($this->href): ?>
                        <!--
            <div class="details">
                <a href="<?= $this->href; ?>" title="<?= $this->label_detail; ?>"><?= $this->label_detail; ?></a>
            </div>
         -->
                    <?php endif; ?>
                </div>
            </div>

            <?php if ($this->actions): ?>
                <div class=" col-12">
                    <div class="button_container">
                        <?php if ($this->hasOptions): ?>
                            <div class="options">
                                          <div class="form-body">
                                <?php foreach ($this->options as $arrOption): echo $arrOption['html']; endforeach; ?>
                                          </div>
                            </div>
                        <?php endif; ?>
                        <?php if ($this->useQuantity): ?>
                            <div class="quantity_container">
                                <label for="quantity_requested_<?= $this->raw['id']; ?>"><?= $GLOBALS['TL_LANG']['MSC']['quantity']; ?>
                                    :</label> <input type="text" class="text"
                                                     id="quantity_requested_<?= $this->raw['id']; ?>"
                                                     name="quantity_requested"
                                                     placeholder="<?= $this->minimum_quantity; ?>"
                                                     maxlength="10">
                            </div>
                        <?php endif; ?>
                        <?php foreach ($this->actions as $action) echo $action->generate($this->product); ?>
                    </div>
                </div>
            <?php endif; ?>
        </div>
    </form>
</div>