Quantcast
Channel: Customized Commerce 13 and earlier versions
Viewing all 9642 articles
Browse latest View live

Null exception in GetUrl in search provider indexer

$
0
0

I'm trying to use GetUrl() in a commerce search provider indexer and GetUrl throws a null exception.

Doing this:

var urlResolver = ServiceLocator.Current.GetInstance<UrlResolver>();
urlResolver.GetUrl(node.ContentLink)


Gives me

Value cannot be null.
Parameter name: httpContext

   at System.Web.HttpContextWrapper..ctor(HttpContext httpContext)
   at EPiServer.Framework.FrameworkInitialization.<ConfigureContainer>b__1()
   at EPiServer.Commerce.Routing.RequestCacheUrlResolver.GetVirtualPath(ContentReference contentLink, String language, ContextMode contextMode, Func`1 getVirtualPathAction)
   at EPiServer.Commerce.Routing.RequestCacheUrlResolver.GetUrl(ContentReference contentLink)
   .
   (private code)
   .
   at Mediachase.Search.SearchManager.BuildIndex(Boolean rebuild)


Disable Legacy Marketing System

$
0
0

I may be completly overlooking this in the documentation, but....

How do I disable the legacy marketing system?  I was able to turn on the Episerver beta features, and I have access to the new (BETA) Marketing system, but I would like to disable the legacy marketing system.  How do I do this?

SQL command timeout when importing catalog.xml

$
0
0

Epi commerce 9.16

We are using the inRiver integration to import the product catalog. When the catalog meta data in epi is clean and the catalog.xml is sent over to epi the catalog data gets imported and everyone is happy. But subsequent imports of the full catalog structure ends in SQL command timeouts. We have tried to decrease the catalogImportBatchSize and set the commandTimeout but with no luck. Any more ideas out there?

2016-06-23 03:32:43,323 [47] ERROR inRiver.EPiServerCommerce.Import.InriverDataImportController: Catalog Import Failed
System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. This failure occurred while attempting to connect to the routing destination. The duration spent while attempting to connect to the original server was - [Pre-Login] initialization=1; handshake=15; [Login] initialization=0; authentication=0; [Post-Login] complete=1; ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute[TResult](Func`1 method)
at Mediachase.Data.Provider.SqlDataProvider.ExecuteNonExec(DataCommand command)
at Mediachase.MetaDataPlus.Common.DBHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, Int32 commandTimeout, DataParameter[] commandParameters)
at Mediachase.MetaDataPlus.Common.DBHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, DataParameter[] commandParameters)
at Mediachase.Commerce.Catalog.Data.CatalogEntryAdmin.Save()
at Mediachase.Commerce.Catalog.Managers.CatalogEntryManager.SaveCatalogEntry(CatalogEntryDto dataset)
at Mediachase.Commerce.Catalog.ImportExport.CatalogImportExport.SaveEntryDto(CatalogEntryDto workingCatalogEntryDto, Dictionary`2 metaObjectsList, Dictionary`2 priceGroups, Dictionary`2 warehouseInventories)
at Mediachase.Commerce.Catalog.ImportExport.CatalogImportExport.ReadEntries(Guid applicationId, Int32 catalogId, XmlReader reader, String baseFilePath, Int32 totalCount, String defaultCurrency, Boolean overwrite, IEnumerable`1 catalogLanguages)
at Mediachase.Commerce.Catalog.ImportExport.CatalogImportExport.Import(Stream input, Guid applicationId, String baseFilePath, Boolean overwrite)
at inRiver.EPiServerCommerce.Import.InriverDataImportController.ImportCatalogXmlWithHandlers(Stream catalogXml, IEnumerable`1 catalogImportHandlers)
at inRiver.EPiServerCommerce.Import.InriverDataImportController.ImportCatalogXml(String path)
ClientConnectionId:1e33a6e3-68bb-4431-a86a-d686d6fd4b8e
Error Number:-2,State:0,Class:11
ClientConnectionId before routing:87a16f53-a5a8-4a75-858a-87672ec65a16
Routing Destination:b495ff6b49fe.tr16.eastus1-a.worker.database.windows.net,11016

Allow prices with value 0

$
0
0

Hi!

If the price of a cart item is 0, it will be removed by the CartValidate workflow. Is there some way to prevent this?

I don't want to exclude ValidateLineItemsActivity entirely, since there's so many other things going on in that validation step.

Running EPi commerce 9.18.

Issue with the IPriceService.GetDefaultPrice. Price is not returned if the case of the product code is different.

$
0
0

Hi

Seems the small issue was found out during the default price fetching.

Eg:

var catalogKey = new CatalogKey(AppContext.Current.ApplicationId, catalogEntryCode);

var defaultPrice = priceService.GetDefaultPrice(marketId, DateTime.UtcNow, catalogKey, market.DefaultCurrency);

 

If the catalogEntryCode is in the lowercase, but the price was saved with the uppercase catalogEntryCode, then the price is not returned.

 

However the priceService.GetCatalogEntryPrices(catalogKey); works  fine. And the necessary price is in the list.

 

Is there any possibility to fix this?

Promotions [Beta]: Different discount percent for each line item.

$
0
0

I have EPiServer.Commerce 9.19.0 installed (probably promotions are not Beta anymore). I have a requirement to be able to apply different percentage discount for each line item. Basically, I am storing discount % in line item metadata.

Now I created new EntryPromotion and entry promotion processor. In the evaluate method I am loading all line items which has discount % stored in metadata and want to apply those, but when creating RewardDescription there is no way to set discount on each line item - only one value for all line items:

protected override RewardDescription Evaluate(
    AdditionalItemDiscountPromoData promotionData,
    PromotionProcessorContext context)
{
    var orderForm = context.OrderForm;
    var cart = context.OrderGroup as Cart;
    if (cart == null)
    {
        return NoReward(promotionData);
    }
    var lineItems = cart.GetAllLineItems().Where(HasDiscount);
    var priceEntries = new List();
    foreach (var lineItem in lineItems)
    {
        var discount = // <-- discount to apply to single item
			(decimal) (item.Properties[Constants.AdditionalDiscountPercentMetaField] ?? 0.0m);
		priceEntries.Add(new PriceEntry(lineItem));
	}
	var discountToAllItems = 10;
	return RewardDescription.CreatePercentageReward(
		FulfillmentStatus.Fulfilled,
		new[] { CreateRedemptionDescription(new AffectedEntries(priceEntries)) },
		promotionData,
		discountToAllItems, // <-- only one discount value can be applied to all items but require separate for each item
		description: $"{promotionData.DiscountPercent} % discount applied to line items");
}

Is there some other way to apply such promotion?

Customer Price Group Price not being applied to anonymous cart after user logs in

$
0
0

Hi,

I am running into an issue with Customer Price Groups and anonymous cart transfer after logging in. It is really easy to replicate. If a user is not logged in, and adds items to their cart, the items have the regular list price, as expected. If the user logs in and is part of the Customer Price Group, the cart that gets transferred over has the list price for the items instead of the Customer Price Group prices. On the cart page, I am running the CartValidate workflow, and I guess I expected it to see that the user is a part of the Customer Price Group and to recalculate the totals. That is not happening. Am I missing something, or do I have to write some custom logic to handle this?

Here are the versions I am running:

<package id="EPiServer.CMS" version="9.12.0" targetFramework="net452" /><package id="EPiServer.CMS.Core" version="9.12.0" targetFramework="net452" /><package id="EPiServer.CMS.UI" version="9.9.0" targetFramework="net452" /><package id="EPiServer.CMS.UI.Core" version="9.9.0" targetFramework="net452" /><package id="EPiServer.Commerce" version="9.19.1" targetFramework="net452" /><package id="EPiServer.Commerce.Core" version="9.19.1" targetFramework="net452" /><package id="EPiServer.Commerce.FindSearchProvider" version="8.13.0" targetFramework="net452" /><package id="EPiServer.Commerce.UI" version="9.19.1" targetFramework="net452" /><package id="EPiServer.Commerce.UI.ManagerIntegration" version="9.19.1" targetFramework="net452" />

Any insight into this would be much appreciated!

-John

NullReferenceException efter added inventory on item

$
0
0

Hi Episerver developers,

i get this exception that i can't wrap my head around and hopefully you can give me some ideas.

My product listing works and and shows the articles when i click on them until i add inventory to the item. 

Then it breaks when trying to go to the productdetail view from the list.

I get this exception and the breakpoint doesn't hit the productdetail controller.

Im running commerce 9.19.1

Any ideas would be much appritiated?!

[NullReferenceException: Object reference not set to an instance of an object.]
EPiServer.Commerce.Catalog.Provider.Construction.CatalogPropertyLoader.AddStockPlacementPropertyValues(VariationRow variationRow, IContent content) +569
EPiServer.Commerce.Catalog.Provider.Construction.CatalogPropertyLoader.LoadStaticContentProperties(CatalogEntryRow entryRow, CatalogItemSeoRow seoRow, VariationRow variationRow, EntryContentBase content) +155
EPiServer.Commerce.Catalog.Provider.Construction.CatalogPropertyLoader.LoadProperties(CatalogEntryRow entryRow, CatalogItemSeoRow seoRow, VariationRow variationRow, EntryContentBase content, MetaObjectAccessor metaObjectAccessor) +141
EPiServer.Commerce.Catalog.Provider.Construction.EntryBuilder.ConstructEntries(CatalogEntryDto entryDto, IDictionary`2 versionsForUnpublishedContent, IList`1 entryNodeRelations, String language) +708
EPiServer.Commerce.Catalog.Provider.Construction.EntryBuilder.Create(IList`1 contentLinks, String language) +638
EPiServer.Commerce.Catalog.Provider.<>c__DisplayClass13_0.<LoadSpecificContentInstances>b__0(ICatalogContentBuilder builder, IList`1 links) +16
EPiServer.Commerce.Catalog.Provider.CatalogContentLoader.ConstructContent(IList`1 contentLinks, Func`3 createContentFunc) +339
EPiServer.Commerce.Catalog.Provider.CatalogContentLoader.LoadSpecificContentInstances(IList`1 contentLinks, String language) +453
EPiServer.Commerce.Catalog.Provider.<>c__DisplayClass28_0.<LoadContents>b__0(IList`1 refs) +44
EPiServer.Commerce.Catalog.Provider.CatalogContentProvider.BatchLoad(IList`1 contentLinks, Func`2 dbLoader) +141
EPiServer.Commerce.Catalog.Provider.CatalogContentProvider.LoadContents(IList`1 contentReferences, ILanguageSelector selector) +425
EPiServer.Commerce.Catalog.Provider.CatalogContentProvider.LoadContent(ContentReference contentLink, ILanguageSelector languageSelector) +138
EPiServer.Core.<>c__DisplayClass115_0.<LoadContentFromCacheOrRepository>b__0() +93
EPiServer.Core.OptimisticCache`1.Read(String cacheKey, ReadAndCacheObject`1 readAndCacheObject) +563
EPiServer.Core.ContentProvider.LoadContentFromCacheOrRepository(ContentReference contentreference, ILanguageSelector selector) +728
EPiServer.Core.DefaultContentLoader.GetBySegmentInternal(ContentProvider provider, ContentReference parentLink, String urlSegment, LoaderOptions loaderOptions) +352
EPiServer.Core.DefaultContentLoader.GetBySegment(ContentReference parentLink, String urlSegment, LoaderOptions selector) +56
EPiServer.Core.DefaultContentLoader.GetBySegment(ContentReference parentLink, String urlSegment, CultureInfo language) +99
EPiServer.Commerce.Routing.HierarchicalCatalogPartialRouter.FindNextContentInSegmentPair(CatalogContentBase catalogContent, SegmentPair segmentPair, SegmentContext segmentContext, CultureInfo cultureInfo) +304
EPiServer.Commerce.Routing.HierarchicalCatalogPartialRouter.GetCatalogContentRecursive(CatalogContentBase catalogContent, SegmentPair segmentPair, SegmentContext segmentContext, CultureInfo cultureInfo) +149
EPiServer.Commerce.Routing.HierarchicalCatalogPartialRouter.GetCatalogContentRecursive(CatalogContentBase catalogContent, SegmentPair segmentPair, SegmentContext segmentContext, CultureInfo cultureInfo) +371
EPiServer.Commerce.Routing.HierarchicalCatalogPartialRouter.GetCatalogContentRecursive(CatalogContentBase catalogContent, SegmentPair segmentPair, SegmentContext segmentContext, CultureInfo cultureInfo) +371
EPiServer.Commerce.Routing.HierarchicalCatalogPartialRouter.RoutePartial(PageData content, SegmentContext segmentContext) +307
EPiServer.Web.Routing.PartialRouter`2.RoutePartial(IContent content, SegmentContext segementContext) +119
EPiServer.Web.Routing.Segments.PartialSegment.RouteDataMatch(SegmentContext context) +272
EPiServer.Web.Routing.<>c__DisplayClass44_0.<MatchSegments>b__0(ISegment s) +15
System.Linq.Enumerable.All(IEnumerable`1 source, Func`2 predicate) +146


Deleting a product also deletes order LineItems

$
0
0

Hi,

If I buy a single product, then delete it from Commerce, and then add the shipment to a pick list in Commerce Manager, I get an empty pick list and the shipment and LineItem is deleted from the pending order.

Is this expected behavior? The product/sku is converted to a LineItem when you add it to the cart so that changes in prices and availability won't affect existing orders, but I thougth this also applied when deleting a product?

Lars

Publish all Catalog content in another language

$
0
0

Hello,

We have a catalog that will be used on 20 different languages, the catalog has roughly 1000 products and categories, is there a way to bulk publish all items in another language? otherwise that is too much clicking!

Thank you for your help!

Ben

Commerce Manager: Creating a dropdown property in Contacts

$
0
0

Preferably I would like to create a dictionary dropdown property, customizable by the editor like Customer Group (see screenshot below) in the Contact edit view.

Customer Group property

I've been able to create and display a string property by adding a row in Contact.[MC_BaseForm].xml with Control source="MyProperty" and initializing it in App_Start:

var customerMetadata = DataContext.Current.MetaModel.MetaClasses.Cast().First(mc => mc.Name == "Contact");
customerMetadata.CreateMetaField("MyProperty","My Property",
                    MetaFieldType.Text,
                    null);

Am I doing this correctly so far? How would I go about changing this property (or creating a new one) to display it as a dropdown?

Versions in Commerce Manager project: 

<packageid="EPiServer.CMS.Core"version="8.4.0"targetFramework="net451"/>
<packageid="EPiServer.Commerce.Core"version="8.11.5"targetFramework="net451"/>
<packageid="EPiServer.CommerceManager"version="8.9.0"targetFramework="net451"/>
<packageid="EPiServer.Framework"version="8.4.0"targetFramework="net451"/>

Thank you in advance.

Issue with fetching SKU's

$
0
0

Hi Team,

I am facing issues in fetching the catalog sku's.

Please find the code below

private static IContentLoader contentLoader = ServiceLocator.Current.GetInstance<IContentLoader>();
var catalogRoot = contentLoader.Get<IContent>(Guid.Parse(catalogReference.CatalogContentReferenceId));
var currencySKUs = contentLoader.GetChildren<Currency>(catalogRoot );

The above code is returning the sku's.

But if I remove any sku relation from the catalog, then its is not reflected in the results until I recycle my apppool.

Can you let me if I need to do any configurtaion for this.

CMS version - 7.11
Commerce 7.5

Thanks in advance.

Thanks & Regards,
Manjeera T

Sort order for catalog nodes

$
0
0

Lets say I have the following catalog structure:

Men (Node)
   Accessories (Node)
      Hats (Node)
         HatX (Product)

I want to find all nodes "HatX" belongs to and what the sort order for that node is.

Starting from "HatX" I can retrive the "Hats" node and the sort order like this:

var nodeRelation = currentContent.GetNodeRelations().First();
var parentNode = ContentLoader.Get<ChannelNode>(nodeRelation.Target);
_sortOrderByNode.Add(parentNode.Code, nodeRelation.SortOrder);

Now parentNode will be of type ChannelNode and represent "Hats". I can navigate to "Accessories" by using parentNode.parentLink, but how can I retrieve the sort order? All of the methods below is giving me 0 hits:

var relations = accessoriesNode.GetNodeRelations();
var links_a = LinksRepository.GetRelationsByTarget(parentNode.ParentLink);
var links_b = LinksRepository.GetRelationsBySource(accessoriesNode.ContentLink);

Removing links to new Marketing system

$
0
0

Hi,

Having some issues around removing/disabled the new Marketing system that has appeared in commerce 9.19

1. I've seen the code to disable the new marketing system, is there a way to test/confirm this has happened?  Would anything specific be noticeable in Commerce Manager?  I need to ensure that the site can still work with these promotions

2. How is the link to Marketing disabled/hidden?  This is the one that now appears when an editor is logged into the site.

The following post I used to disable the new system

http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=144358

Issue in getting french content from catalog metafield

$
0
0

Hi Team,

I am facing issues in fetching the catalog metafield value with culturespecific.

I have a metafiled displayname in two languages "en-ca" and "fr-ca". But when I try to access the metafiled, it is always fetching me the "en-ca" text.

[CatalogContentType(DisplayName="Currency", MetaClassName="Currency", GUID="8BEBFA5C-BCC7-4351-B050-440E30C72F15")]
public class Currency : VariationContent
{

[Display(
Name = "Country Code",
Description = "",
GroupName = "Information",
Order = 1100)
[CultureSpecific]
public override string DisplayName
{
get;
set;
}

}

Let me know how to get french content.

Thanks in advance.

Thanks,

Manjeera T


SQL command timeout when importing catalog.xml

$
0
0

Epi commerce 9.16

We are using the inRiver integration to import the product catalog. When the catalog meta data in epi is clean and the catalog.xml is sent over to epi the catalog data gets imported and everyone is happy. But subsequent imports of the full catalog structure ends in SQL command timeouts. We have tried to decrease the catalogImportBatchSize and set the commandTimeout but with no luck. Any more ideas out there?

2016-06-23 03:32:43,323 [47] ERROR inRiver.EPiServerCommerce.Import.InriverDataImportController: Catalog Import Failed
System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. This failure occurred while attempting to connect to the routing destination. The duration spent while attempting to connect to the original server was - [Pre-Login] initialization=1; handshake=15; [Login] initialization=0; authentication=0; [Post-Login] complete=1; ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute[TResult](Func`1 method)
at Mediachase.Data.Provider.SqlDataProvider.ExecuteNonExec(DataCommand command)
at Mediachase.MetaDataPlus.Common.DBHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, Int32 commandTimeout, DataParameter[] commandParameters)
at Mediachase.MetaDataPlus.Common.DBHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, DataParameter[] commandParameters)
at Mediachase.Commerce.Catalog.Data.CatalogEntryAdmin.Save()
at Mediachase.Commerce.Catalog.Managers.CatalogEntryManager.SaveCatalogEntry(CatalogEntryDto dataset)
at Mediachase.Commerce.Catalog.ImportExport.CatalogImportExport.SaveEntryDto(CatalogEntryDto workingCatalogEntryDto, Dictionary`2 metaObjectsList, Dictionary`2 priceGroups, Dictionary`2 warehouseInventories)
at Mediachase.Commerce.Catalog.ImportExport.CatalogImportExport.ReadEntries(Guid applicationId, Int32 catalogId, XmlReader reader, String baseFilePath, Int32 totalCount, String defaultCurrency, Boolean overwrite, IEnumerable`1 catalogLanguages)
at Mediachase.Commerce.Catalog.ImportExport.CatalogImportExport.Import(Stream input, Guid applicationId, String baseFilePath, Boolean overwrite)
at inRiver.EPiServerCommerce.Import.InriverDataImportController.ImportCatalogXmlWithHandlers(Stream catalogXml, IEnumerable`1 catalogImportHandlers)
at inRiver.EPiServerCommerce.Import.InriverDataImportController.ImportCatalogXml(String path)
ClientConnectionId:1e33a6e3-68bb-4431-a86a-d686d6fd4b8e
Error Number:-2,State:0,Class:11
ClientConnectionId before routing:87a16f53-a5a8-4a75-858a-87672ec65a16
Routing Destination:b495ff6b49fe.tr16.eastus1-a.worker.database.windows.net,11016

Catalog Promotion Not working

$
0
0

I am trying to create a promotion at catalog level. For example anything (any product) in my catalog Apparal -> Dresses, should get a 50% discount. 

I tried ceating a Promotion as "Catalog Entry: Build Your Own Discount"

&

TargetLineItem.CatalogEntryId - Equals (Text) - Dresses 

OR

TargetLineItem.CatalogEntryId - Equals (Text) - Apparal-Dresses 

I tried Equal and contains. But  neither worked.

Any suggestions, on if this works out of the box in episerver?

RegisterPartialRouter - Can't Index Content In Find

$
0
0

Hi,

We're using Commerce 9.20, and Find 12.1.

I'm trying to register a custom partial router. I have removed the line in the commerce init module which registers the default router, and I'm using this code to register the custom one:

            var referenceConverter = ServiceLocator.Current.GetInstance<ReferenceConverter>();
            var contentLoader = ServiceLocator.Current.GetInstance<IContentLoader>();
            var commerceRootContent = contentLoader.Get<CatalogContentBase>(referenceConverter.GetRootLink());
            var partialRouteHandler = context.Locate.Advanced.GetInstance<PartialRouteHandler>();
            var hierarchicalCatalogPartialRouter = new CustomHierarchicalPartialRouter(() => SiteDefinition.Current.StartPage, commerceRootContent);
            partialRouteHandler.RegisterPartialRouter(new PartialRouter<PageData, CatalogContentBase>(hierarchicalCatalogPartialRouter));

Here is the router code - as you can see, it's supposed to do nothing at the moment:

    public class CustomHierarchicalPartialRouter : HierarchicalCatalogPartialRouter
    {
        private readonly IContentLoader _contentLoader;
        private readonly ILinksRepository _linksRepository;
        private readonly ReferenceConverter _referenceConverter;
        public CustomHierarchicalPartialRouter(
            Func<ContentReference> routeStartingPoint,
            CatalogContentBase commerceRoot)
            : base(routeStartingPoint,
                commerceRoot,
                false,
                ServiceLocator.Current.GetInstance<IContentLoader>(),
                ServiceLocator.Current.GetInstance<IRoutingSegmentLoader>(),
                ServiceLocator.Current.GetInstance<IContentVersionRepository>(),
                ServiceLocator.Current.GetInstance<IUrlSegmentRouter>(),
                ServiceLocator.Current.GetInstance<IContentLanguageSettingsHandler>(),
                ServiceLocator.Current.GetInstance<ServiceAccessor<HttpContextBase>>())
        {
            this._contentLoader = ServiceLocator.Current.GetInstance<IContentLoader>();
            this._linksRepository = ServiceLocator.Current.GetInstance<ILinksRepository>();
            this._referenceConverter = ServiceLocator.Current.GetInstance<ReferenceConverter>();
        }
        public override PartialRouteData GetPartialVirtualPath(CatalogContentBase content, string language, RouteValueDictionary routeValues, RequestContext requestContext)
        {
            return base.GetPartialVirtualPath(content, language, routeValues, requestContext);
        }
    }

I was hoping that this would have no net effect, but it does - the Find indexer stops working. I'm getting errors like this in the Find indexing job:

An exception occurred while indexing content 1073741865__CatalogContent: Exception has been thrown by the target of an invocation. (see log for more information)

When I have a look in the log as the error suggests, I get the stack trace below. Am I registering the router correctly?

Stack Trace:

System.ArgumentNullException: The provided content link does not have a value.
Parameter name: contentLink
at EPiServer.Core.DefaultContentLoader.Get[T](ContentReference contentLink, LoaderOptions loaderOptions)
at EPiServer.Web.Routing.Segments.NodeSegment.GetVirtualPathSegment(RequestContext requestContext, RouteValueDictionary values)
at EPiServer.Web.Routing.Segments.NodeSegment.GetVirtualPathSegment(RequestContext requestContext, RouteValueDictionary values, HashSet`1 usedValues)
at EPiServer.Web.Routing.ContentRoute.AddVirtualPathFromSegments(StringBuilder virtualPath, RequestContext requestContext, RouteValueDictionary values, HashSet`1 usedValues, Int32 lastNonDefaultIndex)
at EPiServer.Web.Routing.ContentRoute.GetVirtualPath(RequestContext requestContext, RouteValueDictionary values)
at EPiServer.Web.Routing.DefaultUrlResolver.GetUrlFromRoute(ContentReference contentReference, String language, RouteValueDictionary routeValues, RequestContext requestContext)
at EPiServer.Web.Routing.DefaultUrlResolver.GetVirtualPathInternal(ContentReference contentLink, String language, VirtualPathArguments arguments)
at EPiServer.Web.Routing.UrlResolver.GetUrl(ContentReference contentLink, String language)
at EPiServer.Find.Commerce.CommerceUnifiedSearchSetUp.GetContentUrl(ContentReference contentLink)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at EPiServer.Find.UnifiedSearch.IndexProjection.GetUrl(Object o)
at EPiServer.Find.DelegateValueProvider`2.GetValue(Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CalculatePropertyValues(JsonWriter writer, Object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, JsonContract& memberContract, Object& memberValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)
at EPiServer.Find.Api.BulkActionConverter.WriteJson(JsonWriter writer, Object value, JsonSerializer serializer)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeConvertable(JsonWriter writer, JsonConverter converter, Object value, JsonContract contract, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)
at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)
at EPiServer.Find.Json.Serializer.SerializeToTextWriter(JsonSerializer serializer, Object value, TextWriter textWriter)
at EPiServer.Find.Json.Serializer.SerializeObjectsToJsonRequest(JsonSerializer serializer, IJsonRequest jsonRequest, IEnumerable values)
at EPiServer.Find.Api.BulkCommand.Execute()
at EPiServer.Find.Cms.ContentIndexer.IndexWithRetry(IContent[] contents, Int32 maxRetries)
at EPiServer.Find.Cms.ContentIndexer.Index(IEnumerable`1 content, IndexOptions options)
at EPiServer.Find.Cms.ContentIndexer.IndexBatch(IEnumerable`1 content, Action`1 statusAction, Int32& numberOfContentErrors, Int32& indexingCount)
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: The provided content link does not have a value.
Parameter name: contentLink
at EPiServer.Core.DefaultContentLoader.Get[T](ContentReference contentLink, LoaderOptions loaderOptions)
at EPiServer.Web.Routing.Segments.NodeSegment.GetVirtualPathSegment(RequestContext requestContext, RouteValueDictionary values)
at EPiServer.Web.Routing.Segments.NodeSegment.GetVirtualPathSegment(RequestContext requestContext, RouteValueDictionary values, HashSet`1 usedValues)
at EPiServer.Web.Routing.ContentRoute.AddVirtualPathFromSegments(StringBuilder virtualPath, RequestContext requestContext, RouteValueDictionary values, HashSet`1 usedValues, Int32 lastNonDefaultIndex)
at EPiServer.Web.Routing.ContentRoute.GetVirtualPath(RequestContext requestContext, RouteValueDictionary values)
at EPiServer.Web.Routing.DefaultUrlResolver.GetUrlFromRoute(ContentReference contentReference, String language, RouteValueDictionary routeValues, RequestContext requestContext)
at EPiServer.Web.Routing.DefaultUrlResolver.GetVirtualPathInternal(ContentReference contentLink, String language, VirtualPathArguments arguments)
at EPiServer.Web.Routing.UrlResolver.GetUrl(ContentReference contentLink, String language)
at EPiServer.Find.Commerce.CommerceUnifiedSearchSetUp.GetContentUrl(ContentReference contentLink)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at EPiServer.Find.UnifiedSearch.IndexProjection.GetUrl(Object o)
at EPiServer.Find.DelegateValueProvider`2.GetValue(Object target)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CalculatePropertyValues(JsonWriter writer, Object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, JsonContract& memberContract, Object& memberValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)
at EPiServer.Find.Api.BulkActionConverter.WriteJson(JsonWriter writer, Object value, JsonSerializer serializer)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeConvertable(JsonWriter writer, JsonConverter converter, Object value, JsonContract contract, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)
at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)
at EPiServer.Find.Json.Serializer.SerializeToTextWriter(JsonSerializer serializer, Object value, TextWriter textWriter)
at EPiServer.Find.Json.Serializer.SerializeObjectsToJsonRequest(JsonSerializer serializer, IJsonRequest jsonRequest, IEnumerable values)
at EPiServer.Find.Api.BulkCommand.Execute()
at EPiServer.Find.Cms.ContentIndexer.IndexWithRetry(IContent[] contents, Int32 maxRetries)
at EPiServer.Find.Cms.ContentIndexer.Index(IEnumerable`1 content, IndexOptions options)
at EPiServer.Find.Cms.ContentIndexer.IndexBatch(IEnumerable`1 content, Action`1 statusAction, Int32& numberOfContentErrors, Int32& indexingCount)

Issue with negative tax when product is free and order-level discount is applied

$
0
0

Hello,

I am running into a weird issue with oder form caluclations. The site I am working on has a lot of products that are free, but, they need to be shipped, so, there is a charge for the shipment. I came across an issue today with a test case involving an order-level discount. The coupon was for 1.00 off the total order cost. With a free product where this coupon is applied, the subtotal on the order form is -1.00. What is then happening is that it is calculating tax on the -1.00. The interesting thing is that it subtracts that negative tax amount from the order total, so this is what I am ending up with for the order form totals:

Coupon Discount: $1.00

SubTotal: -$1.00 (Product is Free)

Shiping: $7.25

Tax: -$0.06 (This is based on Illinois sales tax rate of 6.25%)

Total: $6.19 (should be $6.25)

We are using customized workflows on this project, but, I confirmed that the same thing happens with the default Commerce workflows. On this checkout page. I am running CartPrepare before the page loads. It seems to me that if the order total is <= 0.00, it shouldn't be applying any sales tax. Am I missing something? Any insight into this issue would be greatly appreciated.

Here are the versions of Commerce and CMS I am running:

 <package id="EPiServer.CMS" version="9.12.1" targetFramework="net452" /><package id="EPiServer.CMS.Core" version="9.12.1" targetFramework="net452" /><package id="EPiServer.CMS.UI" version="9.9.1" targetFramework="net452" /><package id="EPiServer.CMS.UI.Core" version="9.9.1" targetFramework="net452" /><package id="EPiServer.Commerce" version="9.22.0" targetFramework="net452" /><package id="EPiServer.Commerce.Core" version="9.22.0" targetFramework="net452" /><package id="EPiServer.Commerce.FindSearchProvider" version="8.13.2" targetFramework="net452" /><package id="EPiServer.Commerce.UI" version="9.22.0" targetFramework="net452" /><package id="EPiServer.Commerce.UI.ManagerIntegration" version="9.22.0" targetFramework="net452" />

Thanks!

John

Order ID or hash cannot be empty! - PayPal payment transaction

$
0
0

Hi,

Anyone help me to give the details of the below error:

" Order ID or hash cannot be empty"

I am getting this error after the EPiServer commerce version update in to 9.21.

The error is appear after the sucessfull paypal payment action, steps are

* After clicking place order, the page redirected to the pay pal page

* After paypal payment confirmation again redirected to the merchant site

* The page landing in to my commerce site URL (here I got the error " Order ID or hash cannot be empty" )

http://epidemo.salzerinfo.com/other-pages/paypal-payment-processor/?accept=true&hash=616c71274661736221d01bcc99c1303d&token=EC-28U2728011469821M&PayerID=KQU8Q3YVMXFK2

I am using "WSOL.EPiServerCms.Commerce.Payment.PayPal (version 0.2)" for PayPal method

 

Viewing all 9642 articles
Browse latest View live