I ll would like to use nop for website with database products in 2 languages (French and English).
So i ll need to
- Add some table to database (like product_translation, category_translation ...)
- Edit lot of stored procedure like
ALTER PROCEDURE [dbo].[Nop_ProductLoadAll]
(
@ShowHidden bit = 0
)
AS
BEGIN
SET NOCOUNT ON
SELECT *
FROM [Nop_Product]
WHERE (Published = 1 or @ShowHidden = 1) and Deleted=0
order by [Name]
END
To
ALTER PROCEDURE [dbo].[Nop_ProductLoadAll]
(
@ShowHidden bit = 0,
@Language CHAR(2)
)
AS
BEGIN
SET NOCOUNT ON
SELECT *
FROM [Nop_Product]
INNER JOIN Nop_Translation_Product ON Nop_Translation_Product.Fk_Nop_Product = Nop_Product.Id
WHERE (Published = 1 or @ShowHidden = 1) and Deleted=0
AND Nop_Translation_Product.Language = @Language
order by [Name]
END
- I should edit C# to change stored procedure's call.
public override DBProduct GetByProductID(int ProductID)
{
DBProduct product = null;
if (ProductID == 0)
return product;
Database db = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
DbCommand dbCommand = db.GetStoredProcCommand("Nop_ProductLoadByPrimaryKey");
db.AddInParameter(dbCommand, "ProductID", DbType.Int32, ProductID);
db.AddInParameter(dbCommand, "Langue", DbType.String, "FR");
using (IDataReader dataReader = db.ExecuteReader(dbCommand))
{
if (dataReader.Read())
{
product = GetProductFromReader(dataReader);
}
}
return product;
}
- And finally i ll complete administration panel to allow people to add products in severals languages
Do i take the good way to make nop fully multilingual support ?
If u have any suggestion to help me to make it easy to use and easy to include in nop for everybody