The easiest way to access products by their ID, for editing, is to alter the product ID in the URL after loading a product from the gridview (Administration > Catalog > Products > Manage Products). You can add a field to edit the product by product ID (works similar to "Go directly to product SKU").
1. Add the following to
Administration\Modules\Products.ascx (after the </tr> for GoDirectlyToSKU, line 77 in 1.80):
<tr>
<td class="adminTitle">
<nopCommerce:ToolTipLabel runat="server" ID="lblGoDirectlyToID" Text="<% $NopResources:Admin.Products.GoDirectlyID %>"
ToolTip="<% $NopResources:Admin.Products.GoDirectlyID.Tooltip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
</td>
<td class="adminData">
<nopCommerce:SimpleTextBox runat="server" CssClass="adminInput" ID="txtID" Width="150px"
ValidationGroup="GoDirectlyID" ErrorMessage="<% $NopResources:Admin.Products.GoDirectlyID.ErrorMessage %>">
</nopCommerce:SimpleTextBox>
<asp:Button runat="server" Text="<% $NopResources:Admin.Products.GoIDButton.Text %>"
CssClass="adminButtonBlue" ID="btnGoDirectlyToID" OnClick="btnGoDirectlyToID_Click"
ValidationGroup="GoDirectlyID" />
</td>
</tr>
2. Add the following to
Administration\Modules\Products.ascx.cs:
protected void btnGoDirectlyToID_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
try
{
int productId = 0;
if (Int32.TryParse(txtID.Text.Trim(), out productId))
{
var product = ProductManager.GetProductById(productId);
if (product != null)
{
string url = string.Format("{0}ProductDetails.aspx?ProductId={1}",
CommonHelper.GetStoreAdminLocation(),
product.ProductId.ToString());
Response.Redirect(url);
}
}
}
catch (Exception exc)
{
ProcessException(exc);
}
}
}
3. Add the following four string resources (Administration > Content Management > Localization > "Select Language"):
Name: Admin.Products.GoDirectlyID
Value:
Go directly to product IDName: Admin.Products.GoDirectlyID.Tooltip
Value:
Enter product ID and click GoName: Admin.Products.GoDirectlyID.ErrorMessage
Value:
Product ID is requiredName: Admin.Products.GoIDButton.Text
Value:
GoYou will need to recompile the project.
.