Show details button in _ProductBox no longer working in 4.6

3 weeks ago
For years I've added a 'details' button to _ProductBox.cshtml as shown below so when clicked it shows the Product Details page, exactly the same as when the product title or the product picture is clicked.  It worked fine in NOP 4.5.3 and several earlier versions.  

         <button type="button" class="button-2 product-box-add-to-cart-button" onclick="AjaxCart.addproducttocart_catalog('@addtocartlink');return false;">@(addToCartText)</button>
         @* Add a details button *@
         <input type="button" value="@T("Products.Details")" class="button-1 product-box-detail-button" onclick="setLocation('@Url.RouteUrl("Product", new { SeName = Model.SeName })')" />
     }


Now I'm trying to upgrade to NOP 4.6.6 and the button just doesn't work anymore.  If I view the page source it shows
 <input type="button" value="Details" class="button-1 product-box-detail-button" onclick="setLocation(' ')" />

Everything after setLocation has been removed somehow.  Can anyone help me understand what is happening and what to do about it?  Thanks.  
3 weeks ago
Hi
The way UrlRouteUrl works is slightly refactored in 4.6

Can you change this
         <input type="button" value="@T("Products.Details")" class="button-1 product-box-detail-button" onclick="setLocation('@Url.RouteUrl("Product", new { SeName = Model.SeName })')" />


to

         <input type="button" value="@T("Products.Details")" class="button-1 product-box-detail-button" onclick="setLocation('@(Url.RouteUrl<Product>(new { SeName = Model.SeName }))')" />

and see how it goes?
3 weeks ago
Thanks for the reply.  I just got it to work with this:
<button type="button" class="button-2 product-box-details-button" onclick="location.href='@(Url.RouteUrl<Product>(new { SeName = Model.SeName }))';return false;">@T("Products.Details")</button>
1 week ago
cds4126 wrote:
For years I've added a 'details' button to _ProductBox.cshtml as shown below so when clicked it shows the Product Details page, exactly the same as when the product title or the product picture is clicked.  It worked fine in NOP 4.5.3 and several earlier versions.  

         <button type="button" class="button-2 product-box-add-to-cart-button" onclick="AjaxCart.addproducttocart_catalog('@addtocartlink');return false;">@(addToCartText)</button>
         @* Add a details button *@
         <input type="button" value="@T("Products.Details")" class="button-1 product-box-detail-button" onclick="setLocation('@Url.RouteUrl("Product", new { SeName = Model.SeName })')" />
     }


Now I'm trying to upgrade to NOP 4.6.6 and the button just doesn't work anymore.  If I view the page source it shows
 <input type="button" value="Details" class="button-1 product-box-detail-button" onclick="setLocation(' ')" />

Everything after setLocation has been removed somehow.  Can anyone help me understand what is happening and what to do about it?  Thanks.  




Hello,
We created a plug-in for a customer.
If you are interested please PM.

Best regards