Copy Specification Attributes Between 2 Existing Products

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
Hi all,

I have product 1 with 50 specification attributes. Added already.
I have product 2 and product 3. Added already but without any specifications.

These 2 products also require same 50 specification attributes as Product 1.

Is there an easy way to copy the specification attributes between two existing products.


Note:

1. Not in a position to delete and re-add the product 2 and product 3 using copy product (from product 1).
2. Actually i have around 20 products to repeat this step. For easier understanding i limited to two products as example.

Any plugin or database query to do this? Or any option in admin panel.
7 years ago
mr.mourya wrote:
Any plugin or database query to do this? Or any option in admin panel.

No option in the admin panel but very easy to do directly in the database. This example assumes the product 1 has an Id of 1 and Product 2 has an Id of 2 but you should change the 1 and 2 to the Ids of the products your copying from and to.

INSERT INTO Product_SpecificationAttribute_Mapping
           (ProductId
           ,SpecificationAttributeOptionId
           ,CustomValue
           ,AllowFiltering
           ,ShowOnProductPage
           ,DisplayOrder
           ,AttributeTypeId)
     SELECT 2 --Copying to
           ,SpecificationAttributeOptionId
           ,CustomValue
           ,AllowFiltering
           ,ShowOnProductPage
           ,DisplayOrder
           ,AttributeTypeId
       FROM Product_SpecificationAttribute_Mapping
      WHERE ProductId = 1 --Copying from
7 years ago
petemitch wrote:
Any plugin or database query to do this? Or any option in admin panel.
No option in the admin panel but very easy to do directly in the database. This example assumes the product 1 has an Id of 1 and Product 2 has an Id of 2 but you should change the 1 and 2 to the Ids of the products your copying from and to.

INSERT INTO Product_SpecificationAttribute_Mapping
           (ProductId
           ,SpecificationAttributeOptionId
           ,CustomValue
           ,AllowFiltering
           ,ShowOnProductPage
           ,DisplayOrder
           ,AttributeTypeId)
     SELECT 2 --Copying to
           ,SpecificationAttributeOptionId
           ,CustomValue
           ,AllowFiltering
           ,ShowOnProductPage
           ,DisplayOrder
           ,AttributeTypeId
       FROM Product_SpecificationAttribute_Mapping
      WHERE ProductId = 1 --Copying from


Thanks Pete, will try this.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.