variants
This commit is contained in:
@@ -55,7 +55,8 @@
|
||||
-->
|
||||
|
||||
<div>
|
||||
<input type="hidden" id="variant-name1" name="varian-name[]" value="B/W" required>
|
||||
<input type="hidden" name="category" value="Zine" required>
|
||||
<input type="hidden" id="variant-name1" name="variant-name[]" value="B/W" required>
|
||||
<div class="flex items-center justify-between">
|
||||
<label for="variant-value1" class="block text-sm/6 font-medium text-gray-900">Price B/W</label>
|
||||
</div>
|
||||
@@ -67,7 +68,7 @@
|
||||
|
||||
|
||||
<div>
|
||||
<input type="hidden" id="variant-name2" name="varian-name[]" value="Colored" required>
|
||||
<input type="hidden" id="variant-name2" name="variant-name[]" value="Colored" required>
|
||||
<div class="flex items-center justify-between">
|
||||
<label for="variant-value2" class="block text-sm/6 font-medium text-gray-900">Price Colored</label>
|
||||
</div>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</div>
|
||||
<div class="col-span-12 lg:col-span-10 detail w-full lg:pl-3">
|
||||
<div class="flex items-center justify-between w-full mb-4">
|
||||
<h5 class="font-manrope font-bold text-2xl leading-9 text-gray-900">{{ .ShopItem.Name }}</h5>
|
||||
<h5 class="font-manrope font-bold text-2xl leading-9 text-gray-900">{{ .ShopItem.Name }} - {{ .ItemVariant.Name}}</h5>
|
||||
<form action="/cart/delete" method="POST">
|
||||
<input type="hidden" id="{{ .ID }}" name="id" value="{{ .ID }}">
|
||||
<button type="submit" class="rounded-full group flex items-center justify-center focus-within:outline-red-500">
|
||||
@@ -55,7 +55,7 @@
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<h6 class="text-indigo-600 font-manrope font-bold text-2xl leading-9 text-right">{{ .Quantity}} x {{ .ShopItem.Price }}€</h6>
|
||||
<h6 class="text-indigo-600 font-manrope font-bold text-2xl leading-9 text-right">{{ .Quantity}} x {{ .ItemVariant.Price }}€</h6>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
{{ template "header.html" . }}
|
||||
|
||||
<div class="bg-gray-100 dark:bg-gray-800 py-8">
|
||||
<form action="/cart" method="POST">
|
||||
<div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
<div class="flex flex-col md:flex-row -mx-4">
|
||||
<div class="md:flex-1 px-4">
|
||||
<div class="h-[460px] rounded-lg bg-gray-300 dark:bg-gray-700 mb-4">
|
||||
<img class="w-full h-full object-cover" src="/{{ .data.shopItem.Image}}" alt="Product Image">
|
||||
</div>
|
||||
<form action="/cart" method="POST">
|
||||
<div class="flex -mx-2 mb-4">
|
||||
|
||||
<input type="hidden" id="{{ .data.shopItem.ID}}" name="ShopItemId" value="{{ .data.shopItem.ID }}">
|
||||
<div class="w-1/3 px-2">
|
||||
<button type="submit" class="w-full bg-gray-900 dark:bg-gray-600 text-white py-2 px-4 rounded-full font-bold hover:bg-gray-800 dark:hover:bg-gray-700">Add to Cart</button>
|
||||
@@ -24,20 +25,21 @@
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="md:flex-1 px-4">
|
||||
<h2 class="text-2xl font-bold text-gray-800 dark:text-white mb-2">{{ .data.shopItem.Name }}</h2>
|
||||
<p class="text-gray-600 dark:text-gray-300 text-sm mb-4">
|
||||
{{ .data.shopItem.Abstract }}
|
||||
</p>
|
||||
|
||||
<div class="flex mb-4">
|
||||
<label for="ItemVariantId" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white"></label>
|
||||
<select name="ItemVariantId" id="ItemVariantId" required class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500">
|
||||
<option selected value="">Choose a variant</option>
|
||||
{{ range .data.shopItem.Variants }}
|
||||
<div class="mr-4">
|
||||
<span class="font-bold text-gray-700 dark:text-gray-300">{{ .Name }}:</span>
|
||||
<span class="text-gray-600 dark:text-gray-300">{{ .Price }}€</span>
|
||||
</div>
|
||||
<option value="{{ .ID }}">{{ .Name }} - {{ .Price }}€</option>
|
||||
{{ end }}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="flex mb-4">
|
||||
@@ -69,6 +71,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user