Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

catalog product view - add to cart

DanielŻuławski11f9f2148e49
diff --git a/src/Web/Grand.Web/Views/Shared/_CatalogProductListView.cshtml b/src/Web/Grand.Web/Views/Shared/_CatalogProductListView.cshtml
index dbaf8be47..2dc047094 100644
--- a/src/Web/Grand.Web/Views/Shared/_CatalogProductListView.cshtml
+++ b/src/Web/Grand.Web/Views/Shared/_CatalogProductListView.cshtml
@@ -240,7 +240,7 @@
@if (Model.ShowQty)
{
var qtyId = "addtocart_" + @Model.Id + "_EnteredQuantity";
- <input class="form-control input-group-addon catalog-quantity" type="number" id="@qtyId" name="@qtyId" value="1">
+ <input class="form-control input-group-addon catalog-quantity" type="number" min="1" id="@qtyId" name="@qtyId" value="1">
}
<b-button-group>
@if (!Model.ProductPrice.DisableWishlistButton && Model.ProductType == ProductType.SimpleProduct)
diff --git a/src/Web/Grand.Web/Views/Shared/_CatalogProductListViewVue.cshtml b/src/Web/Grand.Web/Views/Shared/_CatalogProductListViewVue.cshtml
index 32d073849..6f10bcd26 100644
--- a/src/Web/Grand.Web/Views/Shared/_CatalogProductListViewVue.cshtml
+++ b/src/Web/Grand.Web/Views/Shared/_CatalogProductListViewVue.cshtml
@@ -154,7 +154,7 @@
</template>
<div class="desc" v-html="Model.ShortDescription"></div>
<template v-if="Model.ShowQty">
- <input class="form-control input-group-addon catalog-quantity" type="number" :id="'addtocart_' + Model.Id + '_EnteredQuantity'" :name="'addtocart_' + Model.Id + '_EnteredQuantity'" value="1">
+ <input class="form-control input-group-addon catalog-quantity" type="number" min="1" :id="'addtocart_' + Model.Id + '_EnteredQuantity'" :name="'addtocart_' + Model.Id + '_EnteredQuantity'" value="1">
</template>
<b-button-group>
<template v-if="!Model.ProductPrice.DisableWishlistButton && Model.ProductType == 0">
@@ -192,7 +192,7 @@
</b-button>
</template>
<template v-else>
- <b-button variant="info" class="justify-content-center w-100" :onclick="'AxiosCart.addproducttocart_catalog(`@Url.RouteUrl("AddProductCatalog")/' + Model.Id +'/2`, `' + Model.ShowQty +'`,`' + Model.Id + '`);return false;'">
+ <b-button variant="info" class="justify-content-center w-100" :onclick="'AxiosCart.addproducttocart_catalog(`@Url.RouteUrl("AddProductCatalog")/' + Model.Id +'/1`, `' + Model.ShowQty +'`,`' + Model.Id + '`);return false;'">
<b-icon icon="cart2" class="mx-auto d-sm-none d-block"></b-icon>
<span class="add-cart-text d-sm-block d-none">
<template v-if="Model.ProductType == 20">
diff --git a/src/Web/Grand.Web/Views/Shared/_CatalogProductView.cshtml b/src/Web/Grand.Web/Views/Shared/_CatalogProductView.cshtml
index 3f5193732..6f1eb873c 100644
--- a/src/Web/Grand.Web/Views/Shared/_CatalogProductView.cshtml
+++ b/src/Web/Grand.Web/Views/Shared/_CatalogProductView.cshtml
@@ -241,7 +241,7 @@
@if (Model.ShowQty)
{
var qtyId = "addtocart_" + @Model.Id + "_EnteredQuantity";
- <input class="form-control input-group-addon catalog-quantity" type="number" id="@qtyId" name="@qtyId" value="1">
+ <input class="form-control input-group-addon catalog-quantity" type="number" min="1" id="@qtyId" name="@qtyId" value="1">
}
<b-button-group>
@if (!Model.ProductPrice.DisableWishlistButton && Model.ProductType == ProductType.SimpleProduct)
diff --git a/src/Web/Grand.Web/Views/Shared/_CatalogProductViewVue.cshtml b/src/Web/Grand.Web/Views/Shared/_CatalogProductViewVue.cshtml
index 5c1074b93..42f94064b 100644
--- a/src/Web/Grand.Web/Views/Shared/_CatalogProductViewVue.cshtml
+++ b/src/Web/Grand.Web/Views/Shared/_CatalogProductViewVue.cshtml
@@ -155,7 +155,7 @@
</template>
<div class="desc" v-html="Model.ShortDescription"></div>
<template v-if="Model.ShowQty">
- <input class="form-control input-group-addon catalog-quantity" type="number" :id="'addtocart_' + Model.Id + '_EnteredQuantity'" :name="'addtocart_' + Model.Id + '_EnteredQuantity'" value="1">
+ <input class="form-control input-group-addon catalog-quantity" type="number" min="1" :id="'addtocart_' + Model.Id + '_EnteredQuantity'" :name="'addtocart_' + Model.Id + '_EnteredQuantity'" value="1">
</template>
<b-button-group>
<template v-if="!Model.ProductPrice.DisableWishlistButton && Model.ProductType == 0">
@@ -193,7 +193,7 @@
</b-button>
</template>
<template v-else>
- <b-button variant="info" class="justify-content-center w-100" :onclick="'AxiosCart.addproducttocart_catalog(`@Url.RouteUrl("AddProductCatalog")/' + Model.Id +'/2`, `' + Model.ShowQty +'`,`' + Model.Id + '`);return false;'">
+ <b-button variant="info" class="justify-content-center w-100" :onclick="'AxiosCart.addproducttocart_catalog(`@Url.RouteUrl("AddProductCatalog")/' + Model.Id +'/1`, `' + Model.ShowQty +'`,`' + Model.Id + '`);return false;'">
<b-icon icon="cart2" class="mx-auto d-sm-none d-block"></b-icon>
<span class="add-cart-text d-sm-block d-none">
<template v-if="Model.ProductType == 20">