Copied to clipboard

Flag this post as spam?

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


  • Stewart Toye 9 posts 108 karma points
    Oct 05, 2022 @ 13:15
    Stewart Toye
    0

    Vendr discount codes

    Hi,

    I have created a new discount code with 20% off. See below screenshot.

    enter image description here If I then try to apply the discount code of SUMMER20 in the cart I'm getting below error. And the discount is not being applied.

    enter image description here Thanks Stewart

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Oct 05, 2022 @ 13:37
    Matt Brailsford
    0

    Hi Stewart,

    Can you paste the actual stack trace text? It's hard to read in a compressed image.

  • Stewart Toye 9 posts 108 karma points
    Oct 05, 2022 @ 13:40
    Stewart Toye
    0

    Here you go

    An error occurred Object must implement IConvertible.

    Exception Details System.InvalidCastException, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e: Object must implement IConvertible.at Vendr.Infrastructure.Resiliency.PollyExecutionStrategyBase.Execute[TResult](Func1 operation, Func1 verifySucceeded) at Vendr.Core.VendrUnitOfWorkProvider.Execute[T](IUnitOfWorkOptions options, Func2 action) at Vendr.Core.VendrUnitOfWorkProvider.Execute[T](Func2 action) at Vendr.Umbraco.Web.Controllers.VendrCartController.CalculateCart(CartSaveDto cart) at lambdamethod2241(Closure , Object , Object[] ) at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Awaited|260(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Oct 05, 2022 @ 13:51
    Matt Brailsford
    0

    Hmmm, I don't seem to be able to replicate this.

    I have created products (both standalone and variant products), added them to the cart, then defined a 20% discount with the exact same config and I am able to apply it and remove it no problem.

    Could there be something else at play? Doe you have any event handlers that run at all?

  • Stewart Toye 9 posts 108 karma points
    Oct 05, 2022 @ 14:15
    Stewart Toye
    0

    Hi,

    Below shows where the error is being thrown locally. I've not got any event handlers setup.

    Seems be an issue with converting Guid to IConvertible.

    enter image description here

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Oct 05, 2022 @ 14:38
    Matt Brailsford
    0

    What database are you running on?

  • Stewart Toye 9 posts 108 karma points
    Oct 05, 2022 @ 15:03
    Stewart Toye
    0

    I'm using Microsoft SQL Server 2019 (RTM-GDR) (KB5014356) - 15.0.2095.3 (X64)

    Provider is "umbracoDbDSN_ProviderName": "Microsoft.Data.SqlClient"

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Oct 05, 2022 @ 15:40
    Matt Brailsford
    0

    Ok, I’m using SQLite locally so I’ll have to test on Sql Server tomorrow.

    I know we have an explicit converter for SQLite but I was under the impression SQL server didn’t need it.

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Oct 06, 2022 @ 13:05
    Matt Brailsford
    101

    Ok, so I've managed to test it and replicate the issue locally on SQL Server.

    I'm not exactly sure what is causing the error but I've managed to find an alternative approach that looks to resolve the issue.

    I've just pushed an update to our unstable feed at https://nuget.outfield.digital/unstable/vendr/v3/index.json so if you want to test version 3.0.2-beta0002 and see if that resolves the issue for you that would be great.

  • Justin Neville 22 posts 196 karma points c-trib
    Oct 07, 2022 @ 14:26
    Justin Neville
    0

    Thanks Matt, I've just come across this exact same issue on SQL Server and I can confirm it is working fine in 3.0.2-beta0002!

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Oct 07, 2022 @ 14:28
    Matt Brailsford
    0

    Perfect!

    Thanks for confirming

    I'll get this released early next week 👍

Please Sign in or register to post replies

Write your reply to:

Draft