Hi Andy,
Congrates btw for your MVP status. I hoping you would be able to advise me again on this thread concerning my pop up.
I have had more time to clean my work up. I have created a public action in the product controller as follows.
public ActionResult On_click_Javascript()
{
return PartialView();
}
[HttpPost, ActionName("Productpopup")]
public ActionResult Productpopup(int productId)
{
var product = _productService.GetProductById(productId);
if (product == null || product.Deleted || !product.Published)
return RedirectToAction("Index", "Home");
//prepare the model
var model = PrepareProductDetailsPageModel(product);
//CCCStockCode
model.CCCStockCode = product.CCCStockCode;
//CCCPack
model.CCCPack = product.CCCPack;
//CCCLane
model.CCCLane = product.CCCLane;
//CCCRRP
model.CCCWholesalePrice = product.CCCWholesalePrice;
////CCCRetailPrice
model.CCCRetailPrice = product.CCCRetailPrice;
//CCCMRP
model.CCCMRP = product.CCCMRP;
//CCCQTYINSTOCK
model.CCCQTYINSTOCK = product.CCCQTYINSTOCK;
//CCCBay
model.CCCBay = product.CCCBay;
//CCCSourceBarcode
model.CCCSourceBarcode = product.CCCSourceBarcode;
//CCCRetailBarcode
model.CCCRetailBarcode = product.CCCRetailBarcode;
//CCCWeight
model.CCCWeight = product.CCCWeight;
//CCCQTYPacksPerLayer
model.CCCQTYPacksPerLayer = product.CCCQTYPacksPerLayer;
//CCCQTYLayersPerPallet
model.CCCQTYLayersPerPallet = product.CCCQTYLayersPerPallet;
//CCCQTYLayersPerPallet
model.CCCQTYTotalPerPallet = product.CCCQTYTotalPerPallet;
return PartialView();
}
From this I have generated a partial view to display the a form whilst using the RootPopup provide by the Nop team Thank you!! .
@model Nop.Web.Models.Catalog.ProductModel
@{
Layout = "~/Views/Shared/_RootPopup.cshtml";
}
@using (Html.BeginRouteForm("Productpopup", new { productId = Model.Id, SeName = Model.SeName }, FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<div class="product-popup">
<div class="product-details-info">
<!--product pictures-->
@Html.Partial("_ProductDetailsPictures", Model)
<div class="overview">
<h1 class="productname">
@Model.Name
</h1>
<div class="shortdescription">
@Html.Raw(Model.ShortDescription)
</div>
<div class="StockCode">
@Model.CCCStockCode
</div>
<div class="WholesalePrice">
@Model.CCCWholesalePrice
</div>
<div class="Pack">
@Model.CCCPack
</div>
<div class="Weight">
@Model.CCCWeight
</div>
<div class="RetailPrice">
@Model.CCCRetailPrice
</div>
<div class="RetailBarcode">
@Model.CCCRetailBarcode
</div>
<div class="SourceBarcode">
@Model.CCCSourceBarcode
</div>
<div class="PacksPerLayer">
@Model.CCCQTYPacksPerLayer
</div>
<div class="LayersPerPallet">
@Model.CCCQTYLayersPerPallet
</div>
<div class="TotalPerPallet">
@Model.CCCQTYTotalPerPallet
</div>
</div>
</div>
</div>
}
I am using the the image in the _productbox to onclick create the popup displaying all data.
@model Nop.Web.Models.Catalog.ProductModel
<div class="product-item">
<h2 class="product-title">
<a href="@Url.RouteUrl("Product", new { productId = Model.Id, SeName = Model.SeName })">@Model.Name</a>
</h2>
<div class="picture">
<a href="@Url.RouteUrl("Product", new { productId = Model.Id, SeName = Model.SeName })" title="@Model.DefaultPictureModel.Title">
<img alt="@Model.DefaultPictureModel.AlternateText" src="@Model.DefaultPictureModel.ImageUrl" title="@Model.DefaultPictureModel.Title" />
</a>
</div>
The code I have placed in bold I would like to onclick to the partial popup view - I have change the code to the following
<div class="picture">
<a href= onclick= @Url.Action("Productpopup", new { Product = Model, formId = "Productpopup" }) 800, 400, true); return=false;" class="product-popup"
title="@Model.DefaultPictureModel.Title">
<img alt="@Model.DefaultPictureModel.AlternateText" src="@Model.DefaultPictureModel.ImageUrl" title="@Model.DefaultPictureModel.Title" />
</a>
</div>
but for some reason I don't know it doesnt route to the partial view - and remains on this Url http://localhost:2640/c/1/onclick=
I have updated the route infrastructure as follows too.
routes.MapLocalizedRoute("Productpopup",
"p/{productId}/{SeName}",
new { controller = "Catalog", action = "Productpopup", SeName = UrlParameter.Optional },
new { productId = @"\d+" },
new[] { "Nop.Web.Controllers" });
I hope this make sense and as always all help would be highly regarded.
Kind regards
Richard.......