Skip to content

Commit

Permalink
#5496 Rename "Calculate price range automatically" to "Enter price ra…
Browse files Browse the repository at this point in the history
…nge manually"
  • Loading branch information
holydk committed Mar 5, 2021
1 parent bf50653 commit 9e9795d
Show file tree
Hide file tree
Showing 31 changed files with 320 additions and 340 deletions.
8 changes: 4 additions & 4 deletions src/Libraries/Nop.Core/Domain/Catalog/CatalogSettings.cs
Expand Up @@ -266,9 +266,9 @@ public CatalogSettings()
public decimal SearchPagePriceTo { get; set; }

/// <summary>
/// Gets or sets a value indicating whether the price range should be calculated automatically on search page
/// Gets or sets a value indicating whether the price range should be entered manually on search page
/// </summary>
public bool SearchPageAutomaticallyCalculatePriceRange { get; set; }
public bool SearchPageManuallyPriceRange { get; set; }

/// <summary>
/// Gets or sets "List of products purchased by other customers who purchased the above" option is enable
Expand Down Expand Up @@ -321,9 +321,9 @@ public CatalogSettings()
public decimal ProductsByTagPriceTo { get; set; }

/// <summary>
/// Gets or sets a value indicating whether the price range should be calculated automatically on 'products by tag' page
/// Gets or sets a value indicating whether the price range should be entered manually on 'products by tag' page
/// </summary>
public bool ProductsByTagAutomaticallyCalculatePriceRange { get; set; }
public bool ProductsByTagManuallyPriceRange { get; set; }

/// <summary>
/// Gets or sets a value indicating whether to include "Short description" in compare products
Expand Down
4 changes: 2 additions & 2 deletions src/Libraries/Nop.Core/Domain/Catalog/Category.cs
Expand Up @@ -129,8 +129,8 @@ public partial class Category : BaseEntity, ILocalizedEntity, ISlugSupported, IA
public decimal PriceTo { get; set; }

/// <summary>
/// Gets or sets a value indicating whether the price range should be calculated automatically
/// Gets or sets a value indicating whether the price range should be entered manually
/// </summary>
public bool AutomaticallyCalculatePriceRange { get; set; }
public bool ManuallyPriceRange { get; set; }
}
}
4 changes: 2 additions & 2 deletions src/Libraries/Nop.Core/Domain/Catalog/Manufacturer.cs
Expand Up @@ -114,8 +114,8 @@ public partial class Manufacturer : BaseEntity, ILocalizedEntity, ISlugSupported
public decimal PriceTo { get; set; }

/// <summary>
/// Gets or sets a value indicating whether the price range should be calculated automatically
/// Gets or sets a value indicating whether the price range should be entered manually
/// </summary>
public bool AutomaticallyCalculatePriceRange { get; set; }
public bool ManuallyPriceRange { get; set; }
}
}
4 changes: 2 additions & 2 deletions src/Libraries/Nop.Core/Domain/Vendors/Vendor.cs
Expand Up @@ -100,8 +100,8 @@ public partial class Vendor : BaseEntity, ILocalizedEntity, ISlugSupported, ISof
public decimal PriceTo { get; set; }

/// <summary>
/// Gets or sets a value indicating whether the price range should be calculated automatically
/// Gets or sets a value indicating whether the price range should be entered manually
/// </summary>
public bool AutomaticallyCalculatePriceRange { get; set; }
public bool ManuallyPriceRange { get; set; }
}
}
14 changes: 7 additions & 7 deletions src/Libraries/Nop.Data/Migrations/UpgradeTo440/DataMigration.cs
Expand Up @@ -212,24 +212,24 @@ public override void Up()
}

//add column
var automaticallyCalculatePriceRangeColumnName = "AutomaticallyCalculatePriceRange";
var manuallyPriceRangeColumnName = "ManuallyPriceRange";

if (!Schema.Table(categoryTableName).Column(automaticallyCalculatePriceRangeColumnName).Exists())
if (!Schema.Table(categoryTableName).Column(manuallyPriceRangeColumnName).Exists())
{
Alter.Table(categoryTableName)
.AddColumn(automaticallyCalculatePriceRangeColumnName).AsBoolean().NotNullable().SetExistingRowsTo(true);
.AddColumn(manuallyPriceRangeColumnName).AsBoolean().NotNullable().SetExistingRowsTo(false);
}

if (!Schema.Table(manufacturerTableName).Column(automaticallyCalculatePriceRangeColumnName).Exists())
if (!Schema.Table(manufacturerTableName).Column(manuallyPriceRangeColumnName).Exists())
{
Alter.Table(manufacturerTableName)
.AddColumn(automaticallyCalculatePriceRangeColumnName).AsBoolean().NotNullable().SetExistingRowsTo(true);
.AddColumn(manuallyPriceRangeColumnName).AsBoolean().NotNullable().SetExistingRowsTo(false);
}

if (!Schema.Table(vendorTableName).Column(automaticallyCalculatePriceRangeColumnName).Exists())
if (!Schema.Table(vendorTableName).Column(manuallyPriceRangeColumnName).Exists())
{
Alter.Table(vendorTableName)
.AddColumn(automaticallyCalculatePriceRangeColumnName).AsBoolean().NotNullable().SetExistingRowsTo(true);
.AddColumn(manuallyPriceRangeColumnName).AsBoolean().NotNullable().SetExistingRowsTo(false);
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/Libraries/Nop.Services/ExportImport/ExportManager.cs
Expand Up @@ -205,7 +205,7 @@ protected virtual async Task WriteCategoriesAsync(XmlWriter xmlWriter, int paren
await xmlWriter.WriteStringAsync("PriceRangeFiltering", category.PriceRangeFiltering, await IgnoreExportCategoryPropertyAsync());
await xmlWriter.WriteStringAsync("PriceFrom", category.PriceFrom, await IgnoreExportCategoryPropertyAsync());
await xmlWriter.WriteStringAsync("PriceTo", category.PriceTo, await IgnoreExportCategoryPropertyAsync());
await xmlWriter.WriteStringAsync("AutomaticallyCalculatePriceRange", category.AutomaticallyCalculatePriceRange, await IgnoreExportCategoryPropertyAsync());
await xmlWriter.WriteStringAsync("ManuallyPriceRange", category.ManuallyPriceRange, await IgnoreExportCategoryPropertyAsync());
await xmlWriter.WriteStringAsync("ShowOnHomepage", category.ShowOnHomepage, await IgnoreExportCategoryPropertyAsync());
await xmlWriter.WriteStringAsync("IncludeInTopMenu", category.IncludeInTopMenu, await IgnoreExportCategoryPropertyAsync());
await xmlWriter.WriteStringAsync("Published", category.Published, await IgnoreExportCategoryPropertyAsync());
Expand Down Expand Up @@ -773,7 +773,7 @@ public virtual async Task<string> ExportManufacturersToXmlAsync(IList<Manufactur
await xmlWriter.WriteStringAsync("PriceRangeFiltering", manufacturer.PriceRangeFiltering, await IgnoreExportManufacturerPropertyAsync());
await xmlWriter.WriteStringAsync("PriceFrom", manufacturer.PriceFrom, await IgnoreExportManufacturerPropertyAsync());
await xmlWriter.WriteStringAsync("PriceTo", manufacturer.PriceTo, await IgnoreExportManufacturerPropertyAsync());
await xmlWriter.WriteStringAsync("AutomaticallyCalculatePriceRange", manufacturer.AutomaticallyCalculatePriceRange, await IgnoreExportManufacturerPropertyAsync());
await xmlWriter.WriteStringAsync("ManuallyPriceRange", manufacturer.ManuallyPriceRange, await IgnoreExportManufacturerPropertyAsync());
await xmlWriter.WriteStringAsync("Published", manufacturer.Published, await IgnoreExportManufacturerPropertyAsync());
await xmlWriter.WriteStringAsync("Deleted", manufacturer.Deleted, true);
await xmlWriter.WriteStringAsync("DisplayOrder", manufacturer.DisplayOrder);
Expand Down Expand Up @@ -836,7 +836,7 @@ public virtual async Task<byte[]> ExportManufacturersToXlsxAsync(IEnumerable<Man
new PropertyByName<Manufacturer>("PriceRangeFiltering", p => p.PriceRangeFiltering, await IgnoreExportManufacturerPropertyAsync()),
new PropertyByName<Manufacturer>("PriceFrom", p => p.PriceFrom, await IgnoreExportManufacturerPropertyAsync()),
new PropertyByName<Manufacturer>("PriceTo", p => p.PriceTo, await IgnoreExportManufacturerPropertyAsync()),
new PropertyByName<Manufacturer>("AutomaticallyCalculatePriceRange", p => p.AutomaticallyCalculatePriceRange, await IgnoreExportManufacturerPropertyAsync()),
new PropertyByName<Manufacturer>("ManuallyPriceRange", p => p.ManuallyPriceRange, await IgnoreExportManufacturerPropertyAsync()),
new PropertyByName<Manufacturer>("Published", p => p.Published, await IgnoreExportManufacturerPropertyAsync()),
new PropertyByName<Manufacturer>("DisplayOrder", p => p.DisplayOrder)
}, _catalogSettings);
Expand Down Expand Up @@ -908,7 +908,7 @@ public virtual async Task<byte[]> ExportCategoriesToXlsxAsync(IList<Category> ca
new PropertyByName<Category>("PriceRangeFiltering", p => p.PriceRangeFiltering, await IgnoreExportCategoryPropertyAsync()),
new PropertyByName<Category>("PriceFrom", p => p.PriceFrom, await IgnoreExportCategoryPropertyAsync()),
new PropertyByName<Category>("PriceTo", p => p.PriceTo, await IgnoreExportCategoryPropertyAsync()),
new PropertyByName<Category>("AutomaticallyCalculatePriceRange", p => p.AutomaticallyCalculatePriceRange, await IgnoreExportCategoryPropertyAsync()),
new PropertyByName<Category>("ManuallyPriceRange", p => p.ManuallyPriceRange, await IgnoreExportCategoryPropertyAsync()),
new PropertyByName<Category>("AllowCustomersToSelectPageSize", p => p.AllowCustomersToSelectPageSize, await IgnoreExportCategoryPropertyAsync()),
new PropertyByName<Category>("PageSizeOptions", p => p.PageSizeOptions, await IgnoreExportCategoryPropertyAsync()),
new PropertyByName<Category>("ShowOnHomepage", p => p.ShowOnHomepage, await IgnoreExportCategoryPropertyAsync()),
Expand Down
4 changes: 2 additions & 2 deletions src/Libraries/Nop.Services/ExportImport/ImportManager.cs
Expand Up @@ -512,7 +512,7 @@ protected virtual async Task<(string seName, bool isParentCategoryExists)> Updat
category.PriceTo = property.DecimalValue;
break;
case "AutomaticallyCalculatePriceRange":
category.AutomaticallyCalculatePriceRange = property.BooleanValue;
category.ManuallyPriceRange = property.BooleanValue;
break;
case "IncludeInTopMenu":
category.IncludeInTopMenu = property.BooleanValue;
Expand Down Expand Up @@ -2028,7 +2028,7 @@ public virtual async Task ImportManufacturersFromXlsxAsync(Stream stream)
manufacturer.PriceTo = property.DecimalValue;
break;
case "AutomaticallyCalculatePriceRange":
manufacturer.AutomaticallyCalculatePriceRange = property.BooleanValue;
manufacturer.ManuallyPriceRange = property.BooleanValue;
break;
case "Published":
manufacturer.Published = property.BooleanValue;
Expand Down
12 changes: 12 additions & 0 deletions src/Libraries/Nop.Services/Installation/InstallationService.cs
Expand Up @@ -3001,6 +3001,7 @@ protected virtual async Task InstallSettingsAsync(RegionInfo regionInfo)
SearchPageAllowCustomersToSelectPageSize = true,
SearchPagePageSizeOptions = "6, 3, 9, 18",
SearchPagePriceRangeFiltering = true,
SearchPageManuallyPriceRange = true,
SearchPagePriceFrom = NopCatalogDefaults.DefaultPriceRangeFrom,
SearchPagePriceTo = NopCatalogDefaults.DefaultPriceRangeTo,
ProductsAlsoPurchasedEnabled = true,
Expand All @@ -3021,6 +3022,7 @@ protected virtual async Task InstallSettingsAsync(RegionInfo regionInfo)
ProductsByTagAllowCustomersToSelectPageSize = true,
ProductsByTagPageSizeOptions = "6, 3, 9, 18",
ProductsByTagPriceRangeFiltering = true,
ProductsByTagManuallyPriceRange = true,
ProductsByTagPriceFrom = NopCatalogDefaults.DefaultPriceRangeFrom,
ProductsByTagPriceTo = NopCatalogDefaults.DefaultPriceRangeTo,
MaximumBackInStockSubscriptions = 200,
Expand Down Expand Up @@ -3833,6 +3835,7 @@ protected virtual async Task InstallCategoriesAsync()
ParentCategoryId = categoryComputers.Id,
PictureId = (await pictureService.InsertPictureAsync(await _fileProvider.ReadAllBytesAsync(_fileProvider.Combine(sampleImagesPath, "category_desktops.jpg")), MimeTypes.ImagePJpeg, await pictureService.GetPictureSeNameAsync("Desktops"))).Id,
PriceRangeFiltering = true,
ManuallyPriceRange = true,
PriceFrom = NopCatalogDefaults.DefaultPriceRangeFrom,
PriceTo = NopCatalogDefaults.DefaultPriceRangeTo,
IncludeInTopMenu = true,
Expand Down Expand Up @@ -3912,6 +3915,7 @@ protected virtual async Task InstallCategoriesAsync()
ParentCategoryId = categoryElectronics.Id,
PictureId = (await pictureService.InsertPictureAsync(await _fileProvider.ReadAllBytesAsync(_fileProvider.Combine(sampleImagesPath, "category_camera_photo.jpeg")), MimeTypes.ImageJpeg, await pictureService.GetPictureSeNameAsync("Camera, photo"))).Id,
PriceRangeFiltering = true,
ManuallyPriceRange = true,
PriceFrom = NopCatalogDefaults.DefaultPriceRangeFrom,
PriceTo = NopCatalogDefaults.DefaultPriceRangeTo,
IncludeInTopMenu = true,
Expand Down Expand Up @@ -3954,6 +3958,7 @@ protected virtual async Task InstallCategoriesAsync()
PictureId = (await pictureService.InsertPictureAsync(await _fileProvider.ReadAllBytesAsync(_fileProvider.Combine(sampleImagesPath, "category_accessories.jpg")), MimeTypes.ImagePJpeg, await pictureService.GetPictureSeNameAsync("Accessories"))).Id,
IncludeInTopMenu = true,
PriceRangeFiltering = true,
ManuallyPriceRange = true,
PriceFrom = NopCatalogDefaults.DefaultPriceRangeFrom,
PriceTo = NopCatalogDefaults.DefaultPriceRangeTo,
Published = true,
Expand Down Expand Up @@ -3994,6 +3999,7 @@ protected virtual async Task InstallCategoriesAsync()
ParentCategoryId = categoryApparel.Id,
PictureId = (await pictureService.InsertPictureAsync(await _fileProvider.ReadAllBytesAsync(_fileProvider.Combine(sampleImagesPath, "category_shoes.jpeg")), MimeTypes.ImageJpeg, await pictureService.GetPictureSeNameAsync("Shoes"))).Id,
PriceRangeFiltering = true,
ManuallyPriceRange = true,
PriceFrom = NopCatalogDefaults.DefaultPriceRangeFrom,
PriceTo = NopCatalogDefaults.DefaultPriceRangeTo,
IncludeInTopMenu = true,
Expand Down Expand Up @@ -4036,6 +4042,7 @@ protected virtual async Task InstallCategoriesAsync()
PictureId = (await pictureService.InsertPictureAsync(await _fileProvider.ReadAllBytesAsync(_fileProvider.Combine(sampleImagesPath, "category_apparel_accessories.jpg")), MimeTypes.ImagePJpeg, await pictureService.GetPictureSeNameAsync("Apparel Accessories"))).Id,
IncludeInTopMenu = true,
PriceRangeFiltering = true,
ManuallyPriceRange = true,
PriceFrom = NopCatalogDefaults.DefaultPriceRangeFrom,
PriceTo = NopCatalogDefaults.DefaultPriceRangeTo,
Published = true,
Expand Down Expand Up @@ -4077,6 +4084,7 @@ protected virtual async Task InstallCategoriesAsync()
PageSizeOptions = "6, 3, 9",
PictureId = (await pictureService.InsertPictureAsync(await _fileProvider.ReadAllBytesAsync(_fileProvider.Combine(sampleImagesPath, "category_book.jpeg")), MimeTypes.ImageJpeg, await pictureService.GetPictureSeNameAsync("Book"))).Id,
PriceRangeFiltering = true,
ManuallyPriceRange = true,
PriceFrom = NopCatalogDefaults.DefaultPriceRangeFrom,
PriceTo = NopCatalogDefaults.DefaultPriceRangeTo,
IncludeInTopMenu = true,
Expand All @@ -4098,6 +4106,7 @@ protected virtual async Task InstallCategoriesAsync()
PageSizeOptions = "6, 3, 9",
PictureId = (await pictureService.InsertPictureAsync(await _fileProvider.ReadAllBytesAsync(_fileProvider.Combine(sampleImagesPath, "category_jewelry.jpeg")), MimeTypes.ImageJpeg, await pictureService.GetPictureSeNameAsync("Jewelry"))).Id,
PriceRangeFiltering = true,
ManuallyPriceRange = true,
PriceFrom = NopCatalogDefaults.DefaultPriceRangeFrom,
PriceTo = NopCatalogDefaults.DefaultPriceRangeTo,
IncludeInTopMenu = true,
Expand Down Expand Up @@ -4160,6 +4169,7 @@ protected virtual async Task InstallManufacturersAsync()
AllowCustomersToSelectPageSize = true,
PageSizeOptions = "6, 3, 9",
PriceRangeFiltering = true,
ManuallyPriceRange = true,
PriceFrom = NopCatalogDefaults.DefaultPriceRangeFrom,
PriceTo = NopCatalogDefaults.DefaultPriceRangeTo,
Published = true,
Expand All @@ -4181,6 +4191,7 @@ protected virtual async Task InstallManufacturersAsync()
AllowCustomersToSelectPageSize = true,
PageSizeOptions = "6, 3, 9",
PriceRangeFiltering = true,
ManuallyPriceRange = true,
PriceFrom = NopCatalogDefaults.DefaultPriceRangeFrom,
PriceTo = NopCatalogDefaults.DefaultPriceRangeTo,
Published = true,
Expand Down Expand Up @@ -9289,6 +9300,7 @@ protected virtual async Task InstallVendorsAsync()
AllowCustomersToSelectPageSize = true,
PageSizeOptions = "6, 3, 9, 18",
PriceRangeFiltering = true,
ManuallyPriceRange = true,
PriceFrom = NopCatalogDefaults.DefaultPriceRangeFrom,
PriceTo = NopCatalogDefaults.DefaultPriceRangeTo,
},
Expand Down

0 comments on commit 9e9795d

Please sign in to comment.