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

Content Delivery API - 404 error

$
0
0

I wanted to play around with content API unfortunatelly I stucked with a bit weird issue. I'm getting 404 error on search api (/api/episerver/v2.0/search/content) or cms api (ie. /api/episerver/v2.0/site) depending on which dependency was installed first. So if I install cms api as the first one, I'm getting 404 on search API and in the opposite. It seems like the second one is not registerd. Do you have any idea why it might be like this? Is it possible that it really depeneds on installation order?

Regards,

Maciek


Rest Store URL 404

$
0
0

I have created a module with a rest store but the url returns a 404.  I have the follwing: 

    [RestStore("teststore")]
    public class StoreHandlerSample : RestControllerBase
    return declare("ddd.ModuleInitializer", [_Module], {
        initialize: function () {
            this.inherited(arguments);
            var registry = this.resolveDependency("epi.storeregistry");
            registry.create("teststore", this._getRestPath("teststore"));
        },
        _getRestPath: function (name) {
            return routes.getRestPath({ moduleArea: "Demo", storeName: name });
        }
    });

My module is called demo but when I hit localhost/modules/Demo/Stores/teststore I am getting a 404 error.

Any help would be appreciated.

Thanks

Hide standard elements

$
0
0

Hi,

I've built a bunch of custom epiforms elements and I'd like to display only these elements when the user presses "create new form element". The standard functionality always shows the "standard elements" as well, not only my custom ones. I dont want my users to be able to access these, so im looking for a way to hide them. 

I've tried doing this by css but the ID isnt unique for the surrounding div (i.e "dijit__KeyNavContainer_3"). Is there a way of doing this that im missing? Injecting javascript sounds like a bad solution to this problem.

Thanks alot!

PropertyDictionarySingle Mass import and Localization

$
0
0

Hi,

How can you mass import availaible values for a commerce field backed by  [BackingType(typeof(PropertyDictionarySingle))] ?

How should localization be handled ?
    Right now I think the only approach I see is to have the values piped:  IdForSynchro||Value Language 1||Value Language 2
    However this will affect search and I am unsure what will happen to all products that currently have a value set when the source dictionary values changes

Thanks

Howto edit dynamic properties in EPiServer 11

$
0
0

Hi

I have upgraded our intranet to EPiServer 11 (11.10.6.0). Now I can not edit dynamic properties. What have I missed?

Configuration:

<configuration>
    ...
    <episerver>
        ...
        <applicationSettings

            ...

            operationCompatibility="DynamicProperties"

            ....

        />
        ...
    </episerver>
    ...

</configuration>

The page for editing dynamic properties is still available:

But when on the page-property-form and selecting tools I only have the following options:

  • Language Settings
  • Manage Expiration and Archiving
  • Permanently Mark as Being Edited

Before upgrading (EPiServer 10, 10.10.4.0) the following were available:

  • Dynamic Properties
  • Language Settings
  • Manage Expiration and Archiving
  • Permanently Mark as Being Edited

Regards Hans

Disable .FilterOnCurrentSite() for UnifiedSearch

$
0
0

Is there a way to disable the default filtering .FilterOnCurrentSite() for UnifiedSearch?

I'm building a search feature where it will be optional to filter by site.

This post describes a way of doing it but I wonder if there's a way to just disable that specific filter without have to redefine the rest?

https://world.episerver.com/forum/developer-forum/EPiServer-Search/Thread-Container/2015/6/unifiedsearch-with-multiple-sites/

Error logs issue in DXC

$
0
0

Hi,

I am working on a website that is running in DXC. When we get the application log from paasportal.episerver.net we have noticed that all the errors are shown as:

"EPiServer.Global : Unhandled exception in ASP.NET 
System.InvalidOperationException: The model item passed into the dictionary is of type 'System.Web.Mvc.HandleErrorInfo', but this dictionary requires a model item of type 'SearchResultsPageViewModel'."

this is even when i manually add a line to a view file that throws an error with a specific message, where i should be seeing something like:

"EPiServer.Global : Unhandled exception in ASP.NET 
System.Exception: test 
at ASP._Page_Views_Pages_HomePage_cshtml.Execute()
at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() 
at System.Web.Mvc.WebViewPage.ExecutePageHierarchy() 
at System.Web.WebPages.StartPage.ExecutePageHierarchy()
etc.

I'm trying to work out if i need to configure the site differently to work on DXC and to get the correct error messages. One thing we have noticed is that when we turn CustomErrors off in the web config we get the correct error details in the application log, even though it is using the same html file to display the error message. Obviously we want to keep custom errors turned on in production so this isn't really a fix.

I'm really confused, has anyone set up a DXC site where logging is working correctly? what did you have to do differently to a regular episerver website?

Thanks in advance

Sam

Hook into the download event for media files

$
0
0

Hi,

I would like to know, if there are any events exposed that i can hook into, on the dowload of media (pdf, docx etc.). 

In good old UnifiedFile world, we used to have these events but not sure about the current MediaData. I managed to find an article on episerver world describing to implement IRenderTemplate and IHttpHandler but not sure about the last bits...

//Do custom processing
//TransmitProcessedFile(customFile.BinaryData)
You can base your custom transmitter implementation on either EPiServer.Web.BlobHttpHandler or EPiServer.Web.MediaHandlerBase, 
and use the TransmitFile method for transmittance of file data.

Any pointers?


Content Delivery API - 404 on /api/episerver/auth/token

$
0
0

Hiya Folks,

I'm currently in the process of figuring out how to work with the episerver content delivery API, and have added that package to a simple test project (build from an empty project), only using the episerver cms (no search, commerce or anything). 

Now if i access the /api/episerver/v2.0/site from a browser after logging in on the cms, I get a JSON containing quite some info. However when I access query for the same thing using postman or a browser that has not been logged in to the CMS I get a JSON containing only an Unauthorized error. Seems to me I should be able to fix this querying /api/episerver/auth/token to get an authorization token, yet when I try that I get an 404 error page (in html).

Does anyone know what I am missing or why i cannot get to auth/token?

PS: I do have Episerver.ContentDeliveryApi.OAuth in my references (Used nuget to install Episerver.ContentDeliveryApi)

Delete Orphaned VPP images

$
0
0

Hi,

I am using Episerver 6 R2. There are over 14,000 orphaned images in the VPP which we have flagged in a spreadsheet.

Is there away to delete items that are orphaned from the site via code?

Thanks

Jon

Third Party Tax Calculator and Saving Taxes in EPiServer 11

$
0
0

Hello,

We use a thrid party service to calculate the taxes for our orders on our site.  I've been in the process of moving over to using the new order system and have ran into a problem with saving the tax value that is returned back from the service. (CMS 11.9.1 and Commerce 11.8.5)

Below is what we used to use to save the tax that we received.

Order Form

// Tax and total order form
orderForm.TaxTotal = orderFormTaxTotal;
orderForm.Total = orderForm.SubTotal + orderForm.ShippingTotal + orderForm.HandlingTotal + orderForm.TaxTotal;
orderForm.AcceptChanges();

Order Group

// Tax and total order
orderGroup.TaxTotal = orderTaxTotal;
orderGroup.Total = orderGroup.SubTotal + orderGroup.ShippingTotal + orderGroup.HandlingTotal + orderGroup.TaxTotal;
orderGroup.AcceptChanges();

I converted from an IOrderGroup to an OrderGroup and went through the process and saw that it hit everything correctly, but when I got to the next step in our checkout process I saw that it wasn't displaying the tax and the tax values were not saved in the database.  I made changes to use the IOrderGroup instead of the OrderGroup and when I got to the point of changing the above code I didn't see a way to save the tax value.

Is there a way of saving Tax this way?

Thank you,

Kevin Larsen

Find out which MediaData that is referenced from a page/block

$
0
0

There's this method in IContentRepository

_contentRepo.GetReferencesToContent(mediaData.ContentLink, false)

That will let me know if there's content (pages/blocks) that is using the MediaData in someway.

What about the other way around?

Is there a generic way of finding out which MediaData that is referenced by a specific page/block?

Always show language segment in URL

$
0
0

Hello!

I have a website with 4 different languages. On the master language, Swedish, I want to always show the /sv/ part of the URL. If the visitor goes to mypage.com/news I want them to be "redirected" (both will of course be the same version of the page) to mypage.com/sv/news. What do I need to do to solve this?

Thanks!

Sorting on property with JsonProperty with PropertyName set

$
0
0

I have the following product content:

public class SampleProduct : ProductContent
{
    [JsonProperty(PropertyName = "heading")]
    public override string DisplayName { get => base.DisplayName; set => base.DisplayName = value; }
}

When its indexed I can see that the field in the index is name: heading$$string. And when trying to sort on this property with:

var searchResult = _client.Search<SampleProduct>()
    .PublishedInCurrentLanguage();
    .Order(p => p.DisplayName)
    .GetContentResult();

The documents does not get sorted correctly. If I remove the JsonProperty-attribute it works correctly.

Service API Get Catalogs 404

$
0
0

Hi,

i have found this topic 
https://world.episerver.com/forum/developer-forum/Episerver-Commerce/Thread-Container/2017/10/getting-404-when-posting-catalog-zip-to-episerverapicommerceimportcatalog-from-c-/

I am trying to get the Catalog (https://world.episerver.com/documentation/developer-guides/Episerver-Service-API/catalog-restful-operations/Catalog/#get_catalogs)

But getting 404.

My users are setup in the system ( i have 2) one user is in WebAdmin and WebEditor groups and the second one is in Administrators and Web/Admin/Editor.
I have configured the permissions in the Admin mode so that both Administrators and WebAdmins have read/write permissions for Service Api

The SSL is disabled in Web.Config -> ApplicationSettings

I have also tried to 

<add key="episerver:serviceapi:maphttpattributeroutes" value="false" />


I am using postman.

Steps:
1. I generate a token for the user (tried with both users).
2. Than in postman i select [GET] to (CMS) http://localhost:14432/episerverapi/commerce/catalogs
3. In Postman, under Authorization, i select Type : Bearer Token and past the token  that i got under step 1.
4. Click [Send]

Result: 404

My catalog is very simple. I have a catalog called Alloy and just one Category page.

As mentioned the get version (currently on version 5.2 (is working)) and the Token is generated.
But as soon as i try a get operation concerning getting any catalog data (also tried to get my specific catalog named Alloy) i get 404

I have setup the the Alloy and than installed Commerce.
The site is up and running and i can see both my Category page and the default Alloy pages.



Any suggestions?





SoftLinkCollection timesout

$
0
0

Hi,

I am looking for orphaned files in the VPP in our Episerver 6 R2.

I loop through all my VPP directories and find the files in each and count how many linked pages there are using SoftLinkCollection.

For example:

foreach (UnifiedFile file in directoryFiles)
                    {
                        string parentPageList = String.Empty;
                        EPiServer.DataAbstraction.SoftLinkCollection filecollection = EPiServer.DataAbstraction.SoftLink.Load(file);
}

But it times out as I would expect there to be quite a lot of intensive work on the site to loop all pages to see if the file is linked.

Is there any way I can improve the code to make it work better?

Promotion Buy X Items Get Cheapest Free is not working as expected.

$
0
0

Hi All

We currently have an issue where 'Buy X number of Items get cheapest free'. 

Scenario - Buy 3 Items get cheapest free:

We add items, all of which are in the same campaign, Item  A($10) to the cart, then Add Items B($6) and C($5). to which item C($5) is now free. This works fine.

Item A$10
Item B$6
Item C$0(Savings $5)

We continue our shopping and then add Item D($3), from the same campaign, but the discount does not apply to the cart correctly as it still keeps the discount on Item C. We end up getting something looking like this:

Item A$10
Item B$6
Item C$0(Savings $5)
Item D$3

I have tried to the IPromotionEngine.Run(current) before rendering the cart items and I also done a cart.ApplyDiscounts(), but that did not work and somehow the discount still applies to the incorrect 'cheapest' item.

If we remove Item C from the cart, only then does Item D become free.

Has anyone come across this?

Regards

Farhad

Make default sort on this part to descending

Creating an editor widget

$
0
0

Hi,

So i finally decided to jump the dojo hurdle and try to create a editor widget. I really tried to make it as simple as possible and followed the instructions on this page: https://world.episerver.com/documentation/developer-guides/CMS/editing/Creating-an-editor-widget/

But, ofcourse it's not working and i really can't figure out why.

The first step i did was create the JS-file under ClientResources/Scripts/Editors/EmailEditors.js.

define(["dojo/_base/declare","dijit/_Widget","dijit/_TemplatedMixin"
], function (
    declare,
    _Widget,
    _TemplatedMixin) {
        return declare([_Widget, _TemplatedMixin], {
            templateString: '<div><input type="email" data-dojo-attach-point="email" data-dojo-attach-event="onchange:_onChange" /><div>'
        })
    }); 

Then i createt a property on one of my pages

[ClientEditor(ClientEditingClass = "msbse/editors/EmailEditor")]
[Display(Name = "Email", Description = "", GroupName = SystemTabNames.Content, Order = 50)]
public virtual string Email { get; set; }

And, a step i guess is missing in the documenteation is creating a module.config? Or is this obsolete? Anyway, i created i module.config

<?xml version="1.0" encoding="utf-8"?><module><assemblies><add assembly="MsbSe" /></assemblies><dojo><paths><add name="msbse" path="Scripts" /></paths></dojo></module>

Edit mode on tha page conatining the property ends up blank, and the console shows this error:

placeAt@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/epi/shell/widgets.js:2:21462
addChild@http://localhost:50403/EPiServer/CMS/11.4.4/ClientResources/epi-cms/widgets.js:2:993043
_addDefaultHandlers/<@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/epi/shell/widgets.js:2:247217
_createInternal/<@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/epi/shell/widgets.js:2:245713
hitch/<@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:30936
_2f2@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:75368
_2f1/_2ff.then@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:77262
when@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:82064
_createInternal@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/epi/shell/widgets.js:2:245550
_createWidgets/_6e6<@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/epi/shell/widgets.js:2:245144
hitch/<@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:30936
map@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:33783
_createWidgets@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/epi/shell/widgets.js:2:245074
createWidgets/</<@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/epi/shell/widgets.js:2:244659
hitch/<@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:30936
_c8@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:11378
_36@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:12993
_7c/<@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:13239
_37@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:13083
_7c@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:13164
_f0@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:14796
_10a@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:17619
widgets.js:2:245265
place@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:95510
addChild@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/epi/shell/widgets.js:2:37667
_19e@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:39734
addChild@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/epi/shell/widgets.js:2:265450
_19e@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:39734
addChild@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/epi/shell/widgets.js:2:649091
_19e@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:39734
addChild@http://localhost:50403/EPiServer/CMS/11.4.4/ClientResources/epi-cms/widgets.js:2:993091
_addDefaultHandlers/<@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/epi/shell/widgets.js:2:247217
_createInternal/<@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/epi/shell/widgets.js:2:245713
hitch/<@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:30936
_2f2@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:75368
_2f1/_2ff.then@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:77262
when@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:82064
_createInternal@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/epi/shell/widgets.js:2:245550
_createWidgets/_6e6<@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/epi/shell/widgets.js:2:245144
hitch/<@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:30936
map@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:33783
_createWidgets@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/epi/shell/widgets.js:2:245074
createWidgets/</<@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/epi/shell/widgets.js:2:244659
hitch/<@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:30936
_c8@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:11378
_36@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:12993
_7c/<@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:13239
_37@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:13083
_7c@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:13164
_f0@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:14796
_10a@http://localhost:50403/EPiServer/Shell/11.4.4/ClientResources/dojo/dojo.js:15:17619
WidgetFactory: Could not resolve one or more widgets

What im i missing here? 

IUrlResolver returning null in Initialization Module but not in Scheduled Job

$
0
0

I've a scheduled job that was (and still is) working fine, but I've also refactored the code so that it can be called from a Initialization module, so job can be run from a scheduled task, but should also be run when EpiServer 'boots up'.

The Problem: 

// where urlResolver == IUrlResolver 
// where homePage.Error404Page == ContentReference
string 404Url = _urlResolver.GetUrl(homePage.Error404Page)  // returns null

Why is this only returning null in the initialization module? I thought maybe it has something to do with Initialization Module dependencies, so according to https://gregwiechec.com/2015/11/sort-order-of-module-dependencies/ I also added 'EPiServerUIInitialization' (which is near the bottom of the list) as an extra dependency, but it didn't help

[InitializableModule]
[ModuleDependency(typeof(EPiServer.Web.InitializationModule))]
[ModuleDependency(typeof(EPiServer.UI.EPiServerUIInitialization))]
public class ErrorPagesInitializationModule : IInitializableModule

Any suggestions to get this working??

Viewing all 9642 articles
Browse latest View live