To fix this issue, run the following ALTER Sql statement to update the Smith_CopyProduct Stored Proc. As always, be sure to make a backup before making any changes to your live site:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
----------
ALTER PROCEDURE [dbo].[Smith_CopyProduct]
@ProductID INT,
@ModelNumber nvarchar(50),
@ModelName nvarchar(200),
@UnitCost money
AS
---- Copy Product ----
INSERT Smith_Products
(CategoryID, Manufacturer,ModelNumber,ModelName,ProductImage,ThumbnailImage,UnitCost,MemberPrice,QuantityOnHand,Summary,[Description],DownloadUrl,[Featured],[Archived]
,[Weight],[SortOrder],[ExcludeCoupon],[Items],[Share],[TabModuleId],[CreatedByUser],[CreatedDate],[LogicallyDeleted],[Recurring],[SubscriptionInterval],[RecurringOccurances]
,[UrlGUID],[EncryptUrl],[AddDNNRole],[RequireLogin],[UsePriPriceWght],[BundleID],[MasterBundleID],[RoleExpireDays],[TaxExempt],[PortalID],[AffiliateUrl],[RequireCoupon],ShowPDUDF,AutoGUID
,Description2,Description3,Description4,Description5,TabName1,TabName2,TabName3,TabName4,TabName5,HideThumbnail,HidePrice,PriceClass,MinOrderQty,ChargeHandling,LeadTime,HideQuantity
,PriceUnits,MaxOrderQty,Width,Height,[Length],RecurringStartDate,ExcludeVariantRecur,SalePrice,WholesalePrice,HideProduct,ShowProductRole,TaxRate,Upsell,EnableTrial,TrialInterval,TrialOccurences
,TrialAmount,UseCompanyLogo,UserEnteredAmount,Booking
)
SELECT CategoryID, Manufacturer,@ModelNumber as 'ModelNumber',@ModelName as 'ModelName',ProductImage,ThumbnailImage,@UnitCost as 'UnitCost',MemberPrice,QuantityOnHand,Summary,[Description],DownloadUrl,[Featured],[Archived]
,[Weight],[SortOrder],[ExcludeCoupon],[Items],[Share],[TabModuleId],[CreatedByUser],[CreatedDate],[LogicallyDeleted],[Recurring],[SubscriptionInterval],[RecurringOccurances]
,[UrlGUID],[EncryptUrl],[AddDNNRole],[RequireLogin],[UsePriPriceWght],[BundleID],[MasterBundleID],[RoleExpireDays],[TaxExempt],[PortalID],[AffiliateUrl],[RequireCoupon],ShowPDUDF,AutoGUID
,Description2,Description3,Description4,Description5,TabName1,TabName2,TabName3,TabName4,TabName5,HideThumbnail,HidePrice,PriceClass,MinOrderQty,ChargeHandling,LeadTime,HideQuantity
,PriceUnits,MaxOrderQty,Width,Height,[Length],RecurringStartDate,ExcludeVariantRecur,SalePrice,WholesalePrice,HideProduct,ShowProductRole,TaxRate,Upsell,EnableTrial,TrialInterval,TrialOccurences
,TrialAmount,UseCompanyLogo,UserEnteredAmount,Booking
FROM Smith_Products
where productid = @ProductID
-- Get ProductID just inserted
DECLARE @myProdID int
SELECT @myProdID=scope_identity()
------ Copy Products 2 ----
INSERT INTO Smith_Products2
(ProductID,ShowOrderAsIs,Ecard,BinLocation,NumberOfBoxes,DateAddedToInventory,Client,[Owner] )
SELECT @myProdID as 'ProductID', ShowOrderAsIs,Ecard,BinLocation,NumberOfBoxes,DateAddedToInventory,Client,[Owner]
from Smith_Products2
where productid = @ProductID
------ Copy Variant Groups ----
INSERT INTO Smith_ProductVariantGroup
(ProductID, VariantHelpURL, VariantGroup, Hide, GroupDescription )
SELECT @myProdID as 'ProductID', VariantHelpURL, VariantGroup, Hide, GroupDescription
from Smith_ProductVariantGroup
where productid = @ProductID
DECLARE @myGroupID int
SELECT @myGroupID=scope_identity()
------ Copy Variants ----
INSERT Smith_ProductVariant
(ProductID,VariantGroup,VariantName,VariantDisplayType,VariantImage,PriceAdjustment,WeightAdjustment,SortOrder,PortalId,VariantRequired,VariantGroupID
,Sku,QtyOnHand,ConditionalGroupID,VariantIconImage,VariantZoomImage,DropDownImageOption,IconImageOption,RenderTextInImage)
SELECT @myProdID as 'ProductID', VariantGroup, VariantName, VariantDisplayType, VariantImage, PriceAdjustment, WeightAdjustment, SortOrder, PortalId, VariantRequired,@myGroupID
,Sku,QtyOnHand,ConditionalGroupID,VariantIconImage,VariantZoomImage,DropDownImageOption,IconImageOption,RenderTextInImage
FROM Smith_ProductVariant
where productid = @ProductID
------ Copy Variant Groups ----
INSERT INTO Smith_ProductVariantGroup
(ProductID, VariantHelpURL, VariantGroup, Hide, GroupDescription )
SELECT @myProdID as 'ProductID', VariantHelpURL, VariantGroup, Hide, GroupDescription
from Smith_ProductVariantGroup
where productid = @ProductID
------ Copy Categories ----
INSERT INTO Smith_CategoryProduct
(CategoryID, ProductID )
SELECT CategoryID, @myProdID as 'ProductID'
from Smith_CategoryProduct
where productid = @ProductID