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.

Further changes with _CatalogProductViewVue

KrzysztofPajak620875ba7993
diff --git a/src/Web/Grand.Web/Views/Catalog/BrandLayout.GridOrLines.cshtml b/src/Web/Grand.Web/Views/Catalog/BrandLayout.GridOrLines.cshtml
index 94c0e91a6..af879553c 100644
--- a/src/Web/Grand.Web/Views/Catalog/BrandLayout.GridOrLines.cshtml
+++ b/src/Web/Grand.Web/Views/Catalog/BrandLayout.GridOrLines.cshtml
@@ -40,7 +40,7 @@
<div class="row">
<template v-for="Model in catalog.Model.Products">
<div class="col-lg-4 col-sm-6 col-6 product-container mb-2">
- <partial name="_CatalogProductViewVue" />
+ <partial name="_CatalogProductView" />
</div>
</template>
</div>
diff --git a/src/Web/Grand.Web/Views/Catalog/CategoryLayout.GridOrLines.cshtml b/src/Web/Grand.Web/Views/Catalog/CategoryLayout.GridOrLines.cshtml
index c0c871677..83f303b57 100644
--- a/src/Web/Grand.Web/Views/Catalog/CategoryLayout.GridOrLines.cshtml
+++ b/src/Web/Grand.Web/Views/Catalog/CategoryLayout.GridOrLines.cshtml
@@ -117,7 +117,7 @@
<div class="form-row">
<template v-for="Model in catalog.Model.FeaturedProducts">
<div class="col-lg-4 col-sm-6 col-6 product-container mb-2">
- <partial name="_CatalogProductViewVue" />
+ <partial name="_CatalogProductView" />
</div>
</template>
</div>
@@ -134,7 +134,7 @@
<div class="form-row">
<template v-for="Model in catalog.Model.Products">
<div class="col-lg-4 col-sm-6 col-6 product-container mb-2">
- <partial name="_CatalogProductViewVue" />
+ <partial name="_CatalogProductView" />
</div>
</template>
</div>
diff --git a/src/Web/Grand.Web/Views/Catalog/CollectionLayout.GridOrLines.cshtml b/src/Web/Grand.Web/Views/Catalog/CollectionLayout.GridOrLines.cshtml
index c4235b889..016181a4c 100644
--- a/src/Web/Grand.Web/Views/Catalog/CollectionLayout.GridOrLines.cshtml
+++ b/src/Web/Grand.Web/Views/Catalog/CollectionLayout.GridOrLines.cshtml
@@ -39,7 +39,7 @@
<div class="form-row">
<template v-for="Model in catalog.Model.FeaturedProducts">
<div class="col-lg-4 col-sm-6 col-6 product-container mb-2">
- <partial name="_CatalogProductViewVue" />
+ <partial name="_CatalogProductView" />
</div>
</template>
</div>
@@ -55,7 +55,7 @@
<div class="form-row">
<template v-for="Model in catalog.Model.Products">
<div class="col-lg-4 col-sm-6 col-6 product-container mb-2">
- <partial name="_CatalogProductViewVue" />
+ <partial name="_CatalogProductView" />
</div>
</template>
</div>
diff --git a/src/Web/Grand.Web/Views/Catalog/ProductsByTag.cshtml b/src/Web/Grand.Web/Views/Catalog/ProductsByTag.cshtml
index 71d8efaae..57f48c497 100644
--- a/src/Web/Grand.Web/Views/Catalog/ProductsByTag.cshtml
+++ b/src/Web/Grand.Web/Views/Catalog/ProductsByTag.cshtml
@@ -26,7 +26,7 @@
<div class="form-row">
<template v-for="Model in catalog.Model.Products">
<div class="col-lg-4 col-sm-6 col-6 product-container mb-2">
- <partial name="_CatalogProductViewVue" />
+ <partial name="_CatalogProductView" />
</div>
</template>
</div>
diff --git a/src/Web/Grand.Web/Views/Catalog/Search.cshtml b/src/Web/Grand.Web/Views/Catalog/Search.cshtml
index 6cb4ce302..f288ce9e5 100644
--- a/src/Web/Grand.Web/Views/Catalog/Search.cshtml
+++ b/src/Web/Grand.Web/Views/Catalog/Search.cshtml
@@ -114,7 +114,7 @@
<div class="form-row">
<template v-for="Model in catalog.Model.Products">
<div class="col-lg-4 col-sm-6 col-6 product-container mb-2">
- <partial name="_CatalogProductViewVue" />
+ <partial name="_CatalogProductView" />
</div>
</template>
</div>
diff --git a/src/Web/Grand.Web/Views/Catalog/Vendor.cshtml b/src/Web/Grand.Web/Views/Catalog/Vendor.cshtml
index f040b820b..5eb6d7e12 100644
--- a/src/Web/Grand.Web/Views/Catalog/Vendor.cshtml
+++ b/src/Web/Grand.Web/Views/Catalog/Vendor.cshtml
@@ -155,7 +155,7 @@
<div class="form-row">
<template v-for="Model in catalog.Model.Products">
<div class="col-lg-4 col-sm-6 col-6 product-container mb-2">
- <partial name="_CatalogProductViewVue" />
+ <partial name="_CatalogProductView" />
</div>
</template>
</div>
diff --git a/src/Web/Grand.Web/Views/Shared/_CatalogProductViewVue.cshtml b/src/Web/Grand.Web/Views/Catalog/_CatalogProductView.cshtml
similarity index 100%
rename from src/Web/Grand.Web/Views/Shared/_CatalogProductViewVue.cshtml
rename to src/Web/Grand.Web/Views/Catalog/_CatalogProductView.cshtml
diff --git a/src/Web/Grand.Web/Views/Shared/QuickView/_LinkedProducts.cshtml b/src/Web/Grand.Web/Views/Shared/QuickView/_LinkedProducts.cshtml
index c3a6b79db..3823e50e3 100644
--- a/src/Web/Grand.Web/Views/Shared/QuickView/_LinkedProducts.cshtml
+++ b/src/Web/Grand.Web/Views/Shared/QuickView/_LinkedProducts.cshtml
@@ -4,7 +4,7 @@
<div class="form-row">
<template v-for="Model in RelatedProducts">
<div class="col-xl-3 col-lg-4 col-md-4 col-sm-6 product-container mb-2">
- <partial name="_CatalogProductViewVue" />
+ <partial name="_RelatedProductView.cshtml" />
</div>
</template>
</div>
diff --git a/src/Web/Grand.Web/Views/Shared/QuickView/_RelatedProductView.cshtml b/src/Web/Grand.Web/Views/Shared/QuickView/_RelatedProductView.cshtml
new file mode 100644
index 000000000..9a1f51cd5
--- /dev/null
+++ b/src/Web/Grand.Web/Views/Shared/QuickView/_RelatedProductView.cshtml
@@ -0,0 +1,237 @@
+<article v-bind:class="{ mobile: isMobile()}" class="card product-box mb-2">
+ <div class="picture-container">
+ <a class="img-container" :href="Model.Url" :title="Model.DefaultPictureModel.Title">
+ <b-card-img-lazy :alt="Model.DefaultPictureModel.AlternateText" class="main-product-img" :src="Model.DefaultPictureModel.ImageUrl" :title="Model.DefaultPictureModel.Title"></b-card-img-lazy>
+ <template v-if="Model.SecondPictureModel.ImageUrl !== null">
+ <b-card-img-lazy class="hover-img" :alt="Model.SecondPictureModel.AlternateText" :src="Model.SecondPictureModel.ImageUrl"></b-card-img-lazy>
+ </template>
+ </a>
+ <a title="@Loc["Products.QuickView"]" class="btn btn-secondary quick-view-button" data-target="ModalQuickView" :onclick="'AxiosCart.quickview_product(`@Url.RouteUrl("QuickView-Product")/' + Model.Id + '`);return false;'">
+ <b-icon icon="search"></b-icon>
+ <span>@Loc["Products.QuickView"]</span>
+ </a>
+ <template v-if="Model.Flag !== null">
+ <div class="product-label">
+ <div class="badge badge-info">{{Model.Flag}}</div>
+ </div>
+ </template>
+ </div>
+ <div class="card-body">
+ <div class="card-title h3 mb-0">
+ <a :href="Model.Url">
+ {{Model.Name}}
+ </a>
+ </div>
+ <template v-if="Model.ShowSku && Model.Sku !== null">
+ <span class="sku">{{Model.Sku}}</span>
+ </template>
+ <div class="prices-rating">
+ <template v-if="Model.ReviewOverviewModel.AllowCustomerReviews">
+ <div class="rating">
+ <template v-if="Model.ReviewOverviewModel.TotalReviews > 0">
+ <b-form-rating :id="'rating-inline-grid-' + Model.Id" class="p-0" variant="warning" aria-label="Rating" no-border size="sm" show-value precision="2" readonly inline :value="Model.ReviewOverviewModel.RatingSum / Model.ReviewOverviewModel.TotalReviews"></b-form-rating>
+ </template>
+ <template v-else>
+ <b-form-rating :id="'rating-inline-grid-' + Model.Id" class="p-0" variant="warning" no-border size="sm" show-value precision="2" readonly inline :value="0"></b-form-rating>
+ </template>
+ <b-link :href="Model.Url">{{Model.ReviewOverviewModel.TotalReviews}} @Loc["Reviews.Overview.Reviews"]</b-link>
+ </div>
+ </template>
+ <template v-if="Model.ProductType == 40">
+ <template v-if="Model.EndTime !== null">
+ <div class="countdown-box alert alert-info w-100 mb-1">
+ <template v-if="new Date(Model.EndTime).getTime() > new Date().getTime()">
+ <countdown :end-time="new Date(Model.EndTime).getTime()">
+ <template v-slot:process="{ timeObj }">
+ <span class="col-form-label">@Loc["AddToCart.Timeleft"]</span>
+ <span>{{ `${timeObj.d}` }}</span>
+ <span>{{ `${timeObj.h}` }}</span>
+ <span>{{ `${timeObj.m}` }}</span>
+ <span>{{ `${timeObj.s}` }}</span>
+ </template>
+ <template v-slot:finish>
+ <span>@Loc["ShoppingCart.Auctionends"]</span>
+ </template>
+ </countdown>
+ </template>
+ <template v-else>
+ <div class="d-inline-flex flex-wrap justify-content-center">
+ <label class="ended-label mb-0">@Loc["ShoppingCart.Auctionends"]:</label>
+ <div class="count-date" v-html="new Date(Model.EndTimeLocalTime).toLocaleString()"></div>
+ </div>
+ </template>
+ </div>
+ </template>
+ </template>
+ <div class="prices" v-bind:class="{ 'reservation-price': Model.ProductType == 15 }">
+ <template v-if="Model.ProductType != 25">
+ <div class="actual-price price">
+ {{Model.ProductPrice.Price}}
+ </div>
+ </template>
+ <template v-else>
+ <div class="actual-price price">
+ <template v-if="Model.ProductPrice.HighestBidValue > 0 ">
+ {{Model.ProductPrice.HighestBid}}
+ </template>
+ <template v-else>
+ {{Model.ProductPrice.StartPrice}}
+ </template>
+ </div>
+ </template>
+ <template v-if="Model.ProductPrice.OldPrice !== null">
+ <div class="old-price price">
+ {{Model.ProductPrice.OldPrice}}
+ </div>
+ </template>
+ </div>
+ </div>
+ </div>
+ <div class="card-footer">
+ <template v-if="Model.SpecificationAttributeModels.length > 0">
+ <div class="spec-container">
+ <table>
+ <tbody>
+ <tr class="attr" v-for="item in Model.SpecificationAttributeModels" v-bind:id="item.SpecificationAttributeId">
+ <td>
+ <div class="spec-name">
+ {{item.SpecificationAttributeName}}
+ </div>
+ </td>
+ <td>
+ <div class="spec-value">
+ <span v-html="item.ValueRaw"></span>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </template>
+ <template v-if="Model.ProductAttributeModels.length > 0">
+ <div class="attr-container">
+ <table>
+ <tbody>
+ <tr v-for="item in Model.ProductAttributeModels" v-bind:id="item.ProductAttributeId">
+ <td>
+ <div class="attr-name">
+ {{item.Name}}
+ </div>
+ </td>
+ <td>
+ <div class="attr-value">
+ <template v-for="spec in item.Values">
+ <template v-if="item.AttributeControlType == 1 || item.AttributeControlType == 2 || item.AttributeControlType == 3 || item.AttributeControlType == 50">
+ <a class="btn btn-sm btn-light name" :href="'/'+ Model.SeName + '?' + item.Name + '=' + spec.Name">
+ {{spec.Name}}
+ </a>
+ </template>
+ <template v-if="item.AttributeControlType == 40">
+ <template v-if="spec.PictureModel.FullSizeImageUrl !== null">
+ <a class="btn btn-sm btn-light name color-container" :title="spec.Name" @@click="productImage($event)" :data-href="spec.PictureModel.FullSizeImageUrl">
+ <span class="color" :style="'background-color:' + spec.ColorSquaresRgb">&nbsp;</span>
+ </a>
+ </template>
+ <template v-else>
+ <a class="btn btn-sm btn-light name color-container" :title="spec.Name" :href="'/'+ Model.SeName + '?' + item.Name + '=' + spec.Name">
+ <span class="color" :style="'background-color:' + spec.ColorSquaresRgb">&nbsp;</span>
+ </a>
+ </template>
+ </template>
+ <template v-if="item.AttributeControlType == 45">
+ <template v-if="spec.PictureModel.FullSizeImageUrl !== null">
+ <a class="btn btn-sm btn-light p-1 name image-container" v-on:click='productImage' :data-href="spec.PictureModel.FullSizeImageUrl">
+ <img :src="spec.ImageSquaresPictureModel?.ImageUrl" :alt="spec.Name" />
+ </a>
+ </template>
+ <template v-else>
+ <a class="btn btn-sm btn-light p-1 name image-container" :href="'/'+ Model.SeName + '?' + item.Name + '=' + spec.Name">
+ <img :src="spec.ImageSquaresPictureModel?.ImageUrl" alt="spec.Name" />
+ </a>
+ </template>
+ </template>
+ </template>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </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" min="1" :id="'addtocart_' + Model.Id + '_EnteredQuantity'" :name="'addtocart_' + Model.Id + '_EnteredQuantity'" value="1">
+ </template>
+ <div class="btn-group">
+ <template v-if="!Model.ProductPrice.DisableWishlistButton && Model.ProductType == 0">
+ <template v-if="!Model.ShowQty">
+ <button v-b-tooltip.hover.bottom title="@Loc["ShoppingCart.AddToWishlist"]" class="btn btn-secondary" :onclick="'AxiosCart.addproducttocart_catalog(`@Url.RouteUrl("AddProductCatalog")/' + Model.Id +'/2?quantity=1`, `' + Model.ShowQty +'`,`' + Model.Id + '`);return false;'">
+ <span class="sr-only">AddToWishlist</span>
+ <b-icon icon="heart"></b-icon>
+ </button>
+ </template>
+ <template v-else>
+ <button v-b-tooltip.hover.bottom title="@Loc["ShoppingCart.AddToWishlist"]" class="btn btn-secondary" :onclick="'AxiosCart.addproducttocart_catalog(`@Url.RouteUrl("AddProductCatalog")/' + Model.Id +'/2`, `' + Model.ShowQty +'`,`' + Model.Id + '`);return false;'">
+ <b-icon icon="heart"></b-icon>
+ <span class="sr-only">AddToWishlist</span>
+ </button>
+ </template>
+ </template>
+ <template v-if="!Model.ProductPrice.DisableBuyButton">
+ <template v-if="!Model.ShowQty">
+ <button class="btn btn-info justify-content-center w-100" :onclick="'AxiosCart.addproducttocart_catalog(`@Url.RouteUrl("AddProductCatalog")/' + Model.Id +'/1?quantity=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">
+ @Loc["ShoppingCart.Reservation"]
+ </template>
+ <template v-else>
+ <template v-if="Model.ProductPrice.AvailableForPreOrder">
+ @Loc["ShoppingCart.PreOrder"]
+ </template>
+ <template v-else>
+ @Loc["ShoppingCart.AddToCart"]
+ </template>
+ </template>
+ </span>
+ <span class="sr-only">AddToCart</span>
+ </button>
+ </template>
+ <template v-else>
+ <button class="btn btn-info 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">
+ @Loc["ShoppingCart.Reservation"]
+ </template>
+ <template v-else>
+ <template v-if="Model.ProductPrice.AvailableForPreOrder">
+ @Loc["ShoppingCart.PreOrder"]
+ </template>
+ <template v-else>
+ @Loc["ShoppingCart.AddToCart"]
+ </template>
+ </template>
+ </span>
+ <span class="sr-only">AddToCart</span>
+ </button>
+ </template>
+ </template>
+ <template v-else>
+ <template v-if="Model.ProductType == 40">
+ <button class="btn btn-info justify-content-center w-100" :onclick="'AxiosCart.addproducttocart_catalog(`@Url.RouteUrl("AddProductCatalog")/' + Model.Id +'/1?quantity=1`, `' + Model.ShowQty +'`,`' + Model.Id + '`);return false;'">
+ <b-icon icon="hammer" class="mx-auto d-sm-none d-block"></b-icon>
+ <span class="add-cart-text d-sm-block d-none">@Loc["ShoppingCart.Bids"]</span>
+ <span class="sr-only">AddToCart</span>
+ </button>
+ </template>
+ </template>
+ <template v-if="!Model.ProductPrice.DisableAddToCompareListButton && Model.ProductType == 0">
+ <button v-b-tooltip.hover.bottom title="@Loc["ShoppingCart.AddToCompareList"]" class="btn btn-secondary" :onclick="'AxiosCart.addproducttocomparelist(`'+ Model.Id +'`, `@Loc["Products.ProductHasBeenAddedToCompareList.Link"]`, `@Url.RouteUrl("CompareProducts")`)'">
+ <span class="sr-only">AddToCompareList</span>
+ <b-icon icon="shuffle"></b-icon>
+ </button>
+ </template>
+ </div>
+ </div>
+</article>
\ No newline at end of file