Skip to content

Commit

Permalink
Merge pull request #230 from HotcakesCommerce/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
Will Strohl authored Nov 13, 2019
2 parents e483bdd + f04fe6d commit 47e2271
Show file tree
Hide file tree
Showing 15 changed files with 116 additions and 40 deletions.
4 changes: 2 additions & 2 deletions Build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

<!-- Version Number -->
<PropertyGroup Condition=" '$(BUILD_NUMBER)' == '' ">
<Version>03.02.02</Version>
<Version>03.02.03</Version>
<FileVersion>01.00.00</FileVersion>
<InformationalVersion>01.00.00</InformationalVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(BUILD_NUMBER)' != '' ">
<!-- Build Server Number -->
<Version>03.02.02</Version>
<Version>03.02.03</Version>
<FileVersion>$(BUILD_NUMBER)</FileVersion>
<InformationalVersion>$(BUILD_NUMBER)</InformationalVersion>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[assembly: CLSCompliant(false)]
[assembly: ComVisible(false)]

[assembly: AssemblyVersion("3.02.02")]
[assembly: AssemblyVersion("3.02.03")]
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]
Expand Down
9 changes: 8 additions & 1 deletion Libraries/Hotcakes.Commerce/Catalog/Variant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public Variant()
Sku = string.Empty;
Price = -1;
Selections = new OptionSelectionList();
CustomProperty = string.Empty;
}

/// <summary>
Expand Down Expand Up @@ -71,6 +72,11 @@ public Variant()
/// </summary>
public decimal Price { get; set; }

/// <summary>
/// The Custom Property to add further variant details
/// </summary>
public string CustomProperty { get; set; }

/// <summary>
/// These are the options that define the variant.
/// </summary>
Expand Down Expand Up @@ -127,7 +133,8 @@ public VariantDTO ToDto()
ProductId = ProductId,
Sku = Sku,
Price = Price,
Selections = selDto
Selections = selDto,
CustomProperty = CustomProperty
};
}
}
Expand Down
2 changes: 2 additions & 0 deletions Libraries/Hotcakes.Commerce/Catalog/VariantRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ protected override void CopyDataToModel(hcc_Variants data, Variant model)
}
model.Sku = data.Sku ?? string.Empty;
model.StoreId = data.StoreId;
model.CustomProperty = data.CustomProperty;
}

protected override void CopyModelToData(hcc_Variants data, Variant model)
Expand All @@ -76,6 +77,7 @@ protected override void CopyModelToData(hcc_Variants data, Variant model)
data.SelectionData = Json.ObjectToJson(model.Selections);
data.Sku = model.Sku;
data.StoreId = model.StoreId;
data.CustomProperty = model.CustomProperty;
}


Expand Down
11 changes: 7 additions & 4 deletions Libraries/Hotcakes.Commerce/Data/EF/HccDbContext.edmx
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@
<Property Name="RoleName" Type="nvarchar" Nullable="false" MaxLength="250" />
<Property Name="ExpirationPeriod" Type="int" Nullable="false" />
<Property Name="ExpirationPeriodType" Type="int" Nullable="false" />
<Property Name="Notify" Type="bit" Nullable="false" />
<Property Name="Notify" Type="bit" Nullable="false" />
</EntityType>
<EntityType Name="hcc_News">
<Key>
Expand Down Expand Up @@ -1551,7 +1551,8 @@
<Property Name="Sku" Type="nvarchar" Nullable="false" MaxLength="255" />
<Property Name="Price" Type="decimal" Nullable="false" Scale="10" />
<Property Name="SelectionData" Type="nvarchar(max)" Nullable="false" />
<Property Name="StoreId" Type="bigint" Nullable="false" />
<Property Name="StoreId" Type="bigint" Nullable="false" />
<Property Name="CustomProperty" Type="nvarchar(max)" Nullable="false" />
</EntityType>
<EntityType Name="hcc_Vendor">
<Key>
Expand Down Expand Up @@ -3542,6 +3543,7 @@
<Property Type="Decimal" Name="Price" Nullable="false" Precision="18" Scale="10" />
<Property Type="String" Name="SelectionData" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
<Property Type="Int64" Name="StoreId" Nullable="false" />
<Property Type="String" Name="CustomProperty" Nullable="false" MaxLength="Max" FixedLength="false" Unicode="true" />
<NavigationProperty Name="hcc_Product" Relationship="EfModels.FK_hcc_Variants_hcc_Product" FromRole="hcc_Variants" ToRole="hcc_Product" />
</EntityType>
<EntityType Name="hcc_Vendor">
Expand Down Expand Up @@ -4364,7 +4366,7 @@
<NavigationProperty Name="hcc_ProductType" Relationship="EfModels.FK_hcc_MembershipProductType_hcc_ProductType" FromRole="hcc_MembershipProductType" ToRole="hcc_ProductType" />
<Property Type="Int32" Name="ExpirationPeriod" Nullable="false" />
<Property Type="Int32" Name="ExpirationPeriodType" Nullable="false" />
<Property Type="Boolean" Name="Notify" Nullable="false" />
<Property Type="Boolean" Name="Notify" Nullable="false" />
</EntityType>
<Association Name="FK_hcc_MembershipProductType_hcc_ProductType">
<End Type="EfModels.hcc_ProductType" Role="hcc_ProductType" Multiplicity="1" />
Expand Down Expand Up @@ -5763,6 +5765,7 @@
<ScalarProperty Name="Sku" ColumnName="Sku" />
<ScalarProperty Name="ProductId" ColumnName="ProductId" />
<ScalarProperty Name="bvin" ColumnName="bvin" />
<ScalarProperty Name="CustomProperty" ColumnName="CustomProperty" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
Expand Down Expand Up @@ -6251,7 +6254,7 @@
<EntitySetMapping Name="hcc_MembershipProductType">
<EntityTypeMapping TypeName="EfModels.hcc_MembershipProductType">
<MappingFragment StoreEntitySet="hcc_MembershipProductType">
<ScalarProperty Name="Notify" ColumnName="Notify" />
<ScalarProperty Name="Notify" ColumnName="Notify" />
<ScalarProperty Name="ExpirationPeriodType" ColumnName="ExpirationPeriodType" />
<ScalarProperty Name="ExpirationPeriod" ColumnName="ExpirationPeriod" />
<ScalarProperty Name="RoleName" ColumnName="RoleName" />
Expand Down
3 changes: 2 additions & 1 deletion Libraries/Hotcakes.Commerce/Data/EF/hcc_Variants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public partial class hcc_Variants
public decimal Price { get; set; }
public string SelectionData { get; set; }
public long StoreId { get; set; }

public string CustomProperty { get; set; }

public virtual hcc_Product hcc_Product { get; set; }
}
}
7 changes: 7 additions & 0 deletions Libraries/Hotcakes.CommerceDTO/v1/Catalog/VariantDTO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public VariantDTO()
Selections = new List<OptionSelectionDTO>();
Sku = string.Empty;
Price = -1;
CustomProperty = string.Empty;
}

/// <summary>
Expand Down Expand Up @@ -78,5 +79,11 @@ public VariantDTO()
/// </summary>
[DataMember]
public List<OptionSelectionDTO> Selections { get; set; }

/// <summary>
/// The Custom Property to add further variant details
/// </summary>
[DataMember]
public string CustomProperty { get; set; }
}
}
Binary file modified WebDeploy/DNN_Platform_8.0.3_Install.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ $(document).ready(function () {
containment: 'parent',
opacity: '0.75',
cursor: 'move',
forcePlaceholderSize: true,
tolerance: 'pointer',
update: function (event, ui) {
var sorted = $(this).sortable('toArray');
sorted += '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
title: "Edit Variant",
width: 500,
height: 'auto',
maxHeight: 500,
maxHeight: 600,
parentElement: '#<%=pnlEditVariant.ClientID%>',
close: function () {
<%= ClientScript.GetPostBackEventReference(lnkCancel, "") %>
Expand Down Expand Up @@ -120,8 +120,17 @@
<label class="hcLabel">Price</label>
<asp:TextBox ID="txtVariantPrice" runat="server" />
</div>

</div>
</div>
<div class="hcColumnLeft" style="width:100%">
<div class="hcForm">
<div class="hcFormItem">
<label class="hcLabel">Custom Property</label>
<asp:TextBox ID="txtVariantCustomProperty" runat="server" Width="400" Height="90" TextMode="MultiLine" />
</div>
</div>
</div>
<ul class="hcActions">
<li>
<asp:LinkButton ID="lnkSaveVariant" CssClass="hcPrimaryAction" Text="Save" OnClick="btnSave_Click" runat="server" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ protected void btnSave_Click(object sender, EventArgs e)
item.Price = Money.RoundCurrency(p);
}

item.CustomProperty = txtVariantCustomProperty.Text;

if (ucVariantImage.HasFile)
{
DiskStorage.CopyProductVariantImage(HccApp.CurrentStore.Id, ProductId, item.Bvin,
Expand All @@ -194,6 +196,7 @@ private void ShowDialog()
lblVariantDescription.Text = GetVariantDescription(variant);
txtVariantSku.Text = string.IsNullOrEmpty(variant.Sku) ? _currentProduct.Sku : variant.Sku;
txtVariantPrice.Text = (variant.Price < 0 ? _currentProduct.SitePrice : variant.Price).ToString("c");
txtVariantCustomProperty.Text = variant.CustomProperty;

ucVariantImage.ImageUrl = DiskStorage.ProductVariantImageUrlMedium(HccApp, _currentProduct.Bvin,
_currentProduct.ImageFileSmall, variant.Bvin, HccApp.IsCurrentRequestSecure());
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 47e2271

Please sign in to comment.