V1.1 design of shop offers in productpage.php, more data needed

This commit is contained in:
Paul Eisenbock 2026-02-21 16:17:25 +01:00
parent 203a6901cf
commit 73b7ff1baf
3 changed files with 133 additions and 8 deletions

View File

@ -91,3 +91,108 @@ S
flex-direction: column; flex-direction: column;
} }
} }
/********* SHOP OFFERS *************/
.shop-offers {
margin: 50px 0 80px 0; /* unten mehr Abstand */
display: flex;
color: white;
flex-direction: column;
gap: 14px; /* etwas enger */
}
.shop-line {
display: flex;
align-items: center;
justify-content: space-between;
background: #1f2a3a;
border: 1px solid #2f3c52;
border-radius: 12px;
padding: 12px 20px; /* vorher 20px 28px → jetzt kompakter */
min-height: 70px; /* feste, schlanke Höhe */
}
.shop-line:hover {
background: #243248;
transform: translateY(-3px);
box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}
.shop-left {
display: flex;
align-items: center;
gap: 16px;
}
.shop-logo {
display: flex;
align-items: center;
height: 40px; /* feste Höhe */
}
.shop-logo img {
max-height: 40px; /* Logo passt sich an */
max-width: 100px; /* verhindert Überstehen */
object-fit: contain;
}
.shop-name {
color: white;
font-weight: 600;
font-size: 16px;
text-decoration: none;
}
.shop-name:hover {
text-decoration: underline;
}
.shop-middle {
display: flex; /* statt column */
align-items: center;
gap: 30px; /* Abstand zwischen Preis / Versand / Lager */
color: #cbd5e1;
font-size: 14px;
}
.shop-shipping {
display: flex;
flex-direction: column;
gap: 4px;
}
.shop-stock {
font-weight: 500;
display: flex;
align-items: center;
gap: 6px;
}
/* Grün */
.shop-stock.in-stock::before {
content: "✔";
color: #22c55e;
}
/* Rot */
.shop-stock.out-stock::before {
content: "✖";
color: #ef4444;
}
.shop-price {
font-size: 18px; /* kleiner als vorher */
font-weight: 700;
color: #4ade80;
}
.no-shop {
background: #1f2a3a;
padding: 20px;
border-radius: 12px;
color: #cbd5e1;
text-align: center;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -181,7 +181,7 @@ $productId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
<?php <?php
$stmt = mysqli_prepare($conn, $stmt = mysqli_prepare($conn,
"SELECT price, shippingCost, inStock, shops.name, shops.website "SELECT price, shippingCost, inStock, shops.name, shops.website, shops.logoPath, shops.shippingTime
FROM offers FROM offers
INNER JOIN shops ON INNER JOIN shops ON
offers.shopID = shops.shopID WHERE offers.productID = ?"); offers.shopID = shops.shopID WHERE offers.productID = ?");
@ -207,19 +207,39 @@ $productId = isset($_GET['id']) ? (int)$_GET['id'] : 0;
<?php foreach ($shopInfo as $shop): ?> <?php foreach ($shopInfo as $shop): ?>
<div class="shop-line"> <div class="shop-line">
<a href="<?= htmlspecialchars($shop['website']) ?>" target="_blank">
<?= htmlspecialchars($shop['name']) ?>
</a><br>
Preis: <?= htmlspecialchars($shop['price']) ?> € <br> <div class =shop-left>
Versand: <?= htmlspecialchars($shop['shippingCost']) ?> € <br> <div class ="shop-logo">
Lagernd: <?= $shop['inStock'] ? "Ja" : "Nein" ?> <img src="<?= isset($shop['logoPath']) ? $shop['logoPath'] : 'assets/images/placeholder.png' ?>"
alt ="Kein Logo gefunden" >
</div>
<div class="shop-name">
<a href="<?= htmlspecialchars($shop['website']) ?>" target="_blank">
<?= htmlspecialchars($shop['name']) ?>
</a>
</div>
</div>
<div class="shop-middle">
<div class="shop-shipping">
Versand: <?= htmlspecialchars($shop['shippingCost']) ?>
Lieferzeit: <?= htmlspecialchars($shop['shippingTime']) ?> Werktage
</div>
<div class="shop-stock <?= $shop['inStock'] ? 'in-stock' : 'out-stock' ?>">
<?= $shop['inStock'] ? "Lagernd" : "Nicht lagernd" ?>
</div>
<div class="shop-price">
Preis: <?= htmlspecialchars($shop['price']) ?> € <br>
</div>
</div>
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
<?php else: ?> <?php else: ?>
<p>Keine Shops bieten dieses Produkt an.</p> <div class ="no-shop">
<p>Keine Shops bieten dieses Produkt an.</p>
</div>
<?php endif; ?> <?php endif; ?>
</div> </div>