Here is the new changes. Just replace the existing _ProductBox.cshtml content with the code as follows.
Hope it will work for you guys.
@model ProductOverviewModel
@using Nop.Core.Domain.Orders
@using Nop.Web.Models.Catalog;
@{
var shoppingCartTypeId = (int)ShoppingCartType.ShoppingCart;
}
<style>
.product-list .product-item .prices .actual-price
{
color: #000000;
text-align: center;
padding-top: 5px;
}
.product-list .product-item .description
{
margin: 0px 130px 0 120px;
}
.product-list .product-item .product-title a
{
padding: 0px 0px 0px 0;
}
.picturetitle
{
font-weight: bold;
color: #ffffff;
background-color: #19519d;
text-align: center;
}
</style>
<div class="product-item" data-productid="@Model.Id">
<div class="picture">
<div class="picturetitle">@Model.ProductNumber</div>
<a href="@Url.RouteUrl("Product", new { SeName = Model.SeName })" title="@Model.DefaultPictureModel.Title">
<img alt="@Model.DefaultPictureModel.AlternateText" src="@Model.DefaultPictureModel.ImageUrl" title="@Model.DefaultPictureModel.Title" />
</a>
</div>
<div class="details">
<div class="product-title">
<a href="@Url.RouteUrl("Product", new { SeName = Model.SeName })">@Model.Name</a>
</div>
<div class="description">
<br />@Html.Raw(Model.ShortDescription)
</div>
<div class="add-info">
<div class="buttons">
@*<input type="button" value="@T("Products.Details")" class="button-1 product-box-detail-button" onclick="setLocation('@Url.RouteUrl("Product", new { SeName = Model.SeName })')" />*@
@if (!Model.ProductPrice.DisableBuyButton)
{
@Html.TextBox("EnteredQuantity", 1, new { @class = "qty-input", size = 1, maxlength = 3, onkeypress = "return isNumberKey(event)" })
<input type="button" value="@(Model.ProductPrice.AvailableForPreOrder ? T("ShoppingCart.PreOrder") : T("ShoppingCart.AddToCart"))" class="button-2 product-box-add-to-cart-button"
data-url="@Url.RouteUrl("AddProductToCart", new { productId = Model.Id , shoppingCartTypeId =shoppingCartTypeId , quantity = 0 })"
/>
}
</div>
<div class="prices">
@if (!String.IsNullOrEmpty(Model.ProductPrice.OldPrice))
{
<span class="price old-price">@Model.ProductPrice.OldPrice</span>
}
<span class="price actual-price"><span style="color: red;">Your Price:</span> @Model.ProductPrice.Price</span>
</div>
@Html.Widget("productbox_add_info")
</div>
</div>
</div>
<script type="text/javascript">
//Just numeric values
function isNumberKey(evt) {
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
}
//Add to Cart Function
$(function () {
$(".add-info input.button-2").click(function () {
var url = $(this).attr("data-url");
var _quantity = $(this).prev('input.qty-input').val();
url = url.replace("0", _quantity);
AjaxCart.addproducttocart(url);
return false;
});
});
</script>