mirror of
https://github.com/kevinveenbirkenbach/coding-challenge-online-shop.git
synced 2024-11-22 10:11:04 +01:00
Implemented icons for basket products
This commit is contained in:
parent
1492282ae5
commit
306c38c2b2
17
README.md
17
README.md
@ -4,21 +4,24 @@ Coding challenge for a online shop
|
|||||||
### requirements
|
### requirements
|
||||||
1. Create a web application with PHP which works like a really small online shop. ✓
|
1. Create a web application with PHP which works like a really small online shop. ✓
|
||||||
2. Create a database with at least 20 products automatically per script. ✓
|
2. Create a database with at least 20 products automatically per script. ✓
|
||||||
3. Create a product listing which display all products from the database. ✓ <br> The following information are required:
|
3. Create a product listing which display all products from the database. ✓
|
||||||
|
<br> The following information are required:
|
||||||
- price net and gross ✓
|
- price net and gross ✓
|
||||||
- image ✓
|
- image ✓
|
||||||
- product name ✓
|
- product name ✓
|
||||||
- color ✓
|
- color ✓
|
||||||
4. Add a “to the basket” button to each product in the listing. ✓
|
4. Add a “to the basket” button to each product in the listing. ✓
|
||||||
5. Make the product basket work and display all products which are in the basket as a list with
|
5. Make the product basket work and display all products which are in the basket as a list with
|
||||||
small images.
|
small images. ✓
|
||||||
6. Create a login and registration with e-mail address, password and a name. ✓
|
6. Create a login and registration with e-mail address, password and a name. ✓
|
||||||
7. The login should be session based. ✓
|
7. The login should be session based. ✓
|
||||||
8. Create a checkout which is shown when the user is logged in. ✓
|
8. Create a checkout which is shown when the user is logged in. ✓
|
||||||
9. The user should be able to choose between 2 payment methods. Call them method1 ✓ and
|
9. The user should be able to choose between 2 payment methods. ✓
|
||||||
|
<br> Call them method1 ✓ and
|
||||||
method2 ✓.
|
method2 ✓.
|
||||||
10. Store the order at the database. ✓
|
10. Store the order at the database. ✓
|
||||||
11. Add a color filter to the product list. The user should be able to filter the listing with the existing colors. ✓
|
11. Add a color filter to the product list.✓
|
||||||
|
<br> The user should be able to filter the listing with the existing colors. ✓
|
||||||
### specifications
|
### specifications
|
||||||
- Please use PHP ✓, MySQL ✓ and HTML ✓. You can also use CSS, JavaScript, Bootstrap ✓ and jQuery.
|
- Please use PHP ✓, MySQL ✓ and HTML ✓. You can also use CSS, JavaScript, Bootstrap ✓ and jQuery.
|
||||||
- Save your code online at github. ✓
|
- Save your code online at github. ✓
|
||||||
@ -27,14 +30,14 @@ method2 ✓.
|
|||||||
- Use transactions if it makes sense. ✓
|
- Use transactions if it makes sense. ✓
|
||||||
- Please cover your code with unit tests. ✓
|
- Please cover your code with unit tests. ✓
|
||||||
### time frame
|
### time frame
|
||||||
one weekend
|
- one weekend
|
||||||
## start
|
## start
|
||||||
To run the program execute:
|
To run the program execute:
|
||||||
```bash
|
```bash
|
||||||
bash ./start.sh
|
bash ./start.sh
|
||||||
```
|
```
|
||||||
### Attention
|
### Attention
|
||||||
This is a demo program; Everytime when you start the demo the database will be reset.
|
This is a demo program; Everytime when you restart the demo the database will be reset.
|
||||||
|
|
||||||
### requirements
|
### requirements
|
||||||
The start.sh file needs docker and docker-compose.
|
The start.sh file needs docker and docker-compose.
|
||||||
@ -44,4 +47,4 @@ To run the tests execute:
|
|||||||
```bash
|
```bash
|
||||||
bash ./test.sh
|
bash ./test.sh
|
||||||
```
|
```
|
||||||
Tests just exist for the core and the entities. UnitTest you will find in the directory of the unit.
|
Tests just exist for the core, the entities and some other files. UnitTest you will find in the directory of the unit.
|
||||||
|
@ -22,5 +22,7 @@ interface ImageInterface
|
|||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getThumbnail():string;
|
public function getThumbnail():string;
|
||||||
|
|
||||||
|
public function getIcon():string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,5 +31,11 @@ final class UrlImage implements ImageInterface
|
|||||||
{
|
{
|
||||||
$this->path = $path;
|
$this->path = $path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getIcon(): string
|
||||||
|
{
|
||||||
|
return str_replace('200/300', '50/50', $this->path);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ basket
|
|||||||
<th>price(net)</th>
|
<th>price(net)</th>
|
||||||
<th>tax (%)</th>
|
<th>tax (%)</th>
|
||||||
<th>price (gross)</th>
|
<th>price (gross)</th>
|
||||||
|
<th>image</th>
|
||||||
</tr>
|
</tr>
|
||||||
{% for product in basket.products %}
|
{% for product in basket.products %}
|
||||||
<tr>
|
<tr>
|
||||||
@ -19,6 +20,7 @@ basket
|
|||||||
<td>{{product.price.netto.float}} {{product.price.netto.symbol}}</td>
|
<td>{{product.price.netto.float}} {{product.price.netto.symbol}}</td>
|
||||||
<td>{{product.price.tax}}</td>
|
<td>{{product.price.tax}}</td>
|
||||||
<td>{{product.price.gross.float}} {{product.price.gross.symbol}}</td>
|
<td>{{product.price.gross.float}} {{product.price.gross.symbol}}</td>
|
||||||
|
<td><img src="{{product.image.icon }}" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
Loading…
Reference in New Issue
Block a user