Skip to content

Research Episerver Foundation #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 64 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
5f09205
Research Optimizely Foundation demo sites - Install and configure Opt…
lamkhai Oct 24, 2023
10db925
Research Catalog content
lamkhai Oct 24, 2023
9f1bb08
Research Catalog content - Product variants - Get a product's variants
lamkhai Oct 24, 2023
d7da1df
Research Catalog content - Product variants - Add/Remove a product va…
lamkhai Oct 24, 2023
0392e5f
Research Catalog content - Bundles and packages - Get the entries of …
lamkhai Oct 24, 2023
92bca50
Research Catalog content - Bundles and packages - Get the bundle/pack…
lamkhai Oct 24, 2023
eeb1552
Research Catalog content - Bundles and packages - Adding an entry to …
lamkhai Oct 25, 2023
8b8466a
Research Catalog content - Bundles and packages - Update an entry in …
lamkhai Oct 25, 2023
1c17f6f
Research Catalog content - Bundles and packages - Remove an entry fro…
lamkhai Oct 25, 2023
2b35cea
Research Catalog content - Categorizations - Get the categorizations …
lamkhai Oct 25, 2023
3ba4e6c
Research Catalog content - Categorizations - Adding a categorization …
lamkhai Oct 25, 2023
b4a539d
Research Catalog content - Categorizations - Removing a categorizatio…
lamkhai Oct 25, 2023
9b8a155
Research Catalog content - Related entries - Get related entries for …
lamkhai Oct 25, 2023
f25c0d5
Research Catalog content - Related entries - Add a related entry to a…
lamkhai Oct 25, 2023
ba7105f
Research Catalog content - Related entries - Remove a related entry f…
lamkhai Oct 25, 2023
08a24d2
Research Catalog content - Register services
lamkhai Oct 25, 2023
79e638b
Research Catalog content - Related entries - Set up available associa…
lamkhai Oct 25, 2023
cdeb089
Research Catalog content - Catalog content provider - Load a product
lamkhai Oct 25, 2023
05de905
Research Catalog content - Catalog content provider - Get children of…
lamkhai Oct 25, 2023
781e418
Research Catalog content - Catalog content provider - Determine the c…
lamkhai Oct 25, 2023
006bf47
Research Catalog content - Catalog content provider - Determine the c…
lamkhai Oct 25, 2023
9544ca9
Merge branch 'feature/Foundation' of https://github.com/lamkhai/epise…
lamkhai Oct 25, 2023
45218a8
Research Pricing - Pricing & PriceType examples
lamkhai Oct 26, 2023
77aaf15
Research Pricing - Pricing examples
lamkhai Oct 26, 2023
fd2e248
Research Pricing - Warehouses and inventories
lamkhai Oct 26, 2023
9b4bd93
Research Orders - Order manipulation - Create orders
lamkhai Oct 26, 2023
54cd029
Research Orders - Order manipulation - Load orders
lamkhai Oct 26, 2023
51daa07
Research Orders - Order manipulation - Save orders
lamkhai Oct 26, 2023
0226fbf
Research Orders - Order manipulation - Delete orders
lamkhai Oct 26, 2023
1a572b5
Research Orders - Order manipulation - Work with order forms
lamkhai Oct 26, 2023
6b433a0
Research Orders - Order manipulation - Work with order forms
lamkhai Oct 26, 2023
0fcd4df
Merge branch 'feature/Foundation' of https://github.com/lamkhai/epise…
lamkhai Oct 27, 2023
5ab7644
Research Orders - Order manipulation - Work with shipments
lamkhai Oct 27, 2023
54c0f35
Research Orders - Order manipulation - Work with payments
lamkhai Oct 27, 2023
df5309a
Research Orders - Order manipulation - Work with line items
lamkhai Oct 27, 2023
eb36843
Research Orders - Order manipulation - Work with addresses
lamkhai Oct 27, 2023
2da7ce6
Research Orders - Order manipulation - Work with notes
lamkhai Oct 27, 2023
1db56da
Research Orders - Order processing - Validating line items
lamkhai Oct 27, 2023
64b700d
Research Orders - Order processing - Update placed price
lamkhai Oct 27, 2023
ead7041
Research Orders - Order processing - Apply discounts
lamkhai Oct 27, 2023
80fb678
Fix error
lamkhai Oct 30, 2023
742717d
Research Orders - Order processing - Process payments
lamkhai Oct 30, 2023
5b339c1
Research Orders - Order processing
lamkhai Oct 30, 2023
9b268a1
Research Orders - Order processing - Update inventory
lamkhai Oct 30, 2023
6d12a25
Research Orders - Order processing - Adjust inventory
lamkhai Oct 30, 2023
f6708df
Research Orders - Order processing - Process purchase orders (Hold, R…
lamkhai Oct 30, 2023
9eeded4
Research Orders - Shopping carts - Add items to a cart
lamkhai Oct 30, 2023
5f97961
Research Orders - Shopping carts - Remove items from a cart
lamkhai Oct 30, 2023
4afef46
Research Orders - Calculate orders - Line item calculator
lamkhai Oct 31, 2023
7b190e8
Research Orders - Calculate orders - Shipping calculator
lamkhai Oct 31, 2023
da869ca
Research Orders - Calculate orders
lamkhai Oct 31, 2023
6bf8c76
Research Orders - Calculate orders - Tax calculator
lamkhai Oct 31, 2023
22adfa7
Research Orders - Calculate orders - Order form calculator
lamkhai Oct 31, 2023
be736ff
Research Orders - Calculate orders - Order group calculator
lamkhai Oct 31, 2023
73f2cc6
Research Orders - Calculate orders - Return line item calculator
lamkhai Oct 31, 2023
0e5146c
Research Orders - Calculate orders - Return order form calculator
lamkhai Oct 31, 2023
77285e0
Miss code
lamkhai Nov 1, 2023
9b39593
Research Marketing and campaigns
lamkhai Nov 1, 2023
783ac30
Research Marketing and campaigns - Promotions
lamkhai Nov 1, 2023
95f0a88
Research Marketing and campaigns - Promotion engine
lamkhai Nov 2, 2023
d0024c0
Research Marketing and campaigns - Custom promotions
lamkhai Nov 2, 2023
127f9d6
Research Marketing and campaigns - Hide promotion types
lamkhai Nov 2, 2023
b248f24
Research Marketing and campaigns - Promotion exclusions
lamkhai Nov 3, 2023
8d94166
Research Marketing and campaigns - Coupons
lamkhai Nov 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,5 @@ src/Foundation/App_Data/log*.txt
src/Foundation/License.config
rebuild.cmd
resetup.cmd
/log.txt
/log.txt
/src/TestF/*
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="utf-8"?>
<Build xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<LastBuildDate>2022-05-02T01:05:17.6359015+07:00</LastBuildDate>
<LastBuildDate>2023-10-23T09:56:05.9984425+07:00</LastBuildDate>
<Status>Completed</Status>
</Build>
96,744 changes: 53,736 additions & 43,008 deletions src/Foundation/App_Data/GeoLite2-City-Locations-en.csv

Large diffs are not rendered by default.

Binary file modified src/Foundation/App_Data/GeoLite2-City.mmdb
Binary file not shown.
Binary file modified src/Foundation/App_Data/SearchIndex/ECApplication/catalog/_0.si
Binary file not shown.
Binary file modified src/Foundation/App_Data/SearchIndex/ECApplication/catalog/_1.si
Binary file not shown.
Binary file modified src/Foundation/App_Data/SearchIndex/ECApplication/catalog/_2.si
Binary file not shown.
Binary file modified src/Foundation/App_Data/SearchIndex/ECApplication/catalog/_3.si
Binary file not shown.
Binary file modified src/Foundation/App_Data/SearchIndex/ECApplication/catalog/_4.si
Binary file not shown.
Binary file modified src/Foundation/App_Data/SearchIndex/ECApplication/catalog/_5.si
Binary file not shown.
Binary file added src/Foundation/DB/cms.bacpac
Binary file not shown.
Binary file added src/Foundation/DB/commerce.bacpac
Binary file not shown.
5 changes: 1 addition & 4 deletions src/Foundation/Features/Api/AuthorizedApiController.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace Foundation.Features.Api
namespace Foundation.Features.Api
{
[Authorize]
public class AuthorizedApiController : Controller
Expand Down
16 changes: 1 addition & 15 deletions src/Foundation/Features/Api/CatalogExportController.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
using EPiServer;
using EPiServer.Framework.Blobs;
using EPiServer.Framework.Blobs;
using EPiServer.Logging;
using Mediachase.Commerce.Catalog.ImportExport;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using Mediachase.Commerce.Catalog;
using EPiServer.Commerce.Catalog.ContentTypes;
using System.IO;
using System.IO.Compression;
using System.Net.Http.Headers;
using Microsoft.Net.Http.Headers;
using EPiServer.Authorization;
using Microsoft.AspNetCore.Authorization;

namespace Foundation.Features.Api
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using Foundation.Infrastructure.Cms.Attributes;

namespace Foundation.Features.Api
{
public class ExternalLoginConfirmationViewModel
Expand Down
15 changes: 1 addition & 14 deletions src/Foundation/Features/Api/PublicApiController.cs
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
using EPiServer;
using EPiServer.Core;
using EPiServer.Framework.Localization;
using EPiServer.Web.Routing;
using Foundation.Features.Login;
using Foundation.Features.Login;
using Foundation.Features.MyAccount.AddressBook;
using Foundation.Infrastructure.Cms;
using Foundation.Infrastructure.Cms.Extensions;
using Foundation.Infrastructure.Cms.Users;
using Foundation.Infrastructure.Commerce.Customer.Services;
using Foundation.Infrastructure.Helpers;
using Foundation.Infrastructure.Personalization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;

namespace Foundation.Features.Api
Expand Down Expand Up @@ -103,7 +91,6 @@ public async Task<ActionResult> RegisterAccount(RegisterAccountViewModel viewMod
FirstName = viewModel.Address.FirstName,
LastName = viewModel.Address.LastName,
RegistrationSource = "Registration page",
NewsLetter = viewModel.Newsletter,
IsApproved = true
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
using EPiServer.Commerce;
using EPiServer.Commerce.Catalog.ContentTypes;
using EPiServer.Core;
using EPiServer.DataAbstraction;
using EPiServer.DataAnnotations;
using Foundation.Features.Shared;
using Foundation.Infrastructure;
using System.ComponentModel.DataAnnotations;

namespace Foundation.Features.Blocks.AssetsDownloadLinksBlock
namespace Foundation.Features.Blocks.AssetsDownloadLinksBlock
{
[ContentType(DisplayName = "Assets Download Links Block",
GUID = "F8C78C8A-9EB8-4171-8A0B-8CA4B190DE3E",
Expand All @@ -23,7 +14,7 @@ public class AssetsDownloadLinksBlock : FoundationBlockData
Order = 10)]
[Required]
[AllowedTypes(new[] { typeof(ContentFolder), typeof(CatalogContentBase) })]
[UIHint(UIHint.AllContent)]
[UIHint(EPiServer.Commerce.UIHint.AllContent)]
public virtual ContentReference RootContent { get; set; }

[Display(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
using EPiServer;
using EPiServer.Commerce.Catalog.ContentTypes;
using EPiServer.Core;
using EPiServer.Web.Mvc;
using EPiServer.Web.Routing;
using Foundation.Infrastructure.Commerce.Extensions;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Foundation.Features.Blocks.AssetsDownloadLinksBlock.Component
namespace Foundation.Features.Blocks.AssetsDownloadLinksBlock.Component
{
public class AssetsDownloadLinksBlockComponent : AsyncBlockComponent<AssetsDownloadLinksBlock>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using EPiServer;
using EPiServer.Core;
using EPiServer.Framework.Blobs;
using Microsoft.AspNetCore.Mvc;
using EPiServer.Framework.Blobs;
using System.IO;

namespace Foundation.Features.Blocks.AssetsDownloadLinksBlock
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using EPiServer.Core;
using System.Collections.Generic;

namespace Foundation.Features.Blocks.AssetsDownloadLinksBlock
namespace Foundation.Features.Blocks.AssetsDownloadLinksBlock
{
public class AssetsDownloadLinksBlockViewModel
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Advanced.CMS.GroupingHeader;
using EPiServer;
using EPiServer.Core;
using EPiServer.DataAbstraction;
using EPiServer.DataAnnotations;
using EPiServer.Labs.ContentManager.Cards;
using EPiServer.Labs.ContentManager.Dashboard;
using EPiServer.Shell.ObjectEditing;
using EPiServer.SpecializedProperties;
using EPiServer.Web;
using Foundation.Features.Shared;
using Foundation.Infrastructure;
using Foundation.Infrastructure.Cms.Attributes;

namespace Foundation.Features.Blocks.BootstrapCardBlock
{
[ContentType(DisplayName = "Bootstrap Card Block",
GUID = "A0D9E5C6-3030-4D9C-9FCE-F51D1ABB2A04",
Description = "Adds bootstrap card block to the page",
GroupName = GroupNames.Content)]
[ImageUrl("/icons/cms/blocks/CMS-icon-block-03.png")]
public class BootstrapCardBlock : FoundationBlockData, IDashboardItem
{
[GroupingHeader("Card Alignment Options")]
// Card alignment -- left/center/right
[SelectOne(SelectionFactoryType = typeof(CardAlignmentSelectionFactory))]
[Display(Name = "Card alignment",
Order = 5,
GroupName = SystemTabNames.Content)]
public virtual string CardAlignment { get; set; }

[GroupingHeader("Card Text and Content Properties")]
[CultureSpecific]
[Display(Name = "Card header",
Order = 10)]
public virtual string CardHeader { get; set; }

[CultureSpecific]
[Display(Name = "Card title",
Order = 20)]
public virtual string CardTitle { get; set; }

// Card title size -- h5 (default), h4, h3, h2, h1
[SelectOne(SelectionFactoryType = typeof(TitleSizeSelectionFactory))]
[CultureSpecific]
[Display(Name = "Card title size",
Order = 23)]
public virtual string CardTitleSize { get; set; }

[CultureSpecific]
[Display(Name = "Card subtitle",
Order = 30)]
public virtual string CardSubtitle { get; set; }

[CultureSpecific]
[Display(Name = "Card body",
Order = 40,
GroupName = SystemTabNames.Content)]
[AllowedTypes(new[] { typeof(IContentData) })]
public virtual ContentArea CardContentArea { get; set; }

[CultureSpecific]
[Display(Name = "Card footer",
Order = 60)]
public virtual string CardFooter { get; set; }

[GroupingHeader("Card Image Properties")]
[CultureSpecific]
[UIHint(UIHint.Image)]
[Display(Name = "Card image (optional)",
Order = 80,
GroupName = SystemTabNames.Content)]
public virtual ContentReference CardImage { get; set; }

[GroupingHeader("Card Button and Link Properties")]
[CultureSpecific]
[Display(Name = "Card button text (button hidden if blank)",
Description = "Text to show for card button -- button hidden if blank",
Order = 100,
GroupName = SystemTabNames.Content)]
public virtual string CardButtonText { get; set; }

[CultureSpecific]
[Display(Name = "Card button link (optional)",
Description = "Link for card button",
Order = 120,
GroupName = SystemTabNames.Content)]
public virtual Url CardButtonLink { get; set; }

[Display(Name = "Make entire card clickable?",
Description = "Click anywhere on card to browse to URL defined in button (instead of only clicking the button)?",
Order = 125,
GroupName = SystemTabNames.Content)]
public virtual bool CardClickable { get; set; }

[CultureSpecific]
//[UIHint("FooterColumnNavigation")]
[Display(Name = "Card Links (0-3 links supported)",
Description = "Links to show on card (0-3 links supported)",
Order = 140,
GroupName = SystemTabNames.Content)]
[MaxElements(3)]
public virtual LinkItemCollection CardLinks { get; set; }

[GroupingHeader("Misc Properties")]
[Display(Name = "CSS class",
Description = "Custom CSS class for card (to help with custom styles)",
Order = 200,
GroupName = SystemTabNames.Content)]
public virtual string CssClass { get; set; }

public void SetItem(ItemModel itemModel)
{
itemModel.Description = CardTitle;
itemModel.Image = CardImage;
}

public override void SetDefaultValues(ContentType contentType)
{
base.SetDefaultValues(contentType);
CardAlignment = "";
CardTitleSize = "h5";
CardButtonText = "";
}

public class CardAlignmentSelectionFactory : ISelectionFactory
{
public IEnumerable<ISelectItem> GetSelections(ExtendedMetadata metadata)
{
return new ISelectItem[]
{
new SelectItem { Text = "Left (default)", Value = "" },
new SelectItem { Text = "Center", Value = "text-center" },
new SelectItem { Text = "Right ", Value = "text-end" },
};
}
}

public class TitleSizeSelectionFactory : ISelectionFactory
{
public IEnumerable<ISelectItem> GetSelections(ExtendedMetadata metadata)
{
return new ISelectItem[]
{
new SelectItem { Text = "h5 (default)", Value = "h5" },
new SelectItem { Text = "h4", Value = "h4" },
new SelectItem { Text = "h3", Value = "h3" },
new SelectItem { Text = "h2", Value = "h2" },
new SelectItem { Text = "h1", Value = "h1" },
};
}
}
}
}
Loading