Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tobbe 81 posts 387 karma points c-trib
    Apr 07, 2017 @ 09:31
    Tobbe
    0

    Error when getting price

    Getting this error when trying to get price. I have just installed teacommerce from Developer-section and set everything up.

    Whats wrong?

    The requested service 'TeaCommerce.Api.InformationExtractors.IProductInformationExtractor`2[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[TeaCommerce.Umbraco.Configuration.Variants.Models.VariantPublishedContent, TeaCommerce.Umbraco.Configuration, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null]]' has not been registered. To avoid this exception, either register a component to provide the service, check for service registration using IsRegistered(), or use the ResolveOptional() method to resolve an optional dependency.
    
  • Anders Burla 2560 posts 8256 karma points
    Apr 10, 2017 @ 08:10
    Anders Burla
    0

    Hi Tobbe

    I see what happens - sorry for that. Could you try and just send the firstArticle as the second parameter and not the Id.

    Kind regards

    Anders

  • Anders Burla 2560 posts 8256 karma points
    Apr 10, 2017 @ 08:15
    Anders Burla
    0

    I see that is not possible. Marked as bug and will fix it ASAP. Because of holiday in denmark it will be next week. Sorry for that!!!

    I know it works in the demo/starter kit. Could you try and see what is different there from just parsing in the id? https://github.com/TeaCommerce/Starter-kit-for-Umbraco

    Kind regards

    Anders

  • Tobbe 81 posts 387 karma points c-trib
    Apr 11, 2017 @ 05:31
    Tobbe
    100

    Hi Anders!

    The starter kit uses TC.GetPrice(storeId, product.Id.ToString(CultureInfo.InvariantCulture)) and it works! :)

    TC.GetPrice(storeId, product.Id.ToString()) and TC.GetPrice(1, firstArticle) works aswell (dont know why I didnt try this...)

    But it seems like a bug when passing the Id as an integer.

  • Anders Burla 2560 posts 8256 karma points
    Apr 19, 2017 @ 06:14
    Anders Burla
    1

    That is because the productIdentifier should be a string or an object like IPublishedContent. You can also use ExamineSearchResult or anything else if you make your own provider for it. That is why the integer fails, because there is no provider for it.

Please Sign in or register to post replies

Write your reply to:

Draft