Commit 0dbfba49 authored by Karl Hasselbring's avatar Karl Hasselbring

Preis wird bei Produktsuche jetzt deutlich sichtbar neben Titel angezeigt

parent 73233eb7
......@@ -65,9 +65,22 @@ class Result
$this->partnershop = isset($additionalInformation["partnershop"]) ? $additionalInformation["partnershop"] : false;
$this->image = isset($additionalInformation["image"]) ? $additionalInformation["image"] : "";
$this->price = isset($additionalInformation["price"]) ? $additionalInformation["price"] : 0;
$this->price_text = $this->price_to_text($this->price);
$this->additionalInformation = $additionalInformation;
}
private function price_to_text($price)
{
$euros = $price / 100;
$cents = $price % 100;
$price_text = $euros . ',';
if ($cents < 10) {
$price_text .= '0';
}
$price_text .= $cents . ' €';
return $price_text;
}
/* Ranked das Ergebnis nach folgenden Aspekten:
* Startwert 0
* + 0.02 * Sourcerank (20 - Position in Ergebnisliste des Suchanbieters)
......
......@@ -14,7 +14,16 @@
justify-content: space-between;
.result-title {
margin: 0px;
&>* {
font-size: @result-font-large;
}
.overflow-ellipsis;
.result-price {
padding: 0px 10px;
color: white;
background-color: #ff8000;
border-radius: 3px;
}
a {
&,
&:active,
......@@ -23,7 +32,6 @@
&:visited {
color: black;
text-decoration: none;
font-size: @result-font-large;
}
}
}
......@@ -56,10 +64,15 @@
display: flex;
text-align: justify;
.result-image {
width: 180px;
padding-right: 10px;
margin-right: 10px;
& img {
height: 150px;
padding: 0px 10px;
max-width: 100%;
display: block;
max-width: 160px;
max-height: 120px;
width: auto;
height: auto;
}
}
.result-description {
......
......@@ -5,6 +5,9 @@
@if(stripos($result->anzeigeLink, "twitter.com") !== false)
<i class="fa fa-twitter" aria-hidden="true"></i>
@endif
@if( isset($result->price) && $result->price != 0)
<span class="result-price">{!! $result->price_text !!}</span>
@endif
<a href="{{ $result->link }}" target="{{ $metager->getNewtab() }}" rel="noopener">
{!! $result->titel !!}
</a>
......@@ -32,7 +35,7 @@
@if( $result->image !== "" )
<div class="result-image">
<a href="{{ $result->link }}" target="{{ $metager->getNewtab() }}" rel="noopener">
<img src="{{ $metager->getImageProxyLink($result->image) }}" alt="" />
<img src="{{ $metager->getImageProxyLink($result->image) }}" align="left" width="120px" height="60px" alt="" />
</a>
</div>
@endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment