which view generates the product details page

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
Hi All

am trying to move some things around in the product details page in nop 2.30

this is the controller i see which i reached after looking at the "Details" button in the _ProductBox.cshtml view

            <input type="button" value="@T("Products.Details")" class="productlistproductdetailbutton" onclick="setLocation('@Url.RouteUrl("Product", new { productId = Model.Id, SeName = Model.SeName })')" />

CatalogController.cs-----------------
--------------------------------- //product details page
        public ActionResult Product(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);

            //check whether we have at leat one variant
            if (model.ProductVariantModels.Count == 0)
                return RedirectToAction("Index", "Home");
            
            //save as recently viewed
            _recentlyViewedProductsService.AddProductToRecentlyViewedList(product.Id);

            return View(model.ProductTemplateViewPath, model);
        }
----------------------------------------

but amongst all the view i see in the views/catalog folder, none are complete views, think they are all partial (am fairly new to mvc)

in the end I am trying to move the $0.00
Qty:  and the "add to cart" and the "add to wishlist" buttons up near the "share " and email a friend button, but i havent been able to find the view that calls the other catalog views that i see there

I think this view would also be the one that generates the "name" property as "addtocart-{id}" of the buttons that we later use in the product post action to parse out the id from
----------------
  [HttpPost, ActionName("Product")]
        [ValidateInput(false)]
        public ActionResult AddToCartProduct(int productId, FormCollection form)
------------------------------

A nudge in the right direction would be highly appreciated :)
12 years ago
hacknop wrote:
Hi All

am trying to move some things around in the product details page in nop 2.30

this is the controller i see which i reached after looking at the "Details" button in the _ProductBox.cshtml view

            <input type="button" value="@T("Products.Details")" class="productlistproductdetailbutton" onclick="setLocation('@Url.RouteUrl("Product", new { productId = Model.Id, SeName = Model.SeName })')" />

CatalogController.cs-----------------
--------------------------------- //product details page
        public ActionResult Product(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);

            //check whether we have at leat one variant
            if (model.ProductVariantModels.Count == 0)
                return RedirectToAction("Index", "Home");
            
            //save as recently viewed
            _recentlyViewedProductsService.AddProductToRecentlyViewedList(product.Id);

            return View(model.ProductTemplateViewPath, model);
        }
----------------------------------------

but amongst all the view i see in the views/catalog folder, none are complete views, think they are all partial (am fairly new to mvc)

in the end I am trying to move the $0.00
Qty:  and the "add to cart" and the "add to wishlist" buttons up near the "share " and email a friend button, but i havent been able to find the view that calls the other catalog views that i see there

I think this view would also be the one that generates the "name" property as "addtocart-{id}" of the buttons that we later use in the product post action to parse out the id from
----------------
  [HttpPost, ActionName("Product")]
        [ValidateInput(false)]
        public ActionResult AddToCartProduct(int productId, FormCollection form)
------------------------------

A nudge in the right direction would be highly appreciated :)

See _ProductDetailsPictures.cshtml In Views>Catalog
12 years ago
Hi - sorry to resurrect an oldish thread = but I need to remove the short description off of the product detail page and I looked at _productDetailsPictures.cshtml and I don't find anything but "picture" stuff

nopCommerce 2.30

can someone point me to the right view?
12 years ago
Answering my own question :)

I found the files i needed to edit - they are

Views -> Catalog -> ProductTemplate.SingleVariant.cshtml
Views -> Catalog -> ProductTemplate.VariantsInGrid.cshtml

for anyone else that's hunting :)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.