This commit is contained in:
2021-10-21 20:46:04 +01:00
parent 60c1d0e8f8
commit 9e1c17e82a
8150 changed files with 715974 additions and 235 deletions
+24
View File
@@ -0,0 +1,24 @@
Steps:
1. Backup your existing database
2. Install nopCommerce 2.00 to your existing database (1.90).
IMPORTANT NOTE: Install it without sample data!!!
3. Backup your existing database (again)
4. Execute upgrade.sql script over your database
5. Restart your application (for example, modify Web.config file)
6. If your pictures were stored on the file system, then manually copy them into \Content\Images (previously they were stored into \images directory)
7. Now manually complete the following steps:
7a. Configure Store settings (Admin area > Configuration > Settings)
7b. Configure your currencies (Admin area > Configuration > Currencies). Ensure primary store currency and primary exchange currencies are the same
7c. Configure your measure units (Admin area > Configuration > Measures)
7d. Configure your email accounts (Admin area > Configuration > Email accounts)
7e. Update your message templates (some tokens were changed)
7f. Configure your payment, shipping, tax providers
7g. Update topics (can't be automated)
7h. Reconfigure prices by customer roles (Now we have new implementation of tier prices based on customer roles)
7i. Reconfigure discount requirements for each discount (new implementation)
8. Ensure that everything is OK
Notes:
1. Now there're several built-in customer roles. You can delete some old ones if you don't need them (e.g. 'Global Administrators' became 'Administrators')
File diff suppressed because it is too large Load Diff
+7
View File
@@ -0,0 +1,7 @@
Steps:
1. Backup your existing database
2. Execute upgrade.sql script over your database
3. Remove all files from the previous version except App_Data\Settings.txt and App_Data\InstalledPlugins.txt
4. Upload new site files
5. Copy back App_Data\Settings.txt and App_Data\InstalledPlugins.txt files
6. Ensure that everything is OK
File diff suppressed because it is too large Load Diff
+8
View File
@@ -0,0 +1,8 @@
Steps:
1. Backup your existing database
2. Execute upgrade.sql script over your database
2. Execute upgrade.additional.sql script over your database if it supports stored procedures and functions. Note that SQL Compact doesn't support them.
3. Remove all files from the previous version except App_Data\Settings.txt and App_Data\InstalledPlugins.txt
4. Upload new site files
5. Copy back App_Data\Settings.txt and App_Data\InstalledPlugins.txt files
6. Ensure that everything is OK
@@ -0,0 +1,361 @@
--additional upgrade scripts from nopCommerce 2.10 to nopCommerce 2.20
--Execure it if your database supports stored procedures and functions. Note that SQL Compact doesn't support them.
--SEO friendly name (products).
CREATE FUNCTION dbo.RemoveSpecialSeoChars (@s varchar(1024)) RETURNS varchar(1024)
WITH SCHEMABINDING
BEGIN
IF @s is null
RETURN null
DECLARE @s2 varchar(1024)
SET @s2 = ''
DECLARE @l int
SET @l = len(@s)
DECLARE @p int
SET @p = 1
while @p <= @l BEGIN
DECLARE @c int
SET @c = ascii(substring(@s, @p, 1))
IF @c between 48 and 57 or @c between 65 and 90 or @c between 97 and 122 or @c = 45
SET @s2 = @s2 + char(@c)
SET @p = @p + 1
END
IF len(@s2) = 0
RETURN null
RETURN @s2
END
GO
DECLARE cur CURSOR
FOR SELECT
Product_Picture_Mapping.PictureId,
CASE WHEN Product.SeName = '' OR Product.SeName IS NULL THEN Product.Name ELSE Product.SeName END
FROM
Product_Picture_Mapping INNER JOIN
Product ON Product_Picture_Mapping.ProductId = Product.Id
DECLARE @name nvarchar(300);
DECLARE @id int;
OPEN cur
FETCH NEXT FROM cur INTO @id, @name
WHILE (@@fetch_status <> -1)
BEGIN
IF (@@fetch_status <> -2)
BEGIN
DECLARE @seourl nvarchar(300)
--Removes diacritics
SET @seourl =
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
REPLACE(REPLACE(@name COLLATE Latin1_General_CI_AI
,'a','a'),'b','b'),'c','c'),'d','d'),'e','e'),'f', 'f'),'g','g'),'h','h'),'i','i'),'j','j'),'k','k'),'l', 'l')
,'m','m'),'n','n'),'o','o'),'p','p'),'q','q'),'r', 'r'),'s','s'),'t','t'),'u','u'),'v','v'),'w','w'),'x', 'x')
,'y','y'),'z','z')
SET @seourl = REPLACE(@seourl, ' ', '-');--Replaces spaces with -
SET @seourl = dbo.RemoveSpecialSeoChars(@seourl);--Removes special chars
SET @seourl = REPLACE(@seourl, '-', '_');
SET @seourl = REPLACE(@seourl, '__', '_');
SET @seourl = REPLACE(@seourl, '__', '_');--Repeat to remove series like ____
SET @seourl = REPLACE(@seourl, '__', '_');--Repeat to remove series like ____
PRINT @seourl
UPDATE dbo.Picture
SET SeoFilename = @seourl
WHERE Id = @id
END
FETCH NEXT FROM cur INTO @id, @name
END
CLOSE cur
DEALLOCATE cur
GO
DROP FUNCTION dbo.RemoveSpecialSeoChars
GO
--load products stored procedure
IF EXISTS (
SELECT *
FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[nop_splitstring_to_table]') AND [type] in (N'FN', N'IF', N'TF'))
DROP FUNCTION [dbo].[nop_splitstring_to_table]
GO
CREATE FUNCTION [dbo].[nop_splitstring_to_table]
(
@string NVARCHAR(1000),
@delimiter CHAR(1)
)
RETURNS @output TABLE(
data NVARCHAR(256)
)
BEGIN
DECLARE @start INT, @end INT
SELECT @start = 1, @end = CHARINDEX(@delimiter, @string)
WHILE @start < LEN(@string) + 1 BEGIN
IF @end = 0
SET @end = LEN(@string) + 1
INSERT INTO @output (data)
VALUES(SUBSTRING(@string, @start, @end - @start))
SET @start = @end + 1
SET @end = CHARINDEX(@delimiter, @string, @start)
END
RETURN
END
GO
IF EXISTS (
SELECT *
FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[nop_getnotnullnotempty]') AND [type] in (N'FN', N'IF', N'TF'))
DROP FUNCTION [dbo].[nop_getnotnullnotempty]
GO
CREATE FUNCTION [dbo].[nop_getnotnullnotempty]
(
@p1 nvarchar(max) = null,
@p2 nvarchar(max) = null
)
RETURNS nvarchar(max)
AS
BEGIN
IF @p1 IS NULL
return @p2
IF @p1 =''
return @p2
return @p1
END
GO
IF EXISTS (
SELECT *
FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[ProductLoadAllPaged]') AND OBJECTPROPERTY(object_id,N'IsProcedure') = 1)
DROP PROCEDURE [dbo].[ProductLoadAllPaged]
GO
CREATE PROCEDURE [dbo].[ProductLoadAllPaged]
(
@CategoryId int = 0,
@ManufacturerId int = 0,
@ProductTagId int = 0,
@FeaturedProducts bit = null, --0 featured only , 1 not featured only, null - load all products
@PriceMin decimal(18, 4) = null,
@PriceMax decimal(18, 4) = null,
@Keywords nvarchar(MAX) = null,
@SearchDescriptions bit = 0,
@FilteredSpecs nvarchar(300) = null, --filter by attributes (comma-separated list). e.g. 14,15,16
@LanguageId int = 0,
@OrderBy int = 0, --0 position, 5 - Name, 10 - Price, 15 - creation date
@PageIndex int = 0,
@PageSize int = 2147483644,
@ShowHidden bit = 0,
@TotalRecords int = null OUTPUT
)
AS
BEGIN
--init
DECLARE @SearchKeywords bit
SET @SearchKeywords = 1
IF (@Keywords IS NULL OR @Keywords = N'')
SET @SearchKeywords = 0
SET @Keywords = isnull(@Keywords, '')
SET @Keywords = '%' + rtrim(ltrim(@Keywords)) + '%'
--filter by attributes
SET @FilteredSpecs = isnull(@FilteredSpecs, '')
CREATE TABLE #FilteredSpecs
(
SpecificationAttributeOptionId int not null
)
INSERT INTO #FilteredSpecs (SpecificationAttributeOptionId)
SELECT CAST(data as int) FROM dbo.[nop_splitstring_to_table](@FilteredSpecs, ',');
DECLARE @SpecAttributesCount int
SELECT @SpecAttributesCount = COUNT(1) FROM #FilteredSpecs
--paging
DECLARE @PageLowerBound int
DECLARE @PageUpperBound int
DECLARE @RowsToReturn int
SET @RowsToReturn = @PageSize * (@PageIndex + 1)
SET @PageLowerBound = @PageSize * @PageIndex
SET @PageUpperBound = @PageLowerBound + @PageSize + 1
CREATE TABLE #DisplayOrderTmp
(
[Id] int IDENTITY (1, 1) NOT NULL,
[ProductId] int NOT NULL
)
INSERT INTO #DisplayOrderTmp ([ProductId])
SELECT p.Id
FROM Product p with (NOLOCK)
LEFT OUTER JOIN Product_Category_Mapping pcm with (NOLOCK) ON p.Id=pcm.ProductId
LEFT OUTER JOIN Product_Manufacturer_Mapping pmm with (NOLOCK) ON p.Id=pmm.ProductId
LEFT OUTER JOIN Product_ProductTag_Mapping pptm with (NOLOCK) ON p.Id=pptm.Product_Id
LEFT OUTER JOIN ProductVariant pv with (NOLOCK) ON p.Id = pv.ProductId
--searching of the localized values
--comment the line below if you don't use it. It'll improve the performance
LEFT OUTER JOIN LocalizedProperty lp with (NOLOCK) ON p.Id = lp.EntityId AND lp.LanguageId = @LanguageId AND lp.LocaleKeyGroup = N'Product'
WHERE
(
(
@CategoryId IS NULL OR @CategoryId=0
OR (pcm.CategoryId=@CategoryId AND (@FeaturedProducts IS NULL OR pcm.IsFeaturedProduct=@FeaturedProducts))
)
AND (
@ManufacturerId IS NULL OR @ManufacturerId=0
OR (pmm.ManufacturerId=@ManufacturerId AND (@FeaturedProducts IS NULL OR pmm.IsFeaturedProduct=@FeaturedProducts))
)
AND (
@ProductTagId IS NULL OR @ProductTagId=0
OR pptm.ProductTag_Id=@ProductTagId
)
AND (
@ShowHidden = 1 OR p.Published = 1
)
AND
(
p.Deleted=0
)
AND
(
@ShowHidden = 1 OR pv.Published = 1
)
AND
(
@ShowHidden = 1 OR pv.Deleted = 0
)
AND (
@PriceMin IS NULL OR @PriceMin=0
OR pv.Price >= @PriceMin
)
AND (
@PriceMax IS NULL OR @PriceMax=2147483644 -- max value
OR pv.Price <= @PriceMax
)
AND (
@SearchKeywords = 0 or
(
-- search standard content
patindex(@Keywords, p.name) > 0
or patindex(@Keywords, pv.name) > 0
or patindex(@Keywords, pv.sku) > 0
or (@SearchDescriptions = 1 and patindex(@Keywords, p.ShortDescription) > 0)
or (@SearchDescriptions = 1 and patindex(@Keywords, p.FullDescription) > 0)
or (@SearchDescriptions = 1 and patindex(@Keywords, pv.Description) > 0)
--searching of the localized values
--comment the lines below if you don't use it. It'll improve the performance
or (lp.LocaleKey = N'Name' and patindex(@Keywords, lp.LocaleValue) > 0)
or (@SearchDescriptions = 1 and lp.LocaleKey = N'ShortDescription' and patindex(@Keywords, lp.LocaleValue) > 0)
or (@SearchDescriptions = 1 and lp.LocaleKey = N'FullDescription' and patindex(@Keywords, lp.LocaleValue) > 0)
)
)
AND
(
@ShowHidden = 1
OR
(getutcdate() between isnull(pv.AvailableStartDateTimeUtc, '1/1/1900') and isnull(pv.AvailableEndDateTimeUtc, '1/1/2999'))
)
AND
(
--filter by specs
@SpecAttributesCount = 0
OR
(
NOT EXISTS(
SELECT 1
FROM #FilteredSpecs [fs]
WHERE [fs].SpecificationAttributeOptionId NOT IN (
SELECT psam.SpecificationAttributeOptionId
FROM dbo.Product_SpecificationAttribute_Mapping psam
WHERE psam.AllowFiltering = 1 AND psam.ProductId = p.Id
)
)
)
)
)
ORDER BY
CASE WHEN @OrderBy = 0 AND @CategoryId IS NOT NULL AND @CategoryId > 0
THEN pcm.DisplayOrder END ASC,
CASE WHEN @OrderBy = 0 AND @ManufacturerId IS NOT NULL AND @ManufacturerId > 0
THEN pmm.DisplayOrder END ASC,
CASE WHEN @OrderBy = 0
THEN p.[Name] END ASC,
CASE WHEN @OrderBy = 5
--THEN dbo.[nop_getnotnullnotempty](pl.[Name],p.[Name]) END ASC,
THEN p.[Name] END ASC,
CASE WHEN @OrderBy = 10
THEN pv.Price END ASC,
CASE WHEN @OrderBy = 15
THEN p.CreatedOnUtc END DESC
DROP TABLE #FilteredSpecs
CREATE TABLE #PageIndex
(
[IndexId] int IDENTITY (1, 1) NOT NULL,
[ProductId] int NOT NULL
)
INSERT INTO #PageIndex ([ProductId])
SELECT ProductId
FROM #DisplayOrderTmp with (NOLOCK)
GROUP BY ProductId
ORDER BY min([Id])
--total records
SET @TotalRecords = @@rowcount
SET ROWCOUNT @RowsToReturn
DROP TABLE #DisplayOrderTmp
--return products (returned properties should be synchronized with 'Product' entity)
SELECT
p.Id,
p.Name,
p.ShortDescription,
p.FullDescription,
p.AdminComment,
p.ProductTemplateId,
p.ShowOnHomePage,
p.MetaKeywords,
p.MetaDescription,
p.MetaTitle,
p.SeName,
p.AllowCustomerReviews,
p.ApprovedRatingSum,
p.NotApprovedRatingSum,
p.ApprovedTotalReviews,
p.NotApprovedTotalReviews,
p.Published,
p.Deleted,
p.CreatedOnUtc,
p.UpdatedOnUtc
FROM
#PageIndex [pi]
INNER JOIN Product p with (NOLOCK) on p.Id = [pi].[ProductId]
WHERE
[pi].IndexId > @PageLowerBound AND
[pi].IndexId < @PageUpperBound
ORDER BY
IndexId
SET ROWCOUNT 0
DROP TABLE #PageIndex
END
GO
+720
View File
@@ -0,0 +1,720 @@
--upgrade scripts from nopCommerce 2.10 to nopCommerce 2.20
--new locale resources
declare @resources xml
--a resource will be delete if its value is empty
set @resources='
<Language>
<LocaleResource Name="Admin.Configuration.Settings.Catalog.ProductsByTagPageSize">
<Value>''Products by tag'' page. Products per page</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.Catalog.ProductsByTagPageSize.Hint">
<Value>Set the page size for products on ''Products by tag'' page.</Value>
</LocaleResource>
<LocaleResource Name="Admin.Catalog.Products.Fields.PictureThumbnailUrl">
<Value>Picture</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.Order.NumberOfDaysReturnRequestAvailable">
<Value>Number of days that the return request is available</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.Order.NumberOfDaysReturnRequestAvailable.Hint">
<Value>Set a certain number of days that the Return Request Link will be available in the customer area. For example if the store owner allows returns within 30 days after purchase, then they would set this to 30. When the customer logs into the website and looks at "My Account" any orders completed more than 30 days ago would not show a Return Request button.</Value>
</LocaleResource>
<LocaleResource Name="Admin.Orders.Products.Download.DownloadCount">
<Value>Number of downloads: {0}</Value>
</LocaleResource>
<LocaleResource Name="Admin.Orders.Products.Download.ResetDownloadCount">
<Value>Reset</Value>
</LocaleResource>
<LocaleResource Name="Admin.Orders.Products.Download.ResetDownloadCount.Title">
<Value>Click to reset download count</Value>
</LocaleResource>
<LocaleResource Name="Admin.Catalog.Categories.Fields.CategoryTemplate">
<Value>Category template</Value>
</LocaleResource>
<LocaleResource Name="Admin.Catalog.Categories.Fields.CategoryTemplate.Hint">
<Value>Choose a category template. This template defines how this category (and it''s products) will be displayed.</Value>
</LocaleResource>
<LocaleResource Name="Admin.Catalog.Manufacturers.Fields.ManufacturerTemplate">
<Value>Manufacturer template</Value>
</LocaleResource>
<LocaleResource Name="Admin.Catalog.Manufacturers.Fields.ManufacturerTemplate.Hint">
<Value>Choose a manufacturer template. This template defines how this manufacturer (and it''s products) will be displayed.</Value>
</LocaleResource>
<LocaleResource Name="Admin.CurrentWishlists">
<Value>Current wishlists</Value>
</LocaleResource>
<LocaleResource Name="Admin.Catalog.Products.Variants.Fields.RequireOtherProducts">
<Value>Require other product variants are added to the cart</Value>
</LocaleResource>
<LocaleResource Name="Admin.Catalog.Products.Variants.Fields.RequireOtherProducts.Hint">
<Value>Check if this product variant requires that other product variants are added to the cart.</Value>
</LocaleResource>
<LocaleResource Name="Admin.Catalog.Products.Variants.Fields.RequiredProductVariantIds">
<Value>Required product variant IDs</Value>
</LocaleResource>
<LocaleResource Name="Admin.Catalog.Products.Variants.Fields.RequiredProductVariantIds.Hint">
<Value>Specify comma separated list of required product variant IDs. NOTE: Ensure that there are no circular references (for example, A requires B, and B requires A).</Value>
</LocaleResource>
<LocaleResource Name="Admin.Catalog.Products.Variants.Fields.AutomaticallyAddRequiredProductVariants">
<Value>Automatically add these product variants to the cart</Value>
</LocaleResource>
<LocaleResource Name="Admin.Catalog.Products.Variants.Fields.AutomaticallyAddRequiredProductVariants.Hint">
<Value>Check to automatically add this product variants to the cart.</Value>
</LocaleResource>
<LocaleResource Name="ShoppingCart.RequiredProductWarning">
<Value>This product requires the following product is added to the cart: {0}</Value>
</LocaleResource>
<LocaleResource Name="Admin.Catalog.BulkEdit">
<Value>Bulk edit product variants</Value>
</LocaleResource>
<LocaleResource Name="Admin.Catalog.BulkEdit.Fields.Name">
<Value>Name</Value>
</LocaleResource>
<LocaleResource Name="Admin.Catalog.BulkEdit.Fields.SKU">
<Value>SKU</Value>
</LocaleResource>
<LocaleResource Name="Admin.Catalog.BulkEdit.Fields.Price">
<Value>Price</Value>
</LocaleResource>
<LocaleResource Name="Admin.Catalog.BulkEdit.Fields.OldPrice">
<Value>Old price</Value>
</LocaleResource>
<LocaleResource Name="Admin.Catalog.BulkEdit.Fields.Published">
<Value>Published</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.GeneralCommon.StoreClosed">
<Value>Store closed</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.GeneralCommon.StoreClosed.Hint">
<Value>Check to close the store. Uncheck to re-open.</Value>
</LocaleResource>
<LocaleResource Name="Account.Login.WrongCredentials">
<Value>The credentials provided is incorrect</Value>
</LocaleResource>
<LocaleResource Name="Admin.System.Log.DeleteSelected">
<Value>Delete selected</Value>
</LocaleResource>
<LocaleResource Name="Admin.Header.PublicStore">
<Value>Public store</Value>
</LocaleResource>
<LocaleResource Name="Admin.Header.ClearCache">
<Value>Clear cache</Value>
</LocaleResource>
<LocaleResource Name="Admin.Header.RestartApplication">
<Value>Restart application</Value>
</LocaleResource>
<LocaleResource Name="Admin.Header.LoggedInAs">
<Value>Logged in as: {0}</Value>
</LocaleResource>
<LocaleResource Name="Admin.Header.Logout">
<Value>Logout?</Value>
</LocaleResource>
<LocaleResource Name="Order.CompletePayment">
<Value>Complete payment</Value>
</LocaleResource>
<LocaleResource Name="Order.CompletePayment.Hint">
<Value>This order is not yet paid for. To pay now click the "Complete payment" button.</Value>
</LocaleResource>
<LocaleResource Name="Account.Fields.Location">
<Value></Value>
</LocaleResource>
<LocaleResource Name="Account.Fields.Country">
<Value>Country</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.CustomerUser.StreetAddressEnabled">
<Value>''Street address'' enabled</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.CustomerUser.StreetAddressEnabled.Hint">
<Value>Set if ''Street address'' is enabled.</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.CustomerUser.StreetAddress2Enabled">
<Value>''Street address 2'' enabled</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.CustomerUser.StreetAddress2Enabled.Hint">
<Value>Set if ''Street address 2'' is enabled.</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.CustomerUser.ZipPostalCodeEnabled">
<Value>''Zip / postal code'' enabled</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.CustomerUser.ZipPostalCodeEnabled.Hint">
<Value>Set if ''Zip / postal code'' is enabled.</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.CustomerUser.CityEnabled">
<Value>''City'' enabled</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.CustomerUser.CityEnabled.Hint">
<Value>Set if ''City'' is enabled.</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.CustomerUser.CountryEnabled">
<Value>''Country'' enabled</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.CustomerUser.CountryEnabled.Hint">
<Value>Set if ''Country'' is enabled.</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.CustomerUser.StateProvinceEnabled">
<Value>''State/province'' enabled</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.CustomerUser.StateProvinceEnabled.Hint">
<Value>Set if ''State/province'' is enabled.</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.CustomerUser.CompanyEnabled">
<Value>''Company'' enabled</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.CustomerUser.CompanyEnabled.Hint">
<Value>Set if ''Company'' is enabled.</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.CustomerUser.PhoneEnabled">
<Value>''Phone number'' enabled</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.CustomerUser.PhoneEnabled.Hint">
<Value>Set if ''Phone number'' is enabled.</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.CustomerUser.FaxEnabled">
<Value>''Fax number'' enabled</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.CustomerUser.FaxEnabled.Hint">
<Value>Set if ''Fax number'' is enabled.</Value>
</LocaleResource>
<LocaleResource Name="Account.Fields.StreetAddress">
<Value>Address</Value>
</LocaleResource>
<LocaleResource Name="Account.Fields.StreetAddress2">
<Value>Address 2</Value>
</LocaleResource>
<LocaleResource Name="Account.Fields.ZipPostalCode">
<Value>Zip / postal code</Value>
</LocaleResource>
<LocaleResource Name="Account.Fields.City">
<Value>City</Value>
</LocaleResource>
<LocaleResource Name="Account.Fields.StateProvince">
<Value>State / province</Value>
</LocaleResource>
<LocaleResource Name="Account.Fields.Phone">
<Value>Phone</Value>
</LocaleResource>
<LocaleResource Name="Account.Fields.Fax">
<Value>Fax</Value>
</LocaleResource>
<LocaleResource Name="Account.YourAddress">
<Value>Your Address</Value>
</LocaleResource>
<LocaleResource Name="Account.YourContactInformation">
<Value>Your Contact Information</Value>
</LocaleResource>
<LocaleResource Name="Admin.Customers.Customers.Fields.StreetAddress">
<Value>Address</Value>
</LocaleResource>
<LocaleResource Name="Admin.Customers.Customers.Fields.StreetAddress.Hint">
<Value>The address.</Value>
</LocaleResource>
<LocaleResource Name="Admin.Customers.Customers.Fields.StreetAddress2">
<Value>Address 2</Value>
</LocaleResource>
<LocaleResource Name="Admin.Customers.Customers.Fields.StreetAddress2.Hint">
<Value>The address 2.</Value>
</LocaleResource>
<LocaleResource Name="Admin.Customers.Customers.Fields.ZipPostalCode">
<Value>Zip / postal code</Value>
</LocaleResource>
<LocaleResource Name="Admin.Customers.Customers.Fields.ZipPostalCode.Hint">
<Value>The zip / postal code.</Value>
</LocaleResource>
<LocaleResource Name="Admin.Customers.Customers.Fields.City">
<Value>City</Value>
</LocaleResource>
<LocaleResource Name="Admin.Customers.Customers.Fields.City.Hint">
<Value>The city.</Value>
</LocaleResource>
<LocaleResource Name="Admin.Customers.Customers.Fields.Country">
<Value>Country</Value>
</LocaleResource>
<LocaleResource Name="Admin.Customers.Customers.Fields.Country.Hint">
<Value>The country.</Value>
</LocaleResource>
<LocaleResource Name="Admin.Customers.Customers.Fields.StateProvince">
<Value>State / province</Value>
</LocaleResource>
<LocaleResource Name="Admin.Customers.Customers.Fields.StateProvince.Hint">
<Value>The state / province.</Value>
</LocaleResource>
<LocaleResource Name="Admin.Customers.Customers.Fields.Phone">
<Value>Phone</Value>
</LocaleResource>
<LocaleResource Name="Admin.Customers.Customers.Fields.Phone.Hint">
<Value>The phone.</Value>
</LocaleResource>
<LocaleResource Name="Admin.Customers.Customers.Fields.Fax">
<Value>Fax</Value>
</LocaleResource>
<LocaleResource Name="Admin.Customers.Customers.Fields.Fax.Hint">
<Value>The fax.</Value>
</LocaleResource>
<LocaleResource Name="Checkout.SelectBillingAddressOrEnterNewOne">
<Value>Select a billing address from your address book or enter a new address.</Value>
</LocaleResource>
<LocaleResource Name="Checkout.SelectShippingAddressOrEnterNewOne">
<Value>Select a shipping address from your address book or enter a new address.</Value>
</LocaleResource>
<LocaleResource Name="Checkout.ShippingMethod">
<Value>Shipping method</Value>
</LocaleResource>
<LocaleResource Name="Checkout.PaymentMethod">
<Value>Payment method</Value>
</LocaleResource>
<LocaleResource Name="Checkout.PaymentInfo">
<Value>Payment information</Value>
</LocaleResource>
<LocaleResource Name="Checkout.ConfirmOrder">
<Value>Confirm order</Value>
</LocaleResource>
<LocaleResource Name="Checkout.SubmittingOrder">
<Value>Submitting order information...</Value>
</LocaleResource>
<LocaleResource Name="Common.Confirm">
<Value>Confirm</Value>
</LocaleResource>
<LocaleResource Name="Common.LoadingNextStep">
<Value>Loading next step...</Value>
</LocaleResource>
<LocaleResource Name="Common.Back">
<Value>Back</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.Catalog.ShowShareButton">
<Value>Show a share button</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.Catalog.ShowShareButton.Hint">
<Value>Check to show share button on product details page.</Value>
</LocaleResource>
<LocaleResource Name="Reviews.Fields.Title.MaxLengthValidation">
<Value>Max length of product review title is {0} chars</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Languages.Fields.Rtl">
<Value>Right-to-left</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Languages.Fields.Rtl.Hint">
<Value>Check to enable right-to-left support for this language. The active theme should support RTL (have appropriate CSS style file). And it affects only public store.</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Currencies.Fields.Rate.Range">
<Value>Exchange rate must be greater than 0.</Value>
</LocaleResource>
<LocaleResource Name="Polls.VotesResultLine">
<Value>{0} ({1} vote(s) - {2}%)</Value>
</LocaleResource>
<LocaleResource Name="Polls.Votes">
<Value></Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.Catalog.IgnoreTierPrices">
<Value>Ignore tier prices (sitewide)</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.Catalog.IgnoreTierPrices.Hint">
<Value>Check to ignore tier prices (sitewide). It can significantly improve performance.</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.Catalog.IgnoreDiscounts">
<Value>Ignore discounts (sitewide)</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.Catalog.IgnoreDiscounts.Hint">
<Value>Check to ignore discounts (sitewide). It can significantly improve performance.</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.Catalog.IgnoreFeaturedProducts">
<Value>Ignore featured products (sitewide)</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.Catalog.IgnoreFeaturedProducts.Hint">
<Value>Check to ignore featured products (sitewide). It can significantly improve performance.</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.GeneralCommon.CanonicalUrlsEnabled">
<Value>Enable canonical URLs</Value>
</LocaleResource>
<LocaleResource Name="Admin.Configuration.Settings.GeneralCommon.CanonicalUrlsEnabled.Hint">
<Value>The goal of the canonicalization process is to transform a URL into a canonical URL so it is possible to determine if two syntactically different URLs may be equivalent.</Value>
</LocaleResource>
<LocaleResource Name="Search.NoResultsText">
<Value>No products were found that matched your criteria.</Value>
</LocaleResource>
</Language>
'
CREATE TABLE #LocaleStringResourceTmp
(
[ResourceName] [nvarchar](200) NOT NULL,
[ResourceValue] [nvarchar](max) NOT NULL
)
INSERT INTO #LocaleStringResourceTmp (ResourceName, ResourceValue)
SELECT nref.value('@Name', 'nvarchar(200)'), nref.value('Value[1]', 'nvarchar(MAX)')
FROM @resources.nodes('//Language/LocaleResource') AS R(nref)
--do it for each existing language
DECLARE @ExistingLanguageID int
DECLARE cur_existinglanguage CURSOR FOR
SELECT [ID]
FROM [Language]
OPEN cur_existinglanguage
FETCH NEXT FROM cur_existinglanguage INTO @ExistingLanguageID
WHILE @@FETCH_STATUS = 0
BEGIN
DECLARE @ResourceName nvarchar(200)
DECLARE @ResourceValue nvarchar(MAX)
DECLARE cur_localeresource CURSOR FOR
SELECT ResourceName, ResourceValue
FROM #LocaleStringResourceTmp
OPEN cur_localeresource
FETCH NEXT FROM cur_localeresource INTO @ResourceName, @ResourceValue
WHILE @@FETCH_STATUS = 0
BEGIN
IF (EXISTS (SELECT 1 FROM [LocaleStringResource] WHERE LanguageID=@ExistingLanguageID AND ResourceName=@ResourceName))
BEGIN
UPDATE [LocaleStringResource]
SET [ResourceValue]=@ResourceValue
WHERE LanguageID=@ExistingLanguageID AND ResourceName=@ResourceName
END
ELSE
BEGIN
INSERT INTO [LocaleStringResource]
(
[LanguageID],
[ResourceName],
[ResourceValue]
)
VALUES
(
@ExistingLanguageID,
@ResourceName,
@ResourceValue
)
END
IF (@ResourceValue is null or @ResourceValue = '')
BEGIN
DELETE [LocaleStringResource]
WHERE LanguageID=@ExistingLanguageID AND ResourceName=@ResourceName
END
FETCH NEXT FROM cur_localeresource INTO @ResourceName, @ResourceValue
END
CLOSE cur_localeresource
DEALLOCATE cur_localeresource
--fetch next language identifier
FETCH NEXT FROM cur_existinglanguage INTO @ExistingLanguageID
END
CLOSE cur_existinglanguage
DEALLOCATE cur_existinglanguage
DROP TABLE #LocaleStringResourceTmp
GO
IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'seosettings.allowunicodecharsinurls')
BEGIN
INSERT [Setting] ([Name], [Value])
VALUES (N'seosettings.allowunicodecharsinurls', N'true')
END
GO
IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'securitysettings.hideadminmenuitemsbasedonpermissions')
BEGIN
INSERT [Setting] ([Name], [Value])
VALUES (N'securitysettings.hideadminmenuitemsbasedonpermissions', N'false')
END
GO
--missed 'Manage Plugins' permission record
IF NOT EXISTS (
SELECT 1
FROM [dbo].[PermissionRecord]
WHERE [SystemName] = N'ManagePlugins')
BEGIN
INSERT [dbo].[PermissionRecord] ([Name], [SystemName], [Category])
VALUES (N'Manage Plugins', N'ManagePlugins', N'Configuration')
DECLARE @PermissionRecordId INT
SET @PermissionRecordId = @@IDENTITY
--add it to admin role be default
DECLARE @AdminCustomerRoleId int
SELECT @AdminCustomerRoleId = Id
FROM [CustomerRole]
WHERE IsSystemRole=1 and [SystemName] = N'Administrators'
INSERT [dbo].[PermissionRecord_Role_Mapping] ([PermissionRecord_Id], [CustomerRole_Id])
VALUES (@PermissionRecordId, @AdminCustomerRoleId)
END
GO
--ProductsByTags page size
IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'catalogsettings.productsbytagpagesize')
BEGIN
INSERT [Setting] ([Name], [Value])
VALUES (N'catalogsettings.productsbytagpagesize', N'4')
END
GO
IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'adminareasettings.displayproductpictures')
BEGIN
INSERT [Setting] ([Name], [Value])
VALUES (N'adminareasettings.displayproductpictures', N'true')
END
GO
--home page product box size
IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'catalogsettings.usesmallproductboxonhomepage')
BEGIN
INSERT [Setting] ([Name], [Value])
VALUES (N'catalogsettings.usesmallproductboxonhomepage', N'true')
END
GO
--return requsts
IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'ordersettings.numberofdaysreturnrequestavailable')
BEGIN
INSERT [Setting] ([Name], [Value])
VALUES (N'ordersettings.numberofdaysreturnrequestavailable', N'365')
END
GO
--Category templates
IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CategoryTemplate]') and OBJECTPROPERTY(object_id, N'IsUserTable') = 1)
BEGIN
CREATE TABLE [dbo].[CategoryTemplate](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Name] [nvarchar](400) NOT NULL,
[ViewPath] [nvarchar](400) NOT NULL,
[DisplayOrder] [int] NOT NULL,
PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
END
GO
IF NOT EXISTS (
SELECT 1
FROM [dbo].[CategoryTemplate]
WHERE [Name] = N'Products in Grid or Lines')
BEGIN
INSERT [dbo].[CategoryTemplate] ([Name], [ViewPath], [DisplayOrder])
VALUES (N'Products in Grid or Lines', N'CategoryTemplate.ProductsInGridOrLines', 1)
END
GO
IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[dbo].[Category]') and NAME='CategoryTemplateId')
BEGIN
ALTER TABLE [dbo].[Category]
ADD [CategoryTemplateId] int NULL
END
GO
UPDATE [dbo].[Category]
SET [CategoryTemplateId]=1
WHERE [CategoryTemplateId] is null
GO
ALTER TABLE [dbo].[Category] ALTER COLUMN [CategoryTemplateId] int NOT NULL
GO
--Manufacturer templates
IF NOT EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ManufacturerTemplate]') and OBJECTPROPERTY(object_id, N'IsUserTable') = 1)
BEGIN
CREATE TABLE [dbo].[ManufacturerTemplate](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Name] [nvarchar](400) NOT NULL,
[ViewPath] [nvarchar](400) NOT NULL,
[DisplayOrder] [int] NOT NULL,
PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
END
GO
IF NOT EXISTS (
SELECT 1
FROM [dbo].[ManufacturerTemplate]
WHERE [Name] = N'Products in Grid or Lines')
BEGIN
INSERT [dbo].[ManufacturerTemplate] ([Name], [ViewPath], [DisplayOrder])
VALUES (N'Products in Grid or Lines', N'ManufacturerTemplate.ProductsInGridOrLines', 1)
END
GO
IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[dbo].[Manufacturer]') and NAME='ManufacturerTemplateId')
BEGIN
ALTER TABLE [dbo].[Manufacturer]
ADD [ManufacturerTemplateId] int NULL
END
GO
UPDATE [dbo].[Manufacturer]
SET [ManufacturerTemplateId]=1
WHERE [ManufacturerTemplateId] is null
GO
ALTER TABLE [dbo].[Manufacturer] ALTER COLUMN [ManufacturerTemplateId] int NOT NULL
GO
--new 'RewardPointsWereAdded' or 'Order' entity
IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[dbo].[Order]') and NAME='RewardPointsWereAdded')
BEGIN
ALTER TABLE [dbo].[Order]
ADD [RewardPointsWereAdded] bit NULL
END
GO
UPDATE [dbo].[Order]
SET [RewardPointsWereAdded]=0
WHERE [RewardPointsWereAdded] is null
GO
ALTER TABLE [dbo].[Order] ALTER COLUMN [RewardPointsWereAdded] bit NOT NULL
GO
--Products can require that other products are added to the cart
IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[dbo].[ProductVariant]') and NAME='RequireOtherProducts')
BEGIN
ALTER TABLE [dbo].[ProductVariant]
ADD [RequireOtherProducts] bit NULL
END
GO
UPDATE [dbo].[ProductVariant]
SET [RequireOtherProducts]=0
WHERE [RequireOtherProducts] is null
GO
ALTER TABLE [dbo].[ProductVariant] ALTER COLUMN [RequireOtherProducts] bit NOT NULL
GO
IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[dbo].[ProductVariant]') and NAME='RequiredProductVariantIds')
BEGIN
ALTER TABLE [dbo].[ProductVariant]
ADD [RequiredProductVariantIds] nvarchar(1000) NULL
END
GO
IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[dbo].[ProductVariant]') and NAME='AutomaticallyAddRequiredProductVariants')
BEGIN
ALTER TABLE [dbo].[ProductVariant]
ADD [AutomaticallyAddRequiredProductVariants] bit NULL
END
GO
UPDATE [dbo].[ProductVariant]
SET [AutomaticallyAddRequiredProductVariants]=0
WHERE [AutomaticallyAddRequiredProductVariants] is null
GO
ALTER TABLE [dbo].[ProductVariant] ALTER COLUMN [AutomaticallyAddRequiredProductVariants] bit NOT NULL
GO
--email accounts and queued emails issue fix
IF EXISTS (SELECT 1
FROM sys.objects
WHERE name = 'QueuedEmail_EmailAccount'
AND parent_object_id = Object_id('QueuedEmail')
AND Objectproperty(object_id,N'IsForeignKey') = 1)
ALTER TABLE dbo.QueuedEmail
DROP CONSTRAINT QueuedEmail_EmailAccount
GO
ALTER TABLE [dbo].[QueuedEmail] WITH CHECK ADD CONSTRAINT [QueuedEmail_EmailAccount] FOREIGN KEY([EmailAccountId])
REFERENCES [dbo].[EmailAccount] ([Id])
ON DELETE CASCADE
GO
--store closed option
IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'storeinformationsettings.storeclosed')
BEGIN
INSERT [Setting] ([Name], [Value])
VALUES (N'storeinformationsettings.storeclosed', N'false')
END
GO
UPDATE [dbo].[Currency]
SET [CurrencyCode]=N'RUB'
WHERE [CurrencyCode]=N'RUR'
GO
--a value indicating whether customers are allowed to repost (complete) payments for redirection payment methods
IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'paymentsettings.allowrepostingpayments')
BEGIN
INSERT [Setting] ([Name], [Value])
VALUES (N'paymentsettings.allowrepostingpayments', N'true')
END
GO
UPDATE [dbo].[CustomerAttribute]
SET [Key]=N'CountryId'
WHERE [Key]=N'Location'
GO
--SEO friendly image name.
IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[dbo].[Picture]') and NAME='SeoFilename')
BEGIN
ALTER TABLE [dbo].[Picture]
ADD [SeoFilename] nvarchar(300) NULL
END
GO
--Show a share button
IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'catalogsettings.showsharebutton')
BEGIN
INSERT [Setting] ([Name], [Value])
VALUES (N'catalogsettings.showsharebutton', N'true')
END
GO
--RTL support
IF NOT EXISTS (SELECT 1 FROM sys.columns WHERE object_id=object_id('[dbo].[Language]') and NAME='Rtl')
BEGIN
ALTER TABLE [dbo].[Language]
ADD [Rtl] bit NULL
END
GO
UPDATE [dbo].[Language]
SET [Rtl]=0
WHERE [Rtl] is null
GO
ALTER TABLE [dbo].[Language] ALTER COLUMN [Rtl] bit NOT NULL
GO
--stored procedures support
IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'commonsettings.usestoredproceduresifsupported')
BEGIN
INSERT [Setting] ([Name], [Value])
VALUES (N'commonsettings.usestoredproceduresifsupported', N'true')
END
GO
+10
View File
@@ -0,0 +1,10 @@
Steps:
1. Backup your existing database
2. Execute upgrade.sql script over your database
3. Remove all files from the previous version except App_Data\Settings.txt and App_Data\InstalledPlugins.txt
4. Upload new site files
5. Copy back App_Data\Settings.txt and App_Data\InstalledPlugins.txt files
6. Ensure that everything is OK
Notes:
1. If you stored your pictures on the file system, then also backup them (\Content\Images\) and copy back after upgrade
File diff suppressed because it is too large Load Diff
+10
View File
@@ -0,0 +1,10 @@
Steps:
1. Backup your existing database
2. Execute upgrade.sql script over your database
3. Remove all files from the previous version except App_Data\Settings.txt and App_Data\InstalledPlugins.txt
4. Upload new site files
5. Copy back App_Data\Settings.txt and App_Data\InstalledPlugins.txt files
6. Ensure that everything is OK
Notes:
1. If you stored your pictures on the file system, then also backup them (\Content\Images\) and copy back after upgrade
File diff suppressed because it is too large Load Diff
+10
View File
@@ -0,0 +1,10 @@
Steps:
1. Backup your existing database
2. Execute upgrade.sql script over your database
3. Remove all files from the previous version except App_Data\Settings.txt and App_Data\InstalledPlugins.txt
4. Upload new site files
5. Copy back App_Data\Settings.txt and App_Data\InstalledPlugins.txt files
6. Ensure that everything is OK
Notes:
1. If you stored your pictures on the file system, then also backup them (\Content\Images\) and copy back after upgrade
File diff suppressed because it is too large Load Diff
+10
View File
@@ -0,0 +1,10 @@
Steps:
1. Backup your existing database
2. Execute upgrade.sql script over your database
3. Remove all files from the previous version except App_Data\Settings.txt and App_Data\InstalledPlugins.txt
4. Upload new site files
5. Copy back App_Data\Settings.txt and App_Data\InstalledPlugins.txt files
6. Ensure that everything is OK
Notes:
1. If you stored your pictures on the file system, then also backup them (\Content\Images\) and copy back after upgrade
File diff suppressed because it is too large Load Diff
+10
View File
@@ -0,0 +1,10 @@
Steps:
1. Backup your existing database
2. Execute upgrade.sql script over your database
3. Remove all files from the previous version except App_Data\Settings.txt and App_Data\InstalledPlugins.txt
4. Upload new site files
5. Copy back App_Data\Settings.txt and App_Data\InstalledPlugins.txt files
6. Ensure that everything is OK
Notes:
1. If you stored your pictures on the file system, then also backup them (\Content\Images\) and copy back after upgrade
+804
View File
@@ -0,0 +1,804 @@
--upgrade scripts from nopCommerce 2.60 to nopCommerce 2.65
--new locale resources
declare @resources xml
--a resource will be delete if its value is empty
set @resources='
<Language>
<LocaleResource Name="ShoppingCart.QuantityShouldPositive">
<Value>Quantity should be positive</Value>
</LocaleResource>
<LocaleResource Name="Checkout.Button">
<Value>Checkout</Value>
</LocaleResource>
<LocaleResource Name="ContactUs.FullName.Hint">
<Value>Enter your name</Value>
</LocaleResource>
<LocaleResource Name="ContactUs.Email.Hint">
<Value>Enter your email address</Value>
</LocaleResource>
<LocaleResource Name="ContactUs.Enquiry.Hint">
<Value>Enter your enquiry</Value>
</LocaleResource>
<LocaleResource Name="Products.EmailAFriend.FriendEmail.Hint">
<Value>Enter friend''s email</Value>
</LocaleResource>
<LocaleResource Name="Products.EmailAFriend.YourEmailAddress.Hint">
<Value>Enter your email address</Value>
</LocaleResource>
<LocaleResource Name="Products.EmailAFriend.PersonalMessage.Hint">
<Value>Enter personal message (optional)</Value>
</LocaleResource>
<LocaleResource Name="Wishlist.EmailAFriend.FriendEmail.Hint">
<Value>Enter friend''s email</Value>
</LocaleResource>
<LocaleResource Name="Wishlist.EmailAFriend.YourEmailAddress.Hint">
<Value>Enter your email address</Value>
</LocaleResource>
<LocaleResource Name="Wishlist.EmailAFriend.PersonalMessage.Hint">
<Value>Enter personal message (optional)</Value>
</LocaleResource>
<LocaleResource Name="Products.ProductHasBeenAddedToTheCart">
<Value>The product has been added to your shopping cart</Value>
</LocaleResource>
<LocaleResource Name="Products.ProductHasBeenAddedToTheCart.Link">
<Value><![CDATA[The product has been added to your <a href="{0}">shopping cart</a>]]></Value>
</LocaleResource>
<LocaleResource Name="Products.ProductHasBeenAddedToTheWishlist">
<Value>The product has been added to your wishlist</Value>
</LocaleResource>
<LocaleResource Name="Products.ProductHasBeenAddedToTheWishlist.Link">
<Value><![CDATA[The product has been added to your <a href="{0}">wishlist</a>]]></Value>
</LocaleResource>
</Language>
'
CREATE TABLE #LocaleStringResourceTmp
(
[ResourceName] [nvarchar](200) NOT NULL,
[ResourceValue] [nvarchar](max) NOT NULL
)
INSERT INTO #LocaleStringResourceTmp (ResourceName, ResourceValue)
SELECT nref.value('@Name', 'nvarchar(200)'), nref.value('Value[1]', 'nvarchar(MAX)')
FROM @resources.nodes('//Language/LocaleResource') AS R(nref)
--do it for each existing language
DECLARE @ExistingLanguageID int
DECLARE cur_existinglanguage CURSOR FOR
SELECT [ID]
FROM [Language]
OPEN cur_existinglanguage
FETCH NEXT FROM cur_existinglanguage INTO @ExistingLanguageID
WHILE @@FETCH_STATUS = 0
BEGIN
DECLARE @ResourceName nvarchar(200)
DECLARE @ResourceValue nvarchar(MAX)
DECLARE cur_localeresource CURSOR FOR
SELECT ResourceName, ResourceValue
FROM #LocaleStringResourceTmp
OPEN cur_localeresource
FETCH NEXT FROM cur_localeresource INTO @ResourceName, @ResourceValue
WHILE @@FETCH_STATUS = 0
BEGIN
IF (EXISTS (SELECT 1 FROM [LocaleStringResource] WHERE LanguageID=@ExistingLanguageID AND ResourceName=@ResourceName))
BEGIN
UPDATE [LocaleStringResource]
SET [ResourceValue]=@ResourceValue
WHERE LanguageID=@ExistingLanguageID AND ResourceName=@ResourceName
END
ELSE
BEGIN
INSERT INTO [LocaleStringResource]
(
[LanguageId],
[ResourceName],
[ResourceValue]
)
VALUES
(
@ExistingLanguageID,
@ResourceName,
@ResourceValue
)
END
IF (@ResourceValue is null or @ResourceValue = '')
BEGIN
DELETE [LocaleStringResource]
WHERE LanguageID=@ExistingLanguageID AND ResourceName=@ResourceName
END
FETCH NEXT FROM cur_localeresource INTO @ResourceName, @ResourceValue
END
CLOSE cur_localeresource
DEALLOCATE cur_localeresource
--fetch next language identifier
FETCH NEXT FROM cur_existinglanguage INTO @ExistingLanguageID
END
CLOSE cur_existinglanguage
DEALLOCATE cur_existinglanguage
DROP TABLE #LocaleStringResourceTmp
GO
IF NOT EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'securitysettings.forcesslforallpages')
BEGIN
INSERT [Setting] ([Name], [Value])
VALUES (N'securitysettings.forcesslforallpages', N'false')
END
GO
IF EXISTS (
SELECT *
FROM sys.objects
WHERE object_id = OBJECT_ID(N'[ProductLoadAllPaged]') AND OBJECTPROPERTY(object_id,N'IsProcedure') = 1)
DROP PROCEDURE [ProductLoadAllPaged]
GO
CREATE PROCEDURE [ProductLoadAllPaged]
(
@CategoryIds nvarchar(MAX) = null, --a list of category IDs (comma-separated list). e.g. 1,2,3
@ManufacturerId int = 0,
@ProductTagId int = 0,
@FeaturedProducts bit = null, --0 featured only , 1 not featured only, null - load all products
@PriceMin decimal(18, 4) = null,
@PriceMax decimal(18, 4) = null,
@Keywords nvarchar(4000) = null,
@SearchDescriptions bit = 0, --a value indicating whether to search by a specified "keyword" in product descriptions
@SearchProductTags bit = 0, --a value indicating whether to search by a specified "keyword" in product tags
@UseFullTextSearch bit = 0,
@FullTextMode int = 0, --0 using CONTAINS with <prefix_term>, 5 - using CONTAINS and OR with <prefix_term>, 10 - using CONTAINS and AND with <prefix_term>
@FilteredSpecs nvarchar(MAX) = null, --filter by attributes (comma-separated list). e.g. 14,15,16
@LanguageId int = 0,
@OrderBy int = 0, --0 position, 5 - Name: A to Z, 6 - Name: Z to A, 10 - Price: Low to High, 11 - Price: High to Low, 15 - creation date
@PageIndex int = 0,
@PageSize int = 2147483644,
@ShowHidden bit = 0,
@LoadFilterableSpecificationAttributeOptionIds bit = 0, --a value indicating whether we should load the specification attribute option identifiers applied to loaded products (all pages)
@FilterableSpecificationAttributeOptionIds nvarchar(MAX) = null OUTPUT, --the specification attribute option identifiers applied to loaded products (all pages). returned as a comma separated list of identifiers
@TotalRecords int = null OUTPUT
)
AS
BEGIN
/* Products that filtered by keywords */
CREATE TABLE #KeywordProducts
(
[ProductId] int NOT NULL
)
DECLARE
@SearchKeywords bit,
@sql nvarchar(max),
@sql_orderby nvarchar(max)
SET NOCOUNT ON
--filter by keywords
SET @Keywords = isnull(@Keywords, '')
SET @Keywords = rtrim(ltrim(@Keywords))
IF ISNULL(@Keywords, '') != ''
BEGIN
SET @SearchKeywords = 1
IF @UseFullTextSearch = 1
BEGIN
--full-text search
IF @FullTextMode = 0
BEGIN
--0 - using CONTAINS with <prefix_term>
SET @Keywords = ' "' + @Keywords + '*" '
END
ELSE
BEGIN
--5 - using CONTAINS and OR with <prefix_term>
--10 - using CONTAINS and AND with <prefix_term>
--remove wrong chars (' ")
SET @Keywords = REPLACE(@Keywords, '''', '')
SET @Keywords = REPLACE(@Keywords, '"', '')
--clean multiple spaces
WHILE CHARINDEX(' ', @Keywords) > 0
SET @Keywords = REPLACE(@Keywords, ' ', ' ')
DECLARE @concat_term nvarchar(100)
IF @FullTextMode = 5 --5 - using CONTAINS and OR with <prefix_term>
BEGIN
SET @concat_term = 'OR'
END
IF @FullTextMode = 10 --10 - using CONTAINS and AND with <prefix_term>
BEGIN
SET @concat_term = 'AND'
END
--now let's build search string
declare @fulltext_keywords nvarchar(4000)
set @fulltext_keywords = N''
declare @index int
set @index = CHARINDEX(' ', @Keywords, 0)
-- if index = 0, then only one field was passed
IF(@index = 0)
set @fulltext_keywords = ' "' + @Keywords + '*" '
ELSE
BEGIN
DECLARE @first BIT
SET @first = 1
WHILE @index > 0
BEGIN
IF (@first = 0)
SET @fulltext_keywords = @fulltext_keywords + ' ' + @concat_term + ' '
ELSE
SET @first = 0
SET @fulltext_keywords = @fulltext_keywords + '"' + SUBSTRING(@Keywords, 1, @index - 1) + '*"'
SET @Keywords = SUBSTRING(@Keywords, @index + 1, LEN(@Keywords) - @index)
SET @index = CHARINDEX(' ', @Keywords, 0)
end
-- add the last field
IF LEN(@fulltext_keywords) > 0
SET @fulltext_keywords = @fulltext_keywords + ' ' + @concat_term + ' ' + '"' + SUBSTRING(@Keywords, 1, LEN(@Keywords)) + '*"'
END
SET @Keywords = @fulltext_keywords
END
END
ELSE
BEGIN
--usual search by PATINDEX
SET @Keywords = '%' + @Keywords + '%'
END
--PRINT @Keywords
--product name
SET @sql = '
INSERT INTO #KeywordProducts ([ProductId])
SELECT p.Id
FROM Product p with (NOLOCK)
WHERE '
IF @UseFullTextSearch = 1
SET @sql = @sql + 'CONTAINS(p.[Name], @Keywords) '
ELSE
SET @sql = @sql + 'PATINDEX(@Keywords, p.[Name]) > 0 '
--product variant name
SET @sql = @sql + '
UNION
SELECT pv.ProductId
FROM ProductVariant pv with (NOLOCK)
WHERE '
IF @UseFullTextSearch = 1
SET @sql = @sql + 'CONTAINS(pv.[Name], @Keywords) '
ELSE
SET @sql = @sql + 'PATINDEX(@Keywords, pv.[Name]) > 0 '
--SKU
SET @sql = @sql + '
UNION
SELECT pv.ProductId
FROM ProductVariant pv with (NOLOCK)
WHERE '
IF @UseFullTextSearch = 1
SET @sql = @sql + 'CONTAINS(pv.[Sku], @Keywords) '
ELSE
SET @sql = @sql + 'PATINDEX(@Keywords, pv.[Sku]) > 0 '
--localized product name
SET @sql = @sql + '
UNION
SELECT lp.EntityId
FROM LocalizedProperty lp with (NOLOCK)
WHERE
lp.LocaleKeyGroup = N''Product''
AND lp.LanguageId = ' + ISNULL(CAST(@LanguageId AS nvarchar(max)), '0') + '
AND lp.LocaleKey = N''Name'''
IF @UseFullTextSearch = 1
SET @sql = @sql + ' AND CONTAINS(lp.[LocaleValue], @Keywords) '
ELSE
SET @sql = @sql + ' AND PATINDEX(@Keywords, lp.[LocaleValue]) > 0 '
IF @SearchDescriptions = 1
BEGIN
--product short description
SET @sql = @sql + '
UNION
SELECT p.Id
FROM Product p with (NOLOCK)
WHERE '
IF @UseFullTextSearch = 1
SET @sql = @sql + 'CONTAINS(p.[ShortDescription], @Keywords) '
ELSE
SET @sql = @sql + 'PATINDEX(@Keywords, p.[ShortDescription]) > 0 '
--product full description
SET @sql = @sql + '
UNION
SELECT p.Id
FROM Product p with (NOLOCK)
WHERE '
IF @UseFullTextSearch = 1
SET @sql = @sql + 'CONTAINS(p.[FullDescription], @Keywords) '
ELSE
SET @sql = @sql + 'PATINDEX(@Keywords, p.[FullDescription]) > 0 '
--product variant description
SET @sql = @sql + '
UNION
SELECT pv.ProductId
FROM ProductVariant pv with (NOLOCK)
WHERE '
IF @UseFullTextSearch = 1
SET @sql = @sql + 'CONTAINS(pv.[Description], @Keywords) '
ELSE
SET @sql = @sql + 'PATINDEX(@Keywords, pv.[Description]) > 0 '
--localized product short description
SET @sql = @sql + '
UNION
SELECT lp.EntityId
FROM LocalizedProperty lp with (NOLOCK)
WHERE
lp.LocaleKeyGroup = N''Product''
AND lp.LanguageId = ' + ISNULL(CAST(@LanguageId AS nvarchar(max)), '0') + '
AND lp.LocaleKey = N''ShortDescription'''
IF @UseFullTextSearch = 1
SET @sql = @sql + ' AND CONTAINS(lp.[LocaleValue], @Keywords) '
ELSE
SET @sql = @sql + ' AND PATINDEX(@Keywords, lp.[LocaleValue]) > 0 '
--localized product full description
SET @sql = @sql + '
UNION
SELECT lp.EntityId
FROM LocalizedProperty lp with (NOLOCK)
WHERE
lp.LocaleKeyGroup = N''Product''
AND lp.LanguageId = ' + ISNULL(CAST(@LanguageId AS nvarchar(max)), '0') + '
AND lp.LocaleKey = N''FullDescription'''
IF @UseFullTextSearch = 1
SET @sql = @sql + ' AND CONTAINS(lp.[LocaleValue], @Keywords) '
ELSE
SET @sql = @sql + ' AND PATINDEX(@Keywords, lp.[LocaleValue]) > 0 '
END
IF @SearchProductTags = 1
BEGIN
--product tag
SET @sql = @sql + '
UNION
SELECT pptm.Product_Id
FROM Product_ProductTag_Mapping pptm with(NOLOCK) INNER JOIN ProductTag pt with(NOLOCK) ON pt.Id = pptm.ProductTag_Id
WHERE '
IF @UseFullTextSearch = 1
SET @sql = @sql + 'CONTAINS(pt.[Name], @Keywords) '
ELSE
SET @sql = @sql + 'PATINDEX(@Keywords, pt.[Name]) > 0 '
--localized product tag
SET @sql = @sql + '
UNION
SELECT pptm.Product_Id
FROM LocalizedProperty lp with (NOLOCK) INNER JOIN Product_ProductTag_Mapping pptm with(NOLOCK) ON lp.EntityId = pptm.ProductTag_Id
WHERE
lp.LocaleKeyGroup = N''ProductTag''
AND lp.LanguageId = ' + ISNULL(CAST(@LanguageId AS nvarchar(max)), '0') + '
AND lp.LocaleKey = N''Name'''
IF @UseFullTextSearch = 1
SET @sql = @sql + ' AND CONTAINS(lp.[LocaleValue], @Keywords) '
ELSE
SET @sql = @sql + ' AND PATINDEX(@Keywords, lp.[LocaleValue]) > 0 '
END
--PRINT (@sql)
EXEC sp_executesql @sql, N'@Keywords nvarchar(4000)', @Keywords
END
ELSE
BEGIN
SET @SearchKeywords = 0
END
--filter by category IDs
SET @CategoryIds = isnull(@CategoryIds, '')
CREATE TABLE #FilteredCategoryIds
(
CategoryId int not null
)
INSERT INTO #FilteredCategoryIds (CategoryId)
SELECT CAST(data as int) FROM [nop_splitstring_to_table](@CategoryIds, ',')
DECLARE @CategoryIdsCount int
SET @CategoryIdsCount = (SELECT COUNT(1) FROM #FilteredCategoryIds)
--filter by attributes
SET @FilteredSpecs = isnull(@FilteredSpecs, '')
CREATE TABLE #FilteredSpecs
(
SpecificationAttributeOptionId int not null
)
INSERT INTO #FilteredSpecs (SpecificationAttributeOptionId)
SELECT CAST(data as int) FROM [nop_splitstring_to_table](@FilteredSpecs, ',')
DECLARE @SpecAttributesCount int
SET @SpecAttributesCount = (SELECT COUNT(1) FROM #FilteredSpecs)
--paging
DECLARE @PageLowerBound int
DECLARE @PageUpperBound int
DECLARE @RowsToReturn int
SET @RowsToReturn = @PageSize * (@PageIndex + 1)
SET @PageLowerBound = @PageSize * @PageIndex
SET @PageUpperBound = @PageLowerBound + @PageSize + 1
CREATE TABLE #DisplayOrderTmp
(
[Id] int IDENTITY (1, 1) NOT NULL,
[ProductId] int NOT NULL
)
SET @sql = '
INSERT INTO #DisplayOrderTmp ([ProductId])
SELECT p.Id
FROM
Product p with (NOLOCK)'
IF @CategoryIdsCount > 0
BEGIN
SET @sql = @sql + '
LEFT JOIN Product_Category_Mapping pcm with (NOLOCK)
ON p.Id = pcm.ProductId'
END
IF @ManufacturerId > 0
BEGIN
SET @sql = @sql + '
LEFT JOIN Product_Manufacturer_Mapping pmm with (NOLOCK)
ON p.Id = pmm.ProductId'
END
IF ISNULL(@ProductTagId, 0) != 0
BEGIN
SET @sql = @sql + '
LEFT JOIN Product_ProductTag_Mapping pptm with (NOLOCK)
ON p.Id = pptm.Product_Id'
END
IF @ShowHidden = 0
OR @PriceMin > 0
OR @PriceMax > 0
OR @OrderBy = 10 /* Price: Low to High */
OR @OrderBy = 11 /* Price: High to Low */
BEGIN
SET @sql = @sql + '
LEFT JOIN ProductVariant pv with (NOLOCK)
ON p.Id = pv.ProductId'
END
--searching by keywords
IF @SearchKeywords = 1
BEGIN
SET @sql = @sql + '
JOIN #KeywordProducts kp
ON p.Id = kp.ProductId'
END
SET @sql = @sql + '
WHERE
p.Deleted = 0'
--filter by category
IF @CategoryIdsCount > 0
BEGIN
SET @sql = @sql + '
AND pcm.CategoryId IN (SELECT CategoryId FROM #FilteredCategoryIds)'
IF @FeaturedProducts IS NOT NULL
BEGIN
SET @sql = @sql + '
AND pcm.IsFeaturedProduct = ' + CAST(@FeaturedProducts AS nvarchar(max))
END
END
--filter by manufacturer
IF @ManufacturerId > 0
BEGIN
SET @sql = @sql + '
AND pmm.ManufacturerId = ' + CAST(@ManufacturerId AS nvarchar(max))
IF @FeaturedProducts IS NOT NULL
BEGIN
SET @sql = @sql + '
AND pmm.IsFeaturedProduct = ' + CAST(@FeaturedProducts AS nvarchar(max))
END
END
--filter by product tag
IF ISNULL(@ProductTagId, 0) != 0
BEGIN
SET @sql = @sql + '
AND pptm.ProductTag_Id = ' + CAST(@ProductTagId AS nvarchar(max))
END
IF @ShowHidden = 0
BEGIN
SET @sql = @sql + '
AND p.Published = 1
AND pv.Published = 1
AND pv.Deleted = 0
AND (getutcdate() BETWEEN ISNULL(pv.AvailableStartDateTimeUtc, ''1/1/1900'') and ISNULL(pv.AvailableEndDateTimeUtc, ''1/1/2999''))'
END
--min price
IF @PriceMin > 0
BEGIN
SET @sql = @sql + '
AND (
(
--special price (specified price and valid date range)
(pv.SpecialPrice IS NOT NULL AND (getutcdate() BETWEEN isnull(pv.SpecialPriceStartDateTimeUtc, ''1/1/1900'') AND isnull(pv.SpecialPriceEndDateTimeUtc, ''1/1/2999'')))
AND
(pv.SpecialPrice >= ' + CAST(@PriceMin AS nvarchar(max)) + ')
)
OR
(
--regular price (price isnt specified or date range isnt valid)
(pv.SpecialPrice IS NULL OR (getutcdate() NOT BETWEEN isnull(pv.SpecialPriceStartDateTimeUtc, ''1/1/1900'') AND isnull(pv.SpecialPriceEndDateTimeUtc, ''1/1/2999'')))
AND
(pv.Price >= ' + CAST(@PriceMin AS nvarchar(max)) + ')
)
)'
END
--max price
IF @PriceMax > 0
BEGIN
SET @sql = @sql + '
AND (
(
--special price (specified price and valid date range)
(pv.SpecialPrice IS NOT NULL AND (getutcdate() BETWEEN isnull(pv.SpecialPriceStartDateTimeUtc, ''1/1/1900'') AND isnull(pv.SpecialPriceEndDateTimeUtc, ''1/1/2999'')))
AND
(pv.SpecialPrice <= ' + CAST(@PriceMax AS nvarchar(max)) + ')
)
OR
(
--regular price (price isnt specified or date range isnt valid)
(pv.SpecialPrice IS NULL OR (getutcdate() NOT BETWEEN isnull(pv.SpecialPriceStartDateTimeUtc, ''1/1/1900'') AND isnull(pv.SpecialPriceEndDateTimeUtc, ''1/1/2999'')))
AND
(pv.Price <= ' + CAST(@PriceMax AS nvarchar(max)) + ')
)
)'
END
--filter by specs
IF @SpecAttributesCount > 0
BEGIN
SET @sql = @sql + '
AND NOT EXISTS (
SELECT 1
FROM
#FilteredSpecs [fs]
WHERE
[fs].SpecificationAttributeOptionId NOT IN (
SELECT psam.SpecificationAttributeOptionId
FROM Product_SpecificationAttribute_Mapping psam
WHERE psam.AllowFiltering = 1 AND psam.ProductId = p.Id
)
)'
END
--sorting
SET @sql_orderby = ''
IF @OrderBy = 5 /* Name: A to Z */
SET @sql_orderby = ' p.[Name] ASC'
ELSE IF @OrderBy = 6 /* Name: Z to A */
SET @sql_orderby = ' p.[Name] DESC'
ELSE IF @OrderBy = 10 /* Price: Low to High */
SET @sql_orderby = ' pv.[Price] ASC'
ELSE IF @OrderBy = 11 /* Price: High to Low */
SET @sql_orderby = ' pv.[Price] DESC'
ELSE IF @OrderBy = 15 /* creation date */
SET @sql_orderby = ' p.[CreatedOnUtc] DESC'
ELSE /* default sorting, 0 (position) */
BEGIN
--category position (display order)
IF @CategoryIdsCount > 0 SET @sql_orderby = ' pcm.DisplayOrder ASC'
--manufacturer position (display order)
IF @ManufacturerId > 0
BEGIN
IF LEN(@sql_orderby) > 0 SET @sql_orderby = @sql_orderby + ', '
SET @sql_orderby = @sql_orderby + ' pmm.DisplayOrder ASC'
END
--name
IF LEN(@sql_orderby) > 0 SET @sql_orderby = @sql_orderby + ', '
SET @sql_orderby = @sql_orderby + ' p.[Name] ASC'
END
SET @sql = @sql + '
ORDER BY' + @sql_orderby
--PRINT (@sql)
EXEC sp_executesql @sql
DROP TABLE #FilteredCategoryIds
DROP TABLE #FilteredSpecs
CREATE TABLE #PageIndex
(
[IndexId] int IDENTITY (1, 1) NOT NULL,
[ProductId] int NOT NULL
)
INSERT INTO #PageIndex ([ProductId])
SELECT ProductId
FROM #DisplayOrderTmp
GROUP BY ProductId
ORDER BY min([Id])
--total records
SET @TotalRecords = @@rowcount
DROP TABLE #DisplayOrderTmp
--prepare filterable specification attribute option identifier (if requested)
IF @LoadFilterableSpecificationAttributeOptionIds = 1
BEGIN
CREATE TABLE #FilterableSpecs
(
[SpecificationAttributeOptionId] int NOT NULL
)
INSERT INTO #FilterableSpecs ([SpecificationAttributeOptionId])
SELECT DISTINCT [psam].SpecificationAttributeOptionId
FROM [Product_SpecificationAttribute_Mapping] [psam]
WHERE [psam].[AllowFiltering] = 1
AND [psam].[ProductId] IN (SELECT [pi].ProductId FROM #PageIndex [pi])
--build comma separated list of filterable identifiers
SELECT @FilterableSpecificationAttributeOptionIds = COALESCE(@FilterableSpecificationAttributeOptionIds + ',' , '') + CAST(SpecificationAttributeOptionId as nvarchar(1000))
FROM #FilterableSpecs
DROP TABLE #FilterableSpecs
END
--return products
SELECT TOP (@RowsToReturn)
p.*
FROM
#PageIndex [pi]
INNER JOIN Product p on p.Id = [pi].[ProductId]
WHERE
[pi].IndexId > @PageLowerBound AND
[pi].IndexId < @PageUpperBound
ORDER BY
[pi].IndexId
DROP TABLE #PageIndex
END
GO
IF EXISTS (
SELECT *
FROM sys.objects
WHERE object_id = OBJECT_ID(N'[FullText_Disable]') AND OBJECTPROPERTY(object_id,N'IsProcedure') = 1)
DROP PROCEDURE [FullText_Disable]
GO
CREATE PROCEDURE [FullText_Disable]
AS
BEGIN
EXEC('
--drop indexes
IF EXISTS (SELECT 1 FROM sys.fulltext_indexes WHERE object_id = object_id(''[Product]''))
DROP FULLTEXT INDEX ON [Product]
')
EXEC('
IF EXISTS (SELECT 1 FROM sys.fulltext_indexes WHERE object_id = object_id(''[ProductVariant]''))
DROP FULLTEXT INDEX ON [ProductVariant]
')
EXEC('
IF EXISTS (SELECT 1 FROM sys.fulltext_indexes WHERE object_id = object_id(''[LocalizedProperty]''))
DROP FULLTEXT INDEX ON [LocalizedProperty]
')
EXEC('
IF EXISTS (SELECT 1 FROM sys.fulltext_indexes WHERE object_id = object_id(''[ProductTag]''))
DROP FULLTEXT INDEX ON [ProductTag]
')
--drop catalog
EXEC('
IF EXISTS (SELECT 1 FROM sys.fulltext_catalogs WHERE [name] = ''nopCommerceFullTextCatalog'')
DROP FULLTEXT CATALOG [nopCommerceFullTextCatalog]
')
END
GO
IF EXISTS (
SELECT *
FROM sys.objects
WHERE object_id = OBJECT_ID(N'[FullText_Enable]') AND OBJECTPROPERTY(object_id,N'IsProcedure') = 1)
DROP PROCEDURE [FullText_Enable]
GO
CREATE PROCEDURE [FullText_Enable]
AS
BEGIN
--create catalog
EXEC('
IF NOT EXISTS (SELECT 1 FROM sys.fulltext_catalogs WHERE [name] = ''nopCommerceFullTextCatalog'')
CREATE FULLTEXT CATALOG [nopCommerceFullTextCatalog] AS DEFAULT')
--create indexes
DECLARE @create_index_text nvarchar(4000)
SET @create_index_text = '
IF NOT EXISTS (SELECT 1 FROM sys.fulltext_indexes WHERE object_id = object_id(''[Product]''))
CREATE FULLTEXT INDEX ON [Product]([Name], [ShortDescription], [FullDescription])
KEY INDEX [' + dbo.[nop_getprimarykey_indexname] ('Product') + '] ON [nopCommerceFullTextCatalog] WITH CHANGE_TRACKING AUTO'
EXEC(@create_index_text)
SET @create_index_text = '
IF NOT EXISTS (SELECT 1 FROM sys.fulltext_indexes WHERE object_id = object_id(''[ProductVariant]''))
CREATE FULLTEXT INDEX ON [ProductVariant]([Name], [Description], [SKU])
KEY INDEX [' + dbo.[nop_getprimarykey_indexname] ('ProductVariant') + '] ON [nopCommerceFullTextCatalog] WITH CHANGE_TRACKING AUTO'
EXEC(@create_index_text)
SET @create_index_text = '
IF NOT EXISTS (SELECT 1 FROM sys.fulltext_indexes WHERE object_id = object_id(''[LocalizedProperty]''))
CREATE FULLTEXT INDEX ON [LocalizedProperty]([LocaleValue])
KEY INDEX [' + dbo.[nop_getprimarykey_indexname] ('LocalizedProperty') + '] ON [nopCommerceFullTextCatalog] WITH CHANGE_TRACKING AUTO'
EXEC(@create_index_text)
SET @create_index_text = '
IF NOT EXISTS (SELECT 1 FROM sys.fulltext_indexes WHERE object_id = object_id(''[ProductTag]''))
CREATE FULLTEXT INDEX ON [ProductTag]([Name])
KEY INDEX [' + dbo.[nop_getprimarykey_indexname] ('ProductTag') + '] ON [nopCommerceFullTextCatalog] WITH CHANGE_TRACKING AUTO'
EXEC(@create_index_text)
END
GO
--Full-text support
IF EXISTS (SELECT 1 FROM [Setting] WHERE [name] = N'commonsettings.usefulltextsearch' AND [value]=N'true')
BEGIN
DECLARE @FullTextIsSupported int
SET @FullTextIsSupported = CASE SERVERPROPERTY('IsFullTextInstalled')
WHEN 1 THEN
CASE DatabaseProperty (DB_NAME(DB_ID()), 'IsFulltextEnabled')
WHEN 1 THEN 1
ELSE 0
END
ELSE 0
END
IF (@FullTextIsSupported = 1)
BEGIN
--create full-text indexes for product tags
DECLARE @create_index_text nvarchar(4000)
SET @create_index_text = '
IF NOT EXISTS (SELECT 1 FROM sys.fulltext_indexes WHERE object_id = object_id(''[ProductTag]''))
CREATE FULLTEXT INDEX ON [ProductTag]([Name])
KEY INDEX [' + dbo.[nop_getprimarykey_indexname] ('ProductTag') + '] ON [nopCommerceFullTextCatalog] WITH CHANGE_TRACKING AUTO'
EXEC(@create_index_text)
END
END
GO
--indexes
IF NOT EXISTS (SELECT 1 from sys.indexes WHERE [NAME]=N'IX_ProductTag_Name' and object_id=object_id(N'[ProductTag]'))
BEGIN
CREATE NONCLUSTERED INDEX [IX_ProductTag_Name] ON [ProductTag] ([Name] ASC)
END
GO
+10
View File
@@ -0,0 +1,10 @@
Steps:
1. Backup your existing database
2. Execute upgrade.sql script over your database
3. Remove all files from the previous version except App_Data\Settings.txt and App_Data\InstalledPlugins.txt
4. Upload new site files
5. Copy back App_Data\Settings.txt and App_Data\InstalledPlugins.txt files
6. Ensure that everything is OK
Notes:
1. If you stored your pictures on the file system, then also backup them (\Content\Images\) and copy back after upgrade
File diff suppressed because it is too large Load Diff
+10
View File
@@ -0,0 +1,10 @@
Steps:
1. Backup your existing database
2. Execute upgrade.sql script over your database
3. Remove all files from the previous version except App_Data\Settings.txt and App_Data\InstalledPlugins.txt
4. Upload new site files
5. Copy back App_Data\Settings.txt and App_Data\InstalledPlugins.txt files
6. Ensure that everything is OK
Notes:
1. If you stored your pictures on the file system, then also backup them (\Content\Images\) and copy back after upgrade
File diff suppressed because it is too large Load Diff
+10
View File
@@ -0,0 +1,10 @@
Steps:
1. Backup your existing database
2. Execute upgrade.sql script over your database
3. Remove all files from the previous version except App_Data\Settings.txt and App_Data\InstalledPlugins.txt
4. Upload new site files
5. Copy back App_Data\Settings.txt and App_Data\InstalledPlugins.txt files
6. Ensure that everything is OK
Notes:
1. If you stored your pictures on the file system, then also backup them (\Content\Images\) and copy back after upgrade
File diff suppressed because it is too large Load Diff
+18
View File
@@ -0,0 +1,18 @@
Steps:
1. Disable full-text in admin area
2. Backup your existing database
3. Execute upgrade.sql script over your database
4. Remove all files from the previous version except App_Data\Settings.txt and App_Data\InstalledPlugins.txt
5. Upload new site files
6. Copy back App_Data\Settings.txt and App_Data\InstalledPlugins.txt files
7. Enable full-text in admin area
8. Ensure that everything is OK
9. Now manually complete the following steps:
9a. Update "Required product IDs" product property (visible when "Require other products are added to the cart" enable)
9b. Re-configure "Customer has one of these products in the cart" and "Customer has all of these products in the cart" discount requirements if were used
9c. Re-configure "Google product search" (froogle) plugin
Notes:
1. If you stored your pictures on the file system, then also backup them (\Content\Images\) and copy back after upgrade
File diff suppressed because it is too large Load Diff
+10
View File
@@ -0,0 +1,10 @@
Steps:
1. Backup your existing database
2. Execute upgrade.sql script over your database
3. Remove all files from the previous version except App_Data\Settings.txt and App_Data\InstalledPlugins.txt
4. Upload new site files
5. Copy back App_Data\Settings.txt and App_Data\InstalledPlugins.txt files
6. Ensure that everything is OK
Notes:
1. If you stored your pictures on the file system, then also backup them (\Content\Images\) and copy back after upgrade
File diff suppressed because it is too large Load Diff
+10
View File
@@ -0,0 +1,10 @@
Steps:
1. Backup your existing database
2. Execute upgrade.sql script over your database
3. Remove all files from the previous version except App_Data\Settings.txt and App_Data\InstalledPlugins.txt
4. Upload new site files
5. Copy back App_Data\Settings.txt and App_Data\InstalledPlugins.txt files
6. Ensure that everything is OK
Notes:
1. If you stored your pictures on the file system, then also backup them (\Content\Images\) and copy back after upgrade
File diff suppressed because it is too large Load Diff
+10
View File
@@ -0,0 +1,10 @@
Steps:
1. Backup your existing database
2. Execute upgrade.sql script over your database
3. Remove all files from the previous version except App_Data\Settings.txt and App_Data\InstalledPlugins.txt
4. Upload new site files
5. Copy back App_Data\Settings.txt and App_Data\InstalledPlugins.txt files
6. Ensure that everything is OK
Notes:
1. If you stored your pictures on the file system, then also backup them (\Content\Images\) and copy back after upgrade
File diff suppressed because it is too large Load Diff
+10
View File
@@ -0,0 +1,10 @@
Steps:
1. Backup your existing database
2. Execute upgrade.sql script over your database
3. Remove all files from the previous version except App_Data\Settings.txt and App_Data\InstalledPlugins.txt
4. Upload new site files
5. Copy back App_Data\Settings.txt and App_Data\InstalledPlugins.txt files
6. Ensure that everything is OK
Notes:
1. If you stored your pictures on the file system, then also backup them (\Content\Images\) and copy back after upgrade
File diff suppressed because it is too large Load Diff
+10
View File
@@ -0,0 +1,10 @@
Steps:
1. Backup your existing database
2. Execute upgrade.sql script over your database
3. Remove all files from the previous version except App_Data\Settings.txt and App_Data\InstalledPlugins.txt
4. Upload new site files
5. Copy back App_Data\Settings.txt and App_Data\InstalledPlugins.txt files
6. Ensure that everything is OK
Notes:
1. If you stored your pictures on the file system, then also backup them (\Content\Images\) and copy back after upgrade
File diff suppressed because it is too large Load Diff
+10
View File
@@ -0,0 +1,10 @@
Steps:
1. Backup your existing database
2. Execute upgrade.sql script over your database
3. Remove all files from the previous version except App_Data\Settings.txt and App_Data\InstalledPlugins.txt
4. Upload new site files
5. Copy back App_Data\Settings.txt and App_Data\InstalledPlugins.txt files
6. Ensure that everything is OK
Notes:
1. If you stored your pictures on the file system, then also backup them (\Content\Images\) and copy back after upgrade
File diff suppressed because it is too large Load Diff
+10
View File
@@ -0,0 +1,10 @@
Steps:
1. Backup your existing database
2. Execute upgrade.sql script over your database
3. Remove all files from the previous version except App_Data\Settings.txt and App_Data\InstalledPlugins.txt
4. Upload new site files
5. Copy back App_Data\Settings.txt and App_Data\InstalledPlugins.txt files
6. Ensure that everything is OK
Notes:
1. If you stored your pictures on the file system, then also backup them (\Content\Images\) and copy back after upgrade
File diff suppressed because it is too large Load Diff
+19
View File
@@ -0,0 +1,19 @@
Steps:
1. Backup your existing database
2. Execute upgrade.sql script over your database
3. Remove all files from the previous version except App_Data\Settings.txt and App_Data\InstalledPlugins.txt
4. Upload new site files
5. Copy back App_Data\Settings.txt and App_Data\InstalledPlugins.txt files
6. Ensure that everything is OK
Version specific steps:
7. Combine "Fixed Rate Shipping" and "Shipping by weight" plugins into single one. Upgrade instructions: do not forget to manually delete "/Plugins/Shipping.FixedRateShipping" and "/Plugins/Shipping.ByWeight" directories (they are not used anymore) and replace the plugin «Shipping.Fixed Rate» or «Shipping.ByWeight» by the plugin «Shipping.FixedOrByWeight» in the App_Data/InstalledPlugins.txt file.
8. Combine "Nop.Plugin.Tax.CountryStateZip" and "Nop.Plugin.Tax.FixedRate" plugins into single one. Upgrade instructions: do not forget to manually delete "/Plugins/Tax.FixedRate" and "/Plugins/Tax.CountryStateZip" directories (they are not used anymore) and replace the plugin «Tax.Fixed» or «Tax.CountryStateZip» by the plugin «Tax.FixedOrByCountryStateZip» in the App_Data/InstalledPlugins.txt file.
9. Renamed "Froogle" plugin to "Google Shopping". Upgrade instructions: manually delete /Plugins/Feed.Froogle/ directory
Notes:
1. If you stored your pictures on the file system, then also backup them (\Content\Images\) and copy back after upgrade
File diff suppressed because it is too large Load Diff
+10
View File
@@ -0,0 +1,10 @@
Steps:
1. Backup your existing database
2. Execute upgrade.sql script over your database
3. Remove all files from the previous version except App_Data\Settings.txt and App_Data\InstalledPlugins.txt
4. Upload new site files
5. Copy back App_Data\Settings.txt and App_Data\InstalledPlugins.txt files
6. Ensure that everything is OK
Notes:
1. If you stored your pictures on the file system, then also backup them (\Content\Images\) and copy back after upgrade
File diff suppressed because it is too large Load Diff
+14
View File
@@ -0,0 +1,14 @@
Steps:
1. Backup your existing database
2. Execute upgrade.sql script over your database
3. Remove all files from the previous version except App_Data\dataSettings.json (Settings.txt) and App_Data\installedPlugins.json (InstalledPlugins.txt)
4. Upload new site files
5. Copy back App_Data\dataSettings.json and App_Data\installedPlugins.json files
6. Ensure that everything is OK
Version specific steps:
7. Added "Shipping by Total" functionality to "Shipping by Weight" plugin. Upgrade instructions: do not forget to manually delete "/Plugins/Shipping.FixedOrByWeight" directory (it's not used anymore) and replace the plugin «Shipping.FixedOrByWeight» by the plugin «Shipping.FixedByWeightByTotal» in the App_Data/installedPlugins.json file.
Notes:
1. If you stored your pictures on the file system, then also backup them (\wwwroot\Images\) and copy back after upgrade
File diff suppressed because it is too large Load Diff
+10
View File
@@ -0,0 +1,10 @@
Steps:
1. Make a backup of everything on your site, including the database. This is extremely important so that you can roll back to a running site no matter what happens during migration.
2. Execute upgrade.sql script over your database
3. Remove all files from the previous version except App_Data\dataSettings.json (Settings.txt) and App_Data\installedPlugins.json (InstalledPlugins.txt)
4. Upload new site files
5. Copy back App_Data\dataSettings.json and App_Data\installedPlugins.json files
6. Ensure that everything is OK
Notes:
1. If you stored your pictures on the file system, then also backup them (\wwwroot\Images\) and copy back after upgrade
File diff suppressed because it is too large Load Diff
+10
View File
@@ -0,0 +1,10 @@
Steps:
1. Make a backup of everything on your site, including the database. This is extremely important so that you can roll back to a running site no matter what happens during migration.
2. Execute upgrade.sql script over your database
3. Remove all files from the previous version except \App_Data\dataSettings.json (Settings.txt) and \App_Data\plugins.json. Also \App_Data\installedPlugins.json or \App_Data\InstalledPlugins.txt (if exists)
4. Upload new site files
5. Copy back \App_Data\dataSettings.json and \App_Data\plugins.json files. And \App_Data\installedPlugins.json (if exists)
6. Ensure that everything is OK
Notes:
1. If you stored your pictures on the file system, then also backup them (\wwwroot\Images\) and copy back after upgrade
File diff suppressed because one or more lines are too long
@@ -0,0 +1,11 @@
IMPORTANT. We don't use SQL upgrade scripts anymore. Upgrade is performed automatically with migrations (during the first application start).
Steps:
1. Make a backup of everything on your site, including the database. This is extremely important so that you can roll back to a running site no matter what happens during migration.
2. Remove all files from the previous version except JSON files in the 'App_Data' directory (dataSettings.json, plugins.json, appsettings.json), move them to the safe place.
3. Upload new site files
4. Copy back JSON files in the 'App_Data' directory.
5. Ensure that everything is OK
Notes:
1. If you stored your pictures on the file system, then also backup them (\wwwroot\images\) and copy back after upgrade