This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> | |
<sitecore> | |
<services> | |
<configurator type="SitecoreXC92.ProductExtension.RegisterDependencies.RegisterDependencies, SitecoreXC92.ProductExtension" /> | |
</services> | |
</sitecore> | |
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Extensions.DependencyInjection; | |
using Sitecore.DependencyInjection; | |
using SitecoreXC92.ProductExtension.Controllers; | |
using SitecoreXC92.ProductExtension.Repositories; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
namespace SitecoreXC92.ProductExtension.RegisterDependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using Sitecore.XA.Foundation.MarkupDecorator.Extensions; | |
@using Sitecore.XA.Foundation.SitecoreExtensions.Extensions; | |
@model SitecoreXC92.ProductExtension.Models.ProductExtensionRenderingModel | |
@{ | |
var messageSummaryError = "No Eroor"; | |
} | |
@if (!string.IsNullOrEmpty(Model.ErrorMessage)) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Sitecore.Commerce.XA.Foundation.Common.Context; | |
using Sitecore.Commerce.XA.Foundation.Common.Controllers; | |
using Sitecore.Commerce.XA.Foundation.Common.Providers; | |
using Sitecore.Commerce.XA.Foundation.Connect; | |
using Sitecore.DependencyInjection; | |
using Sitecore.Diagnostics; | |
using SitecoreXC92.ProductExtension.Models; | |
using SitecoreXC92.ProductExtension.Repositories; | |
using System; | |
using System.Collections.Generic; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Sitecore.Commerce.XA.Feature.Catalog.Repositories; | |
using Sitecore.Commerce.XA.Foundation.Common.Context; | |
using Sitecore.Commerce.XA.Foundation.Common.Models; | |
using Sitecore.Commerce.XA.Foundation.Connect.Managers; | |
using Sitecore.Commerce.XA.Feature.Catalog.Models; | |
using Sitecore.Commerce.XA.Foundation.Common.Search; | |
using Sitecore.Commerce.XA.Foundation.Connect; | |
using SitecoreXC92.ProductExtension.Models; | |
using Sitecore.Diagnostics; | |
using Sitecore.Commerce.XA.Foundation.Catalog.Managers; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Sitecore.Commerce.XA.Foundation.Connect; | |
using SitecoreXC92.ProductExtension.Models; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
namespace SitecoreXC92.ProductExtension.Repositories | |
{ | |
public interface IProductExtensionRepository |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Sitecore.Commerce.XA.Feature.Catalog.Models; | |
using Sitecore.Commerce.XA.Foundation.Common.Context; | |
using Sitecore.Commerce.XA.Foundation.Common.Models; | |
using Sitecore.Commerce.XA.Foundation.Common.Providers; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
namespace SitecoreXC92.ProductExtension.Models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Script to export XC certificate from vagrant machine along with private key | |
$Password = "sitecore"; #password to access certificate after expting | |
$ExportPathRoot = "C:\Utilities" | |
$CertListToExport = Get-ChildItem -Path cert:\LocalMachine\My | ?{ $_.Thumbprint -Like "2030E8751EB6647C305B7EE2A4D917C7310AE59B" } | |
foreach($CertToExport in $CertListToExport | Sort-Object Subject) | |
{ | |
# Destination Certificate Name should be CN. | |
# Since subject contains CN, OU and other information, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ManagerResponse<CartResult, Cart> AddLineItemsToCartWithoutVisitorContext(CommerceStorefront storefront, Cart cart, IEnumerable<CartLineArgument> cartLines) | |
{ | |
List<CartLine> cartLineList = new List<CartLine>(); | |
foreach (CartLineArgument cartLine in cartLines) | |
{ | |
Decimal quantity = cartLine.Quantity; | |
CommerceCartLine commerceCartLine1 = new CommerceCartLine(cartLine.CatalogName, cartLine.ProductId, cartLine.VariantId == "-1" ? (string)null : cartLine.VariantId, quantity); | |
cartLineList.Add((CartLine)commerceCartLine1); | |
if (cartLine.SubLines.Any<CartLineArgument>()) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public CartResult LoadCart( string shopName, string cartName, string customerId, bool recalculateTotals) | |
{ | |
CartResult cartResult = _cartServiceProvider.LoadCart((LoadCartRequest)new LoadCartByNameRequest(shopName, cartName, customerId)); | |
CommerceCart cart = cartResult.Cart as CommerceCart; | |
List<string> stringList = new List<string>(); | |
if (cart != null && cart.OrderForms.Count > 0) | |
stringList.AddRange((IEnumerable<string>)cart.OrderForms[0].PromoCodes ?? Enumerable.Empty<string>()); | |
cartResult.Cart.GetProperties().Add("PromoCodes", (object)stringList); | |
return cartResult; | |
} |
NewerOlder