Quantcast
Channel: Optimizely Search & Navigation
Viewing all 6894 articles
Browse latest View live

All products is available on the new created market

$
0
0

Hi guys, 

I have recently created a new market for a Episerver commerce site. It seems Episerver Commerce automatically set EVERY product is available in this new market.

Is it any setting in commerce that can change this?

I am thinking to create a job to clear all markets (use MarketFilter) before I run the product import job every time when I create a new market. But this seems not a good solution. 

Do you guys have better suggestions? 

 

Thanks, 

ChiChing


Error on notifications for content approval

$
0
0

Added content approval on our stage site but when i click on the notification bell, it doesn't show anything and console show this error:

Anyone with the same problem?

Episerver CMS: 11.10.5

Custom report / GUI-plugin texts in language files?

$
0
0

How on earth do i translate display name etc on custom reports?

The report page gives me a hint on whats missing:

/reportcenter/report[@name=""]/description does not exists for language Swedish.

My best guess would be that in my language file, i should put:

<?xml version="1.0" encoding="utf-8" ?><languages><language name="Svenska" id="SV"><reportcenter><report name="reportname"><description>Whatever</description></report></reportcenter></language></languages>

But that doesn't help. I also guess a should some how be able to get all other attributed from lang file, like Category (as shownb below), but i cannot figure out how!

[EPiServer.PlugIn.GuiPlugIn(
Area = EPiServer.PlugIn.PlugInArea.ReportMenu,
Url = "~/reporturl",
Category = "custom reports",
DisplayName = "report")]

Any ideas?

Content Delivery API returns null content if browser has wrong language set

$
0
0

Hey,

I've spent couple of hours investigating why my content API returns null content response. I've finally managed to find the reson. It has turned out that my browser has set multiple languages and the first one was "en-US" so it is different then the one that is set in my cms, which is "en". My question is, if it is a bug? or there is some logic behind this?

In ContentApiController only first language is taken so I guess this is the reason, why the api couldn't load any content. I know that we can manually pass accept-language header but I'm not sure If an api response should depends on which language I have configured in my browser. 

 return this.ResultFromContent(this._contentLoaderService.Get(new ContentReference(contentReference), languages != null ? languages.FirstOrDefault<string>() : (string) null), expand);

EpiServer and SignalR for pushing data to pages.

$
0
0

I'm aware EpiServer uses websockets via SignalR already (for the CMS Editor), and I was wondering if SignalR can also be used push data to the front end for any pages that require it? We've a client asking for a quote but we've not implemented websockets and EpiServer before. Any known problems/issues that may cause us troubles? Is it possible? Are there preferred alternatives to signalR? We could probably use Ajax Requests to achieve almost the same result but being able to "push" data on events will be a better implementation.

Promotions : excluding certain line items from promotions

$
0
0

Hello everybody, 

I have a requirement on a project I'm working on whereby pricing information for products can be pulled in one of two ways:

  1. Via a list price configured in EPi itself
  2. Via a "special" price that is specific to the currently logged in user of the site, the product sku, and the quantity requested aswell. 
    1. So there is a use whereby if a user has an item in their cart, with a quantity of 2, they may see a different unit price if they changed their quantity. 

The special price in this case is one we have to query via an external service, as the combinations of pricing tiers using the above criteria is so large, that this is not something we can manage via EPiServer itself. 

The idea is that as an authenticated user browses the site they always see the cheapest price from one of the above. 

This above scenario works fine, until we try to accomodate the next requirement

"When a special price is used for a particular line item, no promotions can be applied to that line item". 

This is what I'm having issues with - I've tried the following:

  1. Excluding the items from promotions - https://world.episerver.com/documentation/developer-guides/commerce/marketing/exclude-products-from-promotions/
    • I tried to exclude products by testing if a products cheapest price is the "special" price - this worked fine but then i realised that i needed to cater for quantity requested. So this won't work!
  2. Creating a custom promotion
    • The promotion would enable me to apply the "special" pricing as a discount across the line items that qualify for it as a fixed price
    • Line items that qualify for it would have a custom property added to each of them containing the special price for each
    • The problem I had with this is that the evaluate method in the promotion processor only returns one RewardDescription and the fixed price for each line item would be different in my case - so this won't work either. 

Does anyone else have any options for me?

I've gone down a few different avenues as you can see, but I'm still no closer to a solution for this. 

Thanks very much!

Paul 

How can I set selected tab in EPiServer edit view?

$
0
0

We have an EPiServer (forms) edit view with a number of tabs. The customer has requested that the tab which is #2 (called "alternative content"), should be automatically selected under certain conditions when the editors open the edit-page. We don't want to reorder the tabs. How can this be accomplished? We're running EPiServer 11.

NestedTermsFacetFor with additional Filter on the none nested object

$
0
0

Hi,

I created a term facet to show products that are currently on sale for a user this works well.

However I would like to combine this facet with additional none nested filters.

By default, TermsFacetFor does not allow to filter on none nested object.
I would want the Facet to be a combination of the nested expression and anoter regular filter at the product level like FoodProduct.Name.Match(..)

            query = query.TermsFacetFor<T, Price>(p => ((FoodProduct)(object)p).SearchPrices,
                                        price => price.CustomerPricing.PriceCode,
                                        priceFilter =>
                                                       (
                                                           priceFilter.CustomerPricing.PriceTypeId.Match(applicablePriceType) & priceFilter.CustomerPricing.PriceCode.Match(applicableSalesCode + "sale")
                                                        )& priceFilter.UnitPrice.Amount.GreaterThan(0) //if a price is at zero ignore it& priceFilter.ValidFrom.LessThan(utcNow)& (!priceFilter.ValidUntil.Exists() | priceFilter.ValidUntil.GreaterThan(utcNow))                                              
                                                        ,
                                                        null, 
                                                        filter);


Thus I created an overload for TermsForFacetFor as follow to created a AndFilter if any additional filter are required:

public static ITypeSearch<TSource> TermsFacetFor<TSource, TListItem>(this ITypeSearch<TSource> search, Expression<Func<TSource, IEnumerable<TListItem>>> enumerableFieldSelector, Expression<Func<TListItem, string>> itemFieldSelector, Expression<Func<TListItem, Filter>> filterExpression = null, Action<NestedTermsFacetRequest> facetRequestAction = null, Filter orignialFilter = null)
        {
            Filter facetFilter = NestedFilter.Create(search.Client.Conventions, enumerableFieldSelector, filterExpression);
            Action<NestedTermsFacetRequest> action = null;
            action = ((!facetRequestAction.IsNotNull()) ? ((Action<NestedTermsFacetRequest>)delegate (NestedTermsFacetRequest x)
            {
                x.FacetFilter = orignialFilter == null ? facetFilter : new AndFilter(facetFilter, orignialFilter);
            }) : ((Action<NestedTermsFacetRequest>)delegate (NestedTermsFacetRequest x)
            {
                x.FacetFilter = orignialFilter == null ? facetFilter : new AndFilter(facetFilter, orignialFilter);
                facetRequestAction(x);
            }));
            return search.AddNestedTermsFacetFor(enumerableFieldSelector, itemFieldSelector, action);
        }

It always returns 0 results and I am unsure on my approch to resolve this issue.

I know, I could pre-filter outside of the facet but it is not what I want to achieve.

Generate Find Query For a Nested Facet that works: (Notice the facet_filter --> Nested)

"SearchPrices.CustomerPricing.PriceCode":{"terms":{"field":"SearchPrices$$nested.CustomerPricing.PriceCode$$string"
         },"nested":"SearchPrices$$nested","facet_filter":{"nested":{"path":"SearchPrices$$nested","filter":{"and":[
                           {"term":{"SearchPrices$$nested.CustomerPricing.PriceTypeId":0
                              }
                           },
                           {"term":{"SearchPrices$$nested.CustomerPricing.PriceCode$$string":"sale"
                              }
                           },
                           {"range":{"SearchPrices$$nested.UnitPrice.Amount$$number":{"from":0.0,"to":79228162514264337593543950335.0,"include_lower":false,"include_upper":true
                                 }
                              }
                           },
                           {"range":{"SearchPrices$$nested.ValidFrom$$date":{"from":"0001-01-01T00:00:00Z","to":"2019-01-30T18:28:47.2294088Z","include_lower":true,"include_upper":false
                                 }
                              }
                           },
                           {"or":[
                                 {"not":{"filter":{"exists":{"field":"SearchPrices$$nested.ValidUntil$$date"
                                          }
                                       }
                                    }
                                 },
                                 {"range":{"SearchPrices$$nested.ValidUntil$$date":{"from":"2019-01-30T18:28:47.2294088Z","include_lower":false
                                       }
                                    }
                                 }
                              ]
                           }
                        ]
                     },"join":false
                  }
               }
      }
   },

Generate Find Query For a Nested Facet that does not work when trying to add a And: (Notice the facet_filter --> And)

"SearchPrices.CustomerPricing.PriceCode":{"terms":{"field":"SearchPrices$$nested.CustomerPricing.PriceCode$$string"
         },"nested":"SearchPrices$$nested","facet_filter":{"and":[
               {"nested":{"path":"SearchPrices$$nested","filter":{"and":[
                           {"term":{"SearchPrices$$nested.CustomerPricing.PriceTypeId":0
                              }
                           },
                           {"term":{"SearchPrices$$nested.CustomerPricing.PriceCode$$string":"sale"
                              }
                           },
                           {"range":{"SearchPrices$$nested.UnitPrice.Amount$$number":{"from":0.0,"to":79228162514264337593543950335.0,"include_lower":false,"include_upper":true
                                 }
                              }
                           },
                           {"range":{"SearchPrices$$nested.ValidFrom$$date":{"from":"0001-01-01T00:00:00Z","to":"2019-01-30T18:28:47.2294088Z","include_lower":true,"include_upper":false
                                 }
                              }
                           },
                           {"or":[
                                 {"not":{"filter":{"exists":{"field":"SearchPrices$$nested.ValidUntil$$date"
                                          }
                                       }
                                    }
                                 },
                                 {"range":{"SearchPrices$$nested.ValidUntil$$date":{"from":"2019-01-30T18:28:47.2294088Z","include_lower":false
                                       }
                                    }
                                 }
                              ]
                           }
                        ]
                     },"join":false
                  }
               },
               {"terms":{"Brand$$string":["Litehouse"
                     ]
                  }
               }
            ]
         }
      }
   },

The only solution I see is generating independant facet query with pre-filtering outside of the facet


Using TermFacets to return a list of product namespaces under a node

$
0
0

Hi,

I need to run a Find Query to return a list of product namespaces which exist under a category node. So when the category loads, it will hit Find to ask what types of products exist as descendants in a multi level catalog. If there are 100 of product type A and 2 of product type B i should get two results with the namespace of each.

If i run this code, i get a list of localised content type names:

            // use Find to execute search with the content type id set as a facet
            var searchQuery = SearchClient.Instance.Search<BaseProduct>()
                .Filter(x =>
                    x.Ancestors().Match(currentContent.ContentLink.ToReferenceWithoutVersion().ToString()))
                        .Take(0).TermsFacetFor(x => x.ContentTypeName()).GetContentResult();
            // extract the content type id's form the result
            var terms = searchQuery.TermsFacetFor(x => x.ContentTypeName()).Terms;

However the localized content type name is not exactly what i need to i updated my code as follows which i hoped would include the Common Type namespaces:

            var searchQuery = SearchClient.Instance.Search<BaseProduct>()
                .Filter(x =>
                    x.Ancestors().Match(currentContent.ContentLink.ToReferenceWithoutVersion().ToString()))
                        .Take(0).TermsFacetFor(x => x.CommonType()).GetContentResult();
            // extract the content type id's form the result
            var terms = searchQuery.TermsFacetFor(x => x.CommonType()).Terms;

However on trying to facet the common type, i always get a null result.

The type is stored in the Find index so there must be a way of returning it as a facet? Any advice would be much appreciated?

Thanks,

Johnny

Creating customer groups programtically

$
0
0

Hi, 

I am trying to look for way to add a new customer group programatically. I dont see any examples, does anybody have any idea about this? I want to update pricing based on customer groups, and if new customer groups are passed in the file I should create them.

How to customize validation message for each field episerver form.

$
0
0

Hi,


I want to implement custom validation message for each filed in form,

Does anyone know if we can customize a validation message for each field?
Now I have two textboxes (Name, Email), those are required. When I click a submit button without input information those fileds, then the validation message show up "This Field is requied" (Standard episerver form). 

But I would like to have the validation message for show specific field name. Like "Please enter Name." and "Please enter Email".

Waiting to hear from any helps.

Thanks in advance.

Issue with EPiServer.Web.Routing.UrlResolver.GetUrl for Commerce content versions

$
0
0

Hi,

When using the EPiServer.Web.Routing.UrlResolver.GetUrl method to get the url of multiple content versions (published and previous published) of the same Commerce content it always return the same url. The url of first content version (content link id and work id) used in EPiServer.Web.Routing.UrlResolver.GetUrl will be the url that is returned from the rest.

This is not an issue with CMS content. Here we get the correct url for each different content version.

I did a test in latest version (Episerver.Commerce 12.16.0) of the Quicksilver demo-site.

  1. Change "Name in URL" (RouteSegment) for Fashion Node and publish so you have min. two content version with different "Name in URL" (RouteSegment).
  2. Retrieve all content version of Fashion Node and use EPiServer.Web.Routing.UrlResolver.GetUrl on each.

Did the same for CMS content.

The results can be seen here:

https://imgur.com/a/gr0ol53 (top image)

As you see in the image then we get the correct url for each version of the CMS content, but for the Commerce content we get the same even though that the RouteSegment is correct and different in each of the content versions.

As mentioned above it is the first content version retrived that decides it. If I recycle the app pool and changes the method to get the content versions in .Reverse() then this is shown.

https://imgur.com/a/gr0ol53 (buttom image)

A bug or?

Episerver Find How to index pages with no template

$
0
0

Hi,

I am relatively new with working with Find so sorry if this might be a stupid question :) 

I am currently working on a project where we have implemented Episerver Find and we have a PageType that works for holding information regarding a contact, but this page does not have a view so it is not possible to actually navigate to it. It's purpose is to fetch data for a list page and therefore we don't seem to get any search hits when searching on a specific contact. And customer wants to of course be able to search for contatcs as well.

So i am wondering if there is any way to include pages in the searchresult that are not able to actually navigate to?

So far we have a standard Epi find installation no custom indexing features and etc. 

Happy for any help!:) 

If user is signed in with Owin, Commerce's _customerContext.CurrentContactId changes constantly for user. Why is that?

$
0
0

Hi

I have this method which checks if a cart already exists:

protected ICart GetExistingCart(string name) => _orderRepository.LoadCart<ICart>(_customerContext.CurrentContactId, name, _currentMarket.GetCurrentMarket().MarketId);

If the method returns null, I create a new cart:

cart = _orderRepository.Create<ICart>(_customerContext.CurrentContactId, name);
SaveCart(cart);

This is used in the start of, and during the checkout flow.

Now, the thing is that our site generally allows for a user to signin to access some non-public areas of the site (pages that are not related to the checkout flow). Signin is with Owin (in Azure).

If the user is logged in, and afterwards decides to go to the checkout flow, Commerce's _customerContext.CurrentContactId changes constantly, and thus every time I call GetExistingCart for the same user, it won't find any cart. If I debug the code in Visual Studio, I can see that for every line I step over, _customerContext.CurrentContactId changes.

If however, user is not signed in already, _customerContext.CurrentContactId stays the same, and cart can be created and retrieved as expected during checkout.

Anyone knows what the problem can be with this _customerContext.CurrentContactId and its constant change of value when signed in with Owin?

Commerce version is 11.8.3.

Customer Service Representatives UI and OWIN?

$
0
0

Hi,

I'm trying out the new beta of "Customer Service Representatives UI" but when fetching data from "https://..../EPiServer.Commerce.UI.CustomerService//countries" I get a 401 unauthorized response.

The user is a member of the CustomerServiceRepresentatives group and EPiBetaUsers and the feature-switch-config is set to "Enabled".

Is OWIN not supported for the CSR UI or have I simply done something wrong during the setup?

Have anybody else got this to work?

Kind regards,
Mikael


Does consuming another EPiServer site's content require an extra license?

$
0
0

Hi!

 A friend of mine told me that if I have a non-EPiServer website which consumes content from an EPiServer website, then an extra EPiServer-license is required. Is this true?

 Lets say I have a scenario like the following:

 I have an EPiServer site with cooking recipes called EPiCookingRecipes. On each site page there's a cooking recipe.

 Now a friend of mine has another site, NonEPiCookingRecipes, which is a simple ASP.NET MVC site not using EPiServer at all.

 In the EPiCookingRecipes site, I build a Web API exposing all recipes for use by my friend on his NonEPiCookingRecipes site.

 My friend - on his NonEPiCookingRecipes site - consumes API-data in the form of cooking recipes from my EPiCookingRecipes site.

 Would this require an extra EPiServer license?

 

If yes, can someone point me to the place where this is provided in the license agreement?

Convert single page PageType to another PageType programically

$
0
0

Hello,

i found the topic https://world.episerver.com/forum/developer-forum/-Episerver-75-CMS/Thread-Container/2018/5/convert-page-type-to-another-page-type-programmatically/ where there is described that we could migrate single page to another pagetype.

My question is --> there is talking about " List<KeyValuePair<int, int>> propertyTypeMap" . How could get this one? I mean it's strange that we are using int instead of string (since i don't know how to get int of my propertyname in my page).
Is there some kind of epi method that i could get Page property int value ??

Custom ContentProvider routing issue

$
0
0

We've made a custom ContentProvider for listing a document structure from Sharepoint. 

Since the structure is outside the asset root, according to some examples you can add routes for it like we're doing in an IInitializableModule:

RouteTable.Routes.MapContentRoute(
                name: "Sharepoint",
                url: ProviderName + "/{node}/{partial}/{action}",
                defaults: new { action = "index" },
                contentRootResolver: s => fileRoot.ContentLink);
RouteTable.Routes.MapContentRoute(
                name: "SharepointEdit",
                url: CmsHomePath + ProviderName + "/{language}/{medianodeedit}/{partial}/{action}",
                defaults: new { action = "index" },
                contentRootResolver: s => fileRoot.ContentLink);

This works fine in Edit-mode, we can download the documents from there, but in View-mode we get 404. 

The URL we're trying to access (as it appears by for instance dragging a file into a XHTML-property looks like this: /sharepoint/rovvilt/sno-rovviltkontakter/rovviltkontakter.xlsx which is correct according to the document structure.

Any hints would be appreaciated!

Cannot read property 'contentData' of null -- Publish (when EPiServer.Marketing.Testing installed)

$
0
0

Hello All,

I am starting out my journey into EpiServer and trying to spin up the AlloyDemo application. I am playing around with Users and associated permissions (more specifically Publishing a page). I ran into an issue where the Publish "popup" is not showing up. When I see the console I get the following error. This error goes away and the Publish popup comes up correctly when I uninstall the EPiServer.Marketing.Testing (I am not sure about the dependency between the Marketing.Testing and popups)

Uncaught TypeError: Cannot read property 'contentData' of null
at Object._isOpenSetter (widgets.js:2)
at Object.set (epi.js:2)
at Object.onOpen (widgets.js:2)
at Object.open (widgets.js:2)
at Object.advice (dojo.js:15)
at Object._264 [as open] (dojo.js:15)
at Object.openDropDown (widgets.js:2)
at Object.<anonymous> (widgets.js:2)
at dojo.js:15
at Object.loadAndOpenDropDown (widgets.js:2)

Would really appreciate any pointers.

Sincerely

ContentResultService is executed instead of the injected one

$
0
0

I'm strugling with super weird issue. I wanted to test an example from

 https://world.episerver.com/documentation/developer-guides/content-delivery-api/how-to-customize-data-returned-to-clients

Unfortuantely my CustomContentResultService is not executed. Base ContentResultService is executed all the time. I've tried to debug 

ContentApiResult.cs becasue ContentResultService is called from there. In debuger 

 private readonly ContentResultService _contentResultService;

seems to be an instance of my CustomContenrService which is expected. But for some reason it's not executed. I've asked my colleague to do the same with the same codebase and everything is working for him. How is this possible? Is there any cache or anything which might cause this issue? 

Viewing all 6894 articles
Browse latest View live