Products translation in release 1.11

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 anos atrás
Ok i ll get look asap to debug this.

(I ll be in hollyday the next 2 week, i ll try do look it this week)
14 anos atrás
OK Tely,
When You can.
14 anos atrás
For the specification attributs insert 2 times, you were right.

get the alter procedure

[quote]
ALTER PROCEDURE [dbo].[Nop_SpecificationAttributeInsert]
(
  @SpecificationAttributeID int = NULL output,
  @Name nvarchar(400),
  @Language nvarchar(20)
)
AS
BEGIN
  INSERT
  INTO [Nop_SpecificationAttribute]
  (
    [Name]    
  )
  VALUES
  (
    @Name
  )

  set @SpecificationAttributeID=@@identity
  
  DECLARE @LanguageCulture nvarchar(20);

  DECLARE my_cursor CURSOR FOR
  SELECT LanguageCulture FROM nop_language


  OPEN my_cursor
  FETCH NEXT FROM my_cursor INTO @LanguageCulture

  WHILE @@FETCH_STATUS = 0
  BEGIN
    
         INSERT
      INTO [Nop_Translate_SpecificationAttribute]
      (
        [Name],
        [Language],
        [Fk_SpecificationAttributeID]    
      )
      VALUES
      (
        @Name,
        @LanguageCulture,
        @SpecificationAttributeID
      )
      
  FETCH NEXT FROM my_cursor INTO @LanguageCulture
  END

  CLOSE my_cursor
  DEALLOCATE my_cursor

END
[/quote]

I m take a look for remove your unused entry
14 anos atrás
Ok i have make some changes with delete procedure


ALTER PROCEDURE [dbo].[Nop_SpecificationAttributeDelete]
(
  @SpecificationAttributeID int
)
AS
BEGIN
  SET NOCOUNT ON
  
  DELETE FROM [Nop_Translate_SpecificationAttribute]
  WHERE FK_SpecificationAttributeId = @SpecificationAttributeID
  
  DELETE
  FROM [Nop_SpecificationAttribute]
  WHERE
    SpecificationAttributeID = @SpecificationAttributeID
END



I m making changes for all other delete who need, and i ll publish a new release.

Edit


Add theses alter too



ALTER PROCEDURE [dbo].[Nop_ProductAttributeDelete]
(
  @ProductAttributeID int
)
AS
BEGIN
  SET NOCOUNT ON
  
  DELETE FROM Nop_Translate_ProductAttribute
  WHERE FK_ProductAttributeID = @ProductAttributeID
  
  
  DELETE
  FROM [Nop_ProductAttribute]
  WHERE
    ProductAttributeID = @ProductAttributeID
END

GO


ALTER PROCEDURE [dbo].[Nop_ProductVariant_ProductAttribute_MappingDelete]
(
  @ProductVariantAttributeID int
)
AS
BEGIN
  SET NOCOUNT ON
  
  DELETE FROM Nop_Translate_Product_SpecificationAttribute_Mapping
  WHERE FK_ProductSpecificationAttributeID = @ProductVariantAttributeID
  
  DELETE
  FROM [Nop_ProductVariant_ProductAttribute_Mapping]
  WHERE
    ProductVariantAttributeID = @ProductVariantAttributeID
END

GO

ALTER PROCEDURE [dbo].[Nop_ProductVariantAttributeValueDelete]
(
  @ProductVariantAttributeValueID int
)
AS
BEGIN
  SET NOCOUNT ON
  
  DELETE FROM Nop_Translate_ProductVariantAttributeValue
  WHERE FK_ProductVariantAttributeValueID = @ProductVariantAttributeValueID
  
  DELETE
  FROM [Nop_ProductVariantAttributeValue]
  WHERE
    ProductVariantAttributeValueID = @ProductVariantAttributeValueID
END

14 anos atrás
You can download complet solution at http://dl.free.fr/jbD00nqZ9
I hope all bugs have been fixed.

I ll try to look for manufacturer soon

If u have any problem contact me.
14 anos atrás
Ok, thanks again tely!
Take a look and for 'New products' in store content. Double viewing
14 anos atrás
I ll after hollydays :)
14 anos atrás
Some code fixes:

DBProductAttributeProvider.cs:
Line 148: public abstract DBProductVariantAttributeValueCollection GetProductVariantAttributeValues(int ProductVariantAttributeID, string LanguageCulture);

SQLProductAttributeProvider.cs:
line 341: public override DBProductVariantAttributeValueCollection GetProductVariantAttributeValues(int ProductVariantAttributeID, string LanguageCulture)
line 347: db.AddInParameter(dbCommand, "Language", DbType.String, LanguageCulture);

ProductAttributeManager.cs:
line 405: DBProductVariantAttributeValueCollection dbCollection = DBProductAttributeProvider.Provider.GetProductVariantAttributeValues(ProductVariantAttributeID, NopContext.Current.WorkingLanguage.LanguageCulture);
14 anos atrás
Back from hollydays
I ll add you'r correction, thank warstar
14 anos atrás
Hi,

I used tely's partial code for ver 1.1 and implement it in 1.2 with this diferences:

1. I send LanguageID and not culture
2. All translations are in 1 database
3. Stored procedures are refactored in that way (1 translation table for all)

I installed this shopping cart 3 days ago for the first time and I liked it. I think tely's slution will have problems when you add language after you have some products so update procedure should also be refacoted to that solution to work.

In my way I have change SP and all of them returns string in selected language and if its not existing then it is returning value that is written in base table (that value is writen only on insert)

I did not keep tracks of changes :( (but I started from tely's and refactor them to suites my needs because its only 3 days I use this software and I still dont know where is what) so I dont know if this will help, but I'll be glad to share idea if you are interested.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.