Refactor checkout
This commit is contained in:
parent
96e8b19f41
commit
d7b9a08829
@ -9,6 +9,7 @@ import org.springframework.ui.Model;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.servlet.http.Cookie;
|
import javax.servlet.http.Cookie;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
@ -82,9 +83,13 @@ public class RequestController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/shop/articles/{id}")
|
@PostMapping("/shop/articles/{id}")
|
||||||
public String shopArticlesByIdBuy(@RequestAttribute("customer") Boolean isCustomer, @PathVariable("id") Integer id) {
|
public String shopArticlesByIdBuy(@RequestAttribute("customer") Boolean isCustomer, @PathVariable("id") Integer id, @RequestParam("fastcheckout") Boolean fastcheckout ) {
|
||||||
if (isCustomer) {
|
if (isCustomer) {
|
||||||
return "redirect:/shop/checkout";
|
if (!fastcheckout) {
|
||||||
|
return "shop/articles/post_add";
|
||||||
|
} else {
|
||||||
|
return "shop/checkout";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return "redirect:/login?goto=%2Fshop%2Farticles%2F"+id;
|
return "redirect:/login?goto=%2Fshop%2Farticles%2F"+id;
|
||||||
}
|
}
|
||||||
|
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 8.1 KiB |
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 8.1 KiB |
@ -32,6 +32,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="s"></div>
|
<div class="s"></div>
|
||||||
<form class="s" method="POST">
|
<form class="s" method="POST">
|
||||||
|
<div class="detailgrid m">
|
||||||
<h2>50.28 EUR</h2>
|
<h2>50.28 EUR</h2>
|
||||||
<div>
|
<div>
|
||||||
<label class="nolinebreak">Menge:</label>
|
<label class="nolinebreak">Menge:</label>
|
||||||
@ -39,8 +40,10 @@
|
|||||||
<option>2</option>
|
<option>2</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<h3 class="secondarytext">Auf Lager</h3>
|
<h3 class="no-margin secondarytext">Auf Lager</h3>
|
||||||
<button>In den Einkaufswagen</button>
|
<button class="no-margin secondary" name="fastcheckout" value="false">In den Einkaufswagen</button>
|
||||||
|
<button class="no-margin" name="fastcheckout" value="true">Schneller Checkout</button>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="de" dir="ltr" xmlns:th="http://www.thymeleaf.org">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=0.75, user-scalable=no">
|
||||||
|
|
||||||
|
<title>Sucherergebnisse</title>
|
||||||
|
<link rel="stylesheet" th:href="@{/css/ecom.css}" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<!-- <nav th:replace="fragments/header :: header">Header</nav> -->
|
||||||
|
<main class="content-width modal">
|
||||||
|
<div class="detailgrid l " method="post">
|
||||||
|
<div class="s">
|
||||||
|
<h1 class="no-margin">Zum Warenkorb hinzugefügt</h1>
|
||||||
|
</div>
|
||||||
|
<div class="s">
|
||||||
|
<img th:src="@{/img/undraw_done_primary.svg}"/>
|
||||||
|
</div>
|
||||||
|
<div class="s">
|
||||||
|
<a th:href="@{__${#httpServletRequest.requestURI}__}" class="secondary button full-width no-margin">Weiter Einkaufen</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="s">
|
||||||
|
<a th:href="@{/shop/checkout}" class="button full-width no-margin">Zum Warenkorb / Zur Kasse</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
<footer th:replace="fragments/footer :: footer"></footer>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
@ -19,8 +19,8 @@
|
|||||||
<nav></nav>
|
<nav></nav>
|
||||||
</div>
|
</div>
|
||||||
<!-- TODO: this is suboptimal on mobile -->
|
<!-- TODO: this is suboptimal on mobile -->
|
||||||
<main class="content-width sidebar-layout">
|
<main class="content-width sidebar-layout" style="min-height: 100vh;">
|
||||||
<div style="min-height: 100vh;">
|
<div style="max-width: 45em; width: 100%;">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Bild</th>
|
<th>Bild</th>
|
||||||
@ -116,7 +116,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<form method="POST" th:action="@{/shop/checkoutFinish}">
|
<form method="POST" th:action="@{/shop/checkoutFinish}" style="min-width: 30em; max-width: 45em;">
|
||||||
<div class="detailflex hero">
|
<div class="detailflex hero">
|
||||||
<div>
|
<div>
|
||||||
<h1>Checkout</h1>
|
<h1>Checkout</h1>
|
||||||
|
Reference in New Issue
Block a user