<?php
/**
 * @var $post WP_Post
 * @var $lotHelper LotHelper
 */

use auctionforge\inc\helpers\LotHelper;

$params = json_decode($lotHelper->getOptionValue('params', "{}"));
if (!empty((array)$params)) { ?>
    <div class="bp-params-group test23">
        <?php if (isset($params->condition) && $params->condition != "") { ?>
            <p class="title"><?= __("Condition", "auctionforge") ?>: <?= $params->condition ?></p>
        <?php } ?>
        <?php if (isset($params->weight)) { ?>
            <?php $weight = $params->weight; ?>
            <?php if (isset($params->weightUnit)) { ?>
                <?php $weight .= " " . $params->weightUnit; ?>
            <?php } ?>
            <p><?= __("Weight", "auctionforge") ?>: <?= $weight ?></p>
        <?php } ?>
        <?php if ((isset($params->width) && (!empty($params->width)) || !empty($params->height)) && $params->lengthUnit != "") { ?>
            <?php
            $measurement = "";
            if (isset($params->width) && $params->width != "") {
                $measurement = $params->width;
            }
            if ((isset($params->width) && $params->width != "") && (isset($params->height) && $params->height != "")) {
                $measurement .= " x ";
            }
            if (isset($params->height) && $params->height != "") {
                $measurement .= $params->height;
            }
            $measurement .= " " . $params->lengthUnit;
            ?>
            <p><?= __("Measurement", "auctionforge") ?>: <?= $measurement ?></p>
        <?php } ?>

        <?php if (isset($params->widthWithFrame) && (!empty($params->widthWithFrame) || !empty($params->heightWithFrame)) && $params->lengthUnit != "") { ?>
            <?php
            $measurement = "";
            if (isset($params->widthWithFrame) && $params->widthWithFrame != "") {
                $measurement = $params->widthWithFrame;
            }
            if ((isset($params->widthWithFrame) && $params->widthWithFrame != "") && (isset($params->heightWithFrame) && $params->heightWithFrame != "")) {
                $measurement .= " x ";
            }
            if (isset($params->heightWithFrame) && $params->heightWithFrame != "") {
                $measurement .= $params->heightWithFrame;
            }
            $measurement .= " " . $params->lengthUnit;
            ?>
            <p><?= __("Measurement with frame", "auctionforge") ?>: <?= $measurement ?></p>
        <?php } ?>

        <?php if (isset($params->depth) && $params->depth != "") { ?>
            <p><?= __("Depth", "auctionforge") ?>: <?= $params->depth ?></p>
        <?php } ?>
        <?php if (isset($params->conditionReport) && $params->conditionReport != "") { ?>
            <br>
            <p class="title"><?= __("Condition report", "auctionforge") ?>:</p>
            <p><?= $params->conditionReport ?></p>
        <?php } ?>
    </div>
<?php } ?>