Add this code in the method
public virtual async Task<Product> CopyProductAsync(Product product, string newName,
bool isPublished = true, bool copyImages = true, bool copyAssociatedProducts = true)
Old code
//store mapping
var selectedStoreIds = await _storeMappingService.GetStoresIdsWithAccessAsync(product);
foreach (var id in selectedStoreIds)
await _storeMappingService.InsertStoreMappingAsync(productCopy, id);
//tier prices
await CopyTierPricesAsync(product, productCopy);
New code
//store mapping
var selectedStoreIds = await _storeMappingService.GetStoresIdsWithAccessAsync(product);
foreach (var id in selectedStoreIds)
await _storeMappingService.InsertStoreMappingAsync(productCopy, id);
//customer role mapping
var customerRoleIds = await _aclService.GetCustomerRoleIdsWithAccessAsync(product);
foreach (var id in customerRoleIds)
await _aclService.InsertAclRecordAsync(productCopy, id);
//tier prices
await CopyTierPricesAsync(product, productCopy);
and add this code in the method
protected virtual async Task<Product> CopyBaseProductDataAsync(Product product, string newName, bool isPublished)
old code
MetaTitle = product.MetaTitle,
AllowCustomerReviews = product.AllowCustomerReviews,
LimitedToStores = product.LimitedToStores,
Sku = newSku,
ManufacturerPartNumber = product.ManufacturerPartNumber,
Gtin = product.Gtin,
new code
MetaTitle = product.MetaTitle,
AllowCustomerReviews = product.AllowCustomerReviews,
LimitedToStores = product.LimitedToStores,
SubjectToAcl = product.SubjectToAcl,
Sku = newSku,
ManufacturerPartNumber = product.ManufacturerPartNumber,
Gtin = product.Gtin,