update or create order

This commit is contained in:
2025-03-24 01:04:01 +01:00
parent 2fce17d528
commit 22bf9d4390
7 changed files with 124 additions and 345 deletions

View File

@@ -1,13 +1,15 @@
package controllers
import (
"crypto/rand"
"encoding/hex"
"errors"
"fmt"
"strconv"
"net/http"
"crypto/rand"
"encoding/hex"
"strconv"
"github.com/gin-gonic/gin"
"gorm.io/gorm"
"example.com/gin/test/models"
//"example.com/gin/test/services"
@@ -26,28 +28,27 @@ type CartItemController interface {
OrderHandler(*gin.Context)
}
type cartItemController struct {}
type cartItemController struct{}
func NewCartItemController() CartItemController {
return &cartItemController{}
}
func GetShippingMethods() []models.Shipping {
return []models.Shipping{
{ Id: "germany", Name: "Germany (DHL)", Price: 3.99 },
{ Id: "international", Name: "International (DHL)", Price: 5.99 },
{ Id: "pickup", Name: "Pickup", Price: 0.00 },
{Id: "germany", Name: "Germany (DHL)", Price: 3.99},
{Id: "international", Name: "International (DHL)", Price: 5.99},
{Id: "pickup", Name: "Pickup", Price: 0.00},
}
}
func generateSessionId(length int) string {
bytes := make([]byte, length) // 16 bytes = 128 bits
_, err := rand.Read(bytes)
if err != nil {
panic("failed to generate session ID")
}
return hex.EncodeToString(bytes)
bytes := make([]byte, length) // 16 bytes = 128 bits
_, err := rand.Read(bytes)
if err != nil {
panic("failed to generate session ID")
}
return hex.EncodeToString(bytes)
}
func GetSessionId(ctx *gin.Context) string {
@@ -65,7 +66,6 @@ func GenerateToken() string {
return generateSessionId(8)
}
func (rc *cartItemController) NewCartItemFromForm(ctx *gin.Context) (models.CartItem, error) {
sessionId := GetSessionId(ctx)
shopItemIdStr := ctx.PostForm("ShopItemId")
@@ -88,12 +88,12 @@ func (rc *cartItemController) NewCartItemFromForm(ctx *gin.Context) (models.Cart
itemVariant, err := repositories.ShopItems.GetVariantById(itemVariantIdStr)
cartItem := models.CartItem{
SessionId: sessionId,
ShopItemId: uint(shopItemId),
ShopItem: shopItem,
SessionId: sessionId,
ShopItemId: uint(shopItemId),
ShopItem: shopItem,
ItemVariantId: uint(itemVariantId),
ItemVariant: itemVariant,
Quantity: quantity,
ItemVariant: itemVariant,
Quantity: quantity,
}
return cartItem, nil
@@ -132,12 +132,12 @@ func (rc *cartItemController) NewAddressFromForm(ctx *gin.Context) (models.Addre
}
return models.AddressInfo{
FirstName: firstName,
LastName: lastName,
Address: address,
FirstName: firstName,
LastName: lastName,
Address: address,
PostalCode: postalCode,
City: city,
Country: country,
City: city,
Country: country,
}, nil
}
@@ -182,25 +182,24 @@ func (rc *cartItemController) NewOrderFromForm(ctx *gin.Context) (models.Order,
}
cartItem := models.Order{
SessionId: sessionId,
Status: status,
Token: token,
Email: email,
Comment: comment,
FirstName: firstName,
LastName: lastName,
Address: address,
SessionId: sessionId,
Status: status,
Token: token,
Email: email,
Comment: comment,
FirstName: firstName,
LastName: lastName,
Address: address,
PostalCode: postalCode,
City: city,
Country: country,
Shipping: shipping.Id,
CartItems: cartItems,
City: city,
Country: country,
Shipping: shipping.Id,
CartItems: cartItems,
}
return cartItem, nil
}
func (rc *cartItemController) Create(c *gin.Context) {
cartItem, err := rc.NewCartItemFromForm(c)
@@ -219,7 +218,6 @@ func (rc *cartItemController) Create(c *gin.Context) {
ReplyOK(c, "cartItem was created")
}
func (rc *cartItemController) Update(c *gin.Context) {
cartItem, err := rc.NewCartItemFromForm(c)
@@ -256,7 +254,7 @@ func (rc *cartItemController) CartItemView(c *gin.Context) {
cartItems, err := repositories.CartItems.GetAll()
if err != nil {
c.HTML(http.StatusBadRequest, "cart.html", gin.H{ "data": gin.H{ "error": err } })
c.HTML(http.StatusBadRequest, "cart.html", gin.H{"data": gin.H{"error": err}})
}
priceTotal := 0.0
@@ -267,9 +265,9 @@ func (rc *cartItemController) CartItemView(c *gin.Context) {
fmt.Println("PRICE TOTAL", priceTotal)
data := CreateSessionData(c, gin.H{
"cartItems": cartItems,
"cartItems": cartItems,
"priceTotal": fmt.Sprintf("%.2f", priceTotal), //round 2 decimals
"shipping": GetShippingMethods(),
"shipping": GetShippingMethods(),
})
c.HTML(http.StatusOK, "cart.html", data)
@@ -280,14 +278,14 @@ func (rc *cartItemController) AddItemHandler(c *gin.Context) {
if err != nil {
fmt.Println(err)
c.HTML(http.StatusBadRequest, "error.html", gin.H{ "error": err })
c.HTML(http.StatusBadRequest, "error.html", gin.H{"error": err})
return
}
_, err = repositories.CartItems.Create(cartItem)
if err != nil {
data := CreateSessionData(c, gin.H{
"error": err,
"error": err,
"success": "",
})
@@ -304,7 +302,7 @@ func (rc *cartItemController) DeleteItemHandler(c *gin.Context) {
if err != nil {
fmt.Println(err)
data := CreateSessionData(c, gin.H{
"error": err,
"error": err,
"success": "",
})
@@ -351,7 +349,7 @@ func (rc *cartItemController) CheckoutView(c *gin.Context) {
shippingMethod := c.Query("shippingMethod")
c.HTML(http.StatusOK, "checkout.html", gin.H{
"askAddress": (shippingMethod != "pickup"),
"askAddress": (shippingMethod != "pickup"),
"shippingMethod": shippingMethod,
})
}
@@ -361,15 +359,25 @@ func (rc *cartItemController) CheckoutHandler(c *gin.Context) {
if err != nil {
fmt.Println(err)
c.HTML(http.StatusBadRequest, "error.html", gin.H{ "error": err })
c.HTML(http.StatusBadRequest, "error.html", gin.H{"error": err})
return
}
//TODO: should update or create here, in case user edited addressfield
_, err = repositories.Orders.Create(order)
existingOrder, err := repositories.Orders.GetBySession(order.SessionId)
if errors.Is(err, gorm.ErrRecordNotFound) {
fmt.Println("CREATE")
_, err = repositories.Orders.Create(order)
} else if err == nil {
fmt.Println("UPDATE")
order.ID = existingOrder.ID
order.CreatedAt = existingOrder.CreatedAt
repositories.Orders.Update(order)
}
if err != nil {
data := CreateSessionData(c, gin.H{
"error": err,
"error": err,
"success": "",
})
@@ -377,7 +385,6 @@ func (rc *cartItemController) CheckoutHandler(c *gin.Context) {
return
}
var shipping models.Shipping
for _, shippingMethod := range GetShippingMethods() {
if shippingMethod.Id == order.Shipping {
@@ -393,14 +400,14 @@ func (rc *cartItemController) CheckoutHandler(c *gin.Context) {
priceTotal := priceProducts + shipping.Price
data := CreateSessionData(c, gin.H{
"error": "",
"success": "",
"order": order,
"askAddress": (order.Shipping != "pickup"),
"isPreview": true,
"shipping": shipping,
"error": "",
"success": "",
"order": order,
"askAddress": (order.Shipping != "pickup"),
"isPreview": true,
"shipping": shipping,
"priceProducts": fmt.Sprintf("%.2f", priceProducts), //round 2 decimals
"priceTotal": fmt.Sprintf("%.2f", priceTotal), //round 2 decimals
"priceTotal": fmt.Sprintf("%.2f", priceTotal), //round 2 decimals
})
fmt.Println(order)
@@ -411,7 +418,7 @@ func (rc *cartItemController) OrderView(c *gin.Context) {
shippingMethod := c.Query("shippingMethod")
c.HTML(http.StatusOK, "checkout.html", gin.H{
"askAddress": (shippingMethod != "pickup"),
"askAddress": (shippingMethod != "pickup"),
"shippingMethod": shippingMethod,
})
}

20
main.go
View File

@@ -1,24 +1,24 @@
package main
import(
"os"
import (
"fmt"
"io"
"net/http"
"fmt"
"os"
"github.com/gin-gonic/gin"
"github.com/joho/godotenv"
"example.com/gin/test/controllers"
"example.com/gin/test/repositories"
"example.com/gin/test/middlewares"
"example.com/gin/test/repositories"
)
var(
var (
shopItemController controllers.ShopItemController = controllers.NewShopItemController()
userController controllers.UserController = controllers.UserController{}
userController controllers.UserController = controllers.UserController{}
cartItemController controllers.CartItemController = controllers.NewCartItemController()
authValidator middlewares.AuthValidator = middlewares.AuthValidator{}
authValidator middlewares.AuthValidator = middlewares.AuthValidator{}
)
func LoadEnvVariables() {
@@ -36,7 +36,7 @@ func setupLogOutput() {
func SetReply(ctx *gin.Context, err error, message any) {
if err != nil {
ctx.JSON(http.StatusBadRequest, gin.H{ "error": err.Error() })
ctx.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
} else {
ctx.JSON(http.StatusOK, message)
}
@@ -47,7 +47,6 @@ func main() {
repositories.InitRepositories()
server := gin.New()
server.Use(gin.Recovery())
server.Use(gin.Logger())
@@ -106,6 +105,5 @@ func main() {
viewRoutes.POST("/passwordreset", userController.ResetHandler)
}
server.Run(":"+os.Getenv("PORT"))
server.Run(":" + os.Getenv("PORT"))
}

View File

@@ -1,19 +1,19 @@
package repositories
import(
"strconv"
import (
"gorm.io/gorm"
"strconv"
"example.com/gin/test/models"
)
)
type OrderRepository interface {
Create(models.Order) (models.Order, error)
Create(models.Order) (models.Order, error)
GetAll() ([]models.Order, error)
GetById(string) (models.Order, error)
GetAllBySession(string) ([]models.Order, error)
GetBySession(string) (models.Order, error)
Update(models.Order) (models.Order, error)
DeleteById(string) (error)
DeleteById(string) error
}
type GORMOrderRepository struct {
@@ -30,7 +30,7 @@ func (r *GORMOrderRepository) Create(order models.Order) (models.Order, error) {
//Omit the shopitem so it is not created again in db leading to unique constain fails
result := r.DB.Omit("CartItems").Create(&order)
if result.Error != nil {
return models.Order{}, result.Error
return models.Order{}, result.Error
}
return order, nil
@@ -60,10 +60,9 @@ func (t *GORMOrderRepository) GetById(id string) (models.Order, error) {
return order, nil
}
func (r *GORMOrderRepository) GetAllBySession(sessionId string) ([]models.Order, error) {
var orders []models.Order
result := r.DB.Preload("CartItems").Where("session_id = ?", sessionId).Find(&orders)
func (r *GORMOrderRepository) GetBySession(sessionId string) (models.Order, error) {
var orders models.Order
result := r.DB.Preload("CartItems").Where("session_id = ?", sessionId).First(&orders)
return orders, result.Error

View File

@@ -1,19 +1,19 @@
package repositories
import(
"os"
"gorm.io/gorm"
import (
"gorm.io/driver/sqlite"
"gorm.io/gorm"
"os"
"example.com/gin/test/models"
)
)
var(
var (
ShopItems ShopItemRepository
Users UserRepository
Tags TagRepository
Users UserRepository
Tags TagRepository
CartItems CartItemRepository
Orders OrderRepository
Orders OrderRepository
)
func InitRepositories() {
@@ -22,12 +22,12 @@ func InitRepositories() {
panic("failed to connect to database")
}
err = db.AutoMigrate(&models.ShopItem{},
&models.ItemVariant{},
&models.User{},
&models.Tag{},
&models.CartItem{},
&models.Order{})
err = db.AutoMigrate(&models.ShopItem{},
&models.ItemVariant{},
&models.User{},
&models.Tag{},
&models.CartItem{},
&models.Order{})
if err != nil {
panic("failed to migrate database")

View File

@@ -566,14 +566,6 @@ video {
border-width: 0;
}
.invisible {
visibility: hidden;
}
.fixed {
position: fixed;
}
.absolute {
position: absolute;
}
@@ -591,30 +583,10 @@ video {
bottom: 0px;
}
.left-0 {
left: 0px;
}
.right-0 {
right: 0px;
}
.top-0 {
top: 0px;
}
.z-10 {
z-index: 10;
}
.z-20 {
z-index: 20;
}
.z-50 {
z-index: 50;
}
.col-span-12 {
grid-column: span 12 / span 12;
}
@@ -642,10 +614,6 @@ video {
margin-right: auto;
}
.-me-0\.5 {
margin-inline-end: -0.125rem;
}
.mb-2 {
margin-bottom: 0.5rem;
}
@@ -666,10 +634,6 @@ video {
margin-bottom: 2rem;
}
.me-2 {
margin-inline-end: 0.5rem;
}
.ml-2 {
margin-left: 0.5rem;
}
@@ -690,10 +654,6 @@ video {
margin-inline-start: 0.5rem;
}
.ms-auto {
margin-inline-start: auto;
}
.mt-1 {
margin-top: 0.25rem;
}
@@ -718,18 +678,10 @@ video {
display: block;
}
.inline-block {
display: inline-block;
}
.flex {
display: flex;
}
.inline-flex {
display: inline-flex;
}
.table {
display: table;
}
@@ -758,10 +710,6 @@ video {
height: 4rem;
}
.h-3 {
height: 0.75rem;
}
.h-4 {
height: 1rem;
}
@@ -770,14 +718,6 @@ video {
height: 2rem;
}
.h-\[460px\] {
height: 460px;
}
.h-\[calc\(100\%-1rem\)\] {
height: calc(100% - 1rem);
}
.h-auto {
height: auto;
}
@@ -786,10 +726,6 @@ video {
height: 100%;
}
.h-20 {
height: 5rem;
}
.max-h-full {
max-height: 100%;
}
@@ -810,18 +746,10 @@ video {
width: 3rem;
}
.w-3 {
width: 0.75rem;
}
.w-4 {
width: 1rem;
}
.w-56 {
width: 14rem;
}
.w-8 {
width: 2rem;
}
@@ -834,14 +762,6 @@ video {
width: 100%;
}
.w-20 {
width: 5rem;
}
.w-16 {
width: 4rem;
}
.max-w-2xl {
max-width: 42rem;
}
@@ -858,10 +778,6 @@ video {
max-width: 80rem;
}
.max-w-lg {
max-width: 32rem;
}
.max-w-md {
max-width: 28rem;
}
@@ -894,10 +810,6 @@ video {
grid-template-columns: repeat(12, minmax(0, 1fr));
}
.grid-cols-2 {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.flex-col {
flex-direction: column;
}
@@ -918,14 +830,6 @@ video {
justify-content: space-between;
}
.gap-1 {
gap: 0.25rem;
}
.gap-2 {
gap: 0.5rem;
}
.gap-4 {
gap: 1rem;
}
@@ -983,11 +887,6 @@ video {
border-bottom-width: calc(1px * var(--tw-divide-y-reverse));
}
.divide-gray-100 > :not([hidden]) ~ :not([hidden]) {
--tw-divide-opacity: 1;
border-color: rgb(243 244 246 / var(--tw-divide-opacity, 1));
}
.divide-gray-200 > :not([hidden]) ~ :not([hidden]) {
--tw-divide-opacity: 1;
border-color: rgb(229 231 235 / var(--tw-divide-opacity, 1));
@@ -997,14 +896,6 @@ video {
overflow-x: auto;
}
.overflow-y-auto {
overflow-y: auto;
}
.overflow-x-hidden {
overflow-x: hidden;
}
.whitespace-nowrap {
white-space: nowrap;
}
@@ -1033,26 +924,11 @@ video {
border-radius: 0.375rem;
}
.rounded-e-lg {
border-start-end-radius: 0.5rem;
border-end-end-radius: 0.5rem;
}
.rounded-l-md {
border-top-left-radius: 0.375rem;
border-bottom-left-radius: 0.375rem;
}
.rounded-s-lg {
border-start-start-radius: 0.5rem;
border-end-start-radius: 0.5rem;
}
.rounded-t {
border-top-left-radius: 0.25rem;
border-top-right-radius: 0.25rem;
}
.border {
border-width: 1px;
}
@@ -1065,10 +941,6 @@ video {
border-bottom-width: 1px;
}
.border-s-0 {
border-inline-start-width: 0px;
}
.border-t {
border-top-width: 1px;
}
@@ -1147,10 +1019,6 @@ video {
background-color: rgb(127 29 29 / var(--tw-bg-opacity, 1));
}
.bg-transparent {
background-color: transparent;
}
.bg-white {
--tw-bg-opacity: 1;
background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
@@ -1270,10 +1138,6 @@ video {
padding-top: 0.5rem;
}
.pt-4 {
padding-top: 1rem;
}
.pt-5 {
padding-top: 1.25rem;
}
@@ -1387,11 +1251,6 @@ video {
color: rgb(209 213 219 / var(--tw-text-opacity, 1));
}
.text-gray-400 {
--tw-text-opacity: 1;
color: rgb(156 163 175 / var(--tw-text-opacity, 1));
}
.text-gray-500 {
--tw-text-opacity: 1;
color: rgb(107 114 128 / var(--tw-text-opacity, 1));
@@ -1451,16 +1310,6 @@ video {
-moz-osx-font-smoothing: grayscale;
}
.opacity-0 {
opacity: 0;
}
.shadow {
--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.shadow-sm {
--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);
@@ -1488,26 +1337,12 @@ video {
outline-color: #d1d5db;
}
.filter {
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}
.transition-all {
transition-property: all;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 150ms;
}
.transition-opacity {
transition-property: opacity;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 150ms;
}
.duration-300 {
transition-duration: 300ms;
}
.duration-500 {
transition-duration: 500ms;
}
@@ -1565,11 +1400,6 @@ video {
background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));
}
.hover\:bg-gray-200:hover {
--tw-bg-opacity: 1;
background-color: rgb(229 231 235 / var(--tw-bg-opacity, 1));
}
.hover\:bg-gray-400:hover {
--tw-bg-opacity: 1;
background-color: rgb(156 163 175 / var(--tw-bg-opacity, 1));
@@ -1610,11 +1440,6 @@ video {
background-color: rgb(127 29 29 / var(--tw-bg-opacity, 1));
}
.hover\:text-gray-900:hover {
--tw-text-opacity: 1;
color: rgb(17 24 39 / var(--tw-text-opacity, 1));
}
.hover\:text-indigo-500:hover {
--tw-text-opacity: 1;
color: rgb(99 102 241 / var(--tw-text-opacity, 1));
@@ -1762,10 +1587,6 @@ video {
inset: auto;
}
.sm\:col-span-2 {
grid-column: span 2 / span 2;
}
.sm\:mx-auto {
margin-left: auto;
margin-right: auto;
@@ -1775,10 +1596,6 @@ video {
margin-left: 1.5rem;
}
.sm\:mt-0 {
margin-top: 0px;
}
.sm\:mt-8 {
margin-top: 2rem;
}
@@ -1842,10 +1659,6 @@ video {
}
@media (min-width: 768px) {
.md\:inset-0 {
inset: 0px;
}
.md\:flex-1 {
flex: 1 1 0%;
}
@@ -1862,10 +1675,6 @@ video {
align-items: center;
}
.md\:p-5 {
padding: 1.25rem;
}
.md\:px-5 {
padding-left: 1.25rem;
padding-right: 1.25rem;
@@ -1875,10 +1684,6 @@ video {
padding-top: 4rem;
padding-bottom: 4rem;
}
.md\:pt-5 {
padding-top: 1.25rem;
}
}
@media (min-width: 1024px) {
@@ -1952,10 +1757,6 @@ video {
}
@media (prefers-color-scheme: dark) {
.dark\:block {
display: block;
}
.dark\:hidden {
display: none;
}
@@ -1980,11 +1781,6 @@ video {
border-color: rgb(31 41 55 / var(--tw-border-opacity, 1));
}
.dark\:border-s-gray-700 {
--tw-border-opacity: 1;
border-inline-start-color: rgb(55 65 81 / var(--tw-border-opacity, 1));
}
.dark\:bg-gray-600 {
--tw-bg-opacity: 1;
background-color: rgb(75 85 99 / var(--tw-bg-opacity, 1));
@@ -2010,11 +1806,6 @@ video {
background-color: rgb(220 38 38 / var(--tw-bg-opacity, 1));
}
.dark\:text-gray-200 {
--tw-text-opacity: 1;
color: rgb(229 231 235 / var(--tw-text-opacity, 1));
}
.dark\:text-gray-300 {
--tw-text-opacity: 1;
color: rgb(209 213 219 / var(--tw-text-opacity, 1));
@@ -2025,11 +1816,6 @@ video {
color: rgb(156 163 175 / var(--tw-text-opacity, 1));
}
.dark\:text-gray-500 {
--tw-text-opacity: 1;
color: rgb(107 114 128 / var(--tw-text-opacity, 1));
}
.dark\:text-gray-900 {
--tw-text-opacity: 1;
color: rgb(17 24 39 / var(--tw-text-opacity, 1));
@@ -2054,16 +1840,6 @@ video {
--tw-ring-offset-color: #1f2937;
}
.dark\:placeholder\:text-gray-400::-moz-placeholder {
--tw-text-opacity: 1;
color: rgb(156 163 175 / var(--tw-text-opacity, 1));
}
.dark\:placeholder\:text-gray-400::placeholder {
--tw-text-opacity: 1;
color: rgb(156 163 175 / var(--tw-text-opacity, 1));
}
.dark\:hover\:bg-gray-600:hover {
--tw-bg-opacity: 1;
background-color: rgb(75 85 99 / var(--tw-bg-opacity, 1));

View File

@@ -1,37 +1,36 @@
package main
import (
"fmt"
"net/http"
"io/ioutil"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
func testFunc() {
url := "http://localhost:8080/test"
method := "GET"
method := "GET"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
client := &http.Client{}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "Basic dXNlcjpwYXNzd29yZA==")
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "Basic dXNlcjpwYXNzd29yZA==")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}

View File

@@ -81,7 +81,7 @@
<div class="gap-4 sm:flex sm:items-center">
<button type="button" class="w-full rounded-lg border border-gray-200 bg-white px-5 py-2.5 text-sm font-medium text-gray-900 hover:bg-gray-100 hover:text-primary-700 focus:z-10 focus:outline-none focus:ring-4 focus:ring-gray-100 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white dark:focus:ring-gray-700"><a href="/">Return to Shopping</a></button>
<button type="submit" class="w-full rounded-lg border border-gray-200 bg-white px-5 py-2.5 text-sm font-medium text-gray-900 hover:bg-gray-100 hover:text-primary-700 focus:z-10 focus:outline-none focus:ring-4 focus:ring-gray-100 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white dark:focus:ring-gray-700">Place binding order</button>
<button type="submit" class="w-full bg-gray-900 dark:bg-gray-600 rounded-lg border border-gray-200 bg-white px-5 py-2.5 text-sm font-medium text-gray-900 hover:bg-gray-100 hover:text-primary-700 focus:z-10 focus:outline-none focus:ring-4 focus:ring-gray-100 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white dark:focus:ring-gray-700">Place binding order</button>
</div>
</div>
</div>