Implemented icons for basket products

This commit is contained in:
Kevin Frantz
2018-07-15 16:50:26 +02:00
parent 1492282ae5
commit 306c38c2b2
4 changed files with 20 additions and 7 deletions

View File

@@ -22,5 +22,7 @@ interface ImageInterface
* @return string
*/
public function getThumbnail():string;
public function getIcon():string;
}

View File

@@ -31,5 +31,11 @@ final class UrlImage implements ImageInterface
{
$this->path = $path;
}
public function getIcon(): string
{
return str_replace('200/300', '50/50', $this->path);
}
}

View File

@@ -11,6 +11,7 @@ basket
<th>price(net)</th>
<th>tax (%)</th>
<th>price (gross)</th>
<th>image</th>
</tr>
{% for product in basket.products %}
<tr>
@@ -19,6 +20,7 @@ basket
<td>{{product.price.netto.float}} {{product.price.netto.symbol}}</td>
<td>{{product.price.tax}}</td>
<td>{{product.price.gross.float}} {{product.price.gross.symbol}}</td>
<td><img src="{{product.image.icon }}" /></td>
</tr>
{% endfor %}
</table>