Copied to clipboard

Flag this post as spam?

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


  • Tyler Brown 62 posts 209 karma points
    Sep 22, 2015 @ 14:50
    Tyler Brown
    0

    Merchello 1.9 Error when creating coupon offer

    I had upgraded to Merchello 1.9 (Umbraco 7.2) and just realized that I cannot create coupon offers. Here's what happens:

    1. create offer
    2. configure rewards: If I select 'free shipping' everything saves fine. If I select discount and try to save either percentage
      or amount, I get this error:

    /umbraco/backoffice/Merchello/MarketingApi/PutUpdateOfferSettings 500 (Internal Server Error)

    Once the error happens (in dialog with no stack trace) I can delete the offer. If i don't delete the offer, then I get this error when I go back to the Marketing section:

    /umbraco/backoffice/Merchello/MarketingApi/SearchOffers 500 (Internal Server Error)

    Checking the database, looks like the record is created in the merchOfferSettings table. Manually deleting it from the table also solves the 500 error.

    Any thoughts?

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Sep 22, 2015 @ 15:40
    Rusty Swayne
    0

    @Tyler -

    What format are you entering the numbers? Do they have a comma for a decimal place?

    Are you using any constraints?

  • Tyler Brown 62 posts 209 karma points
    Sep 22, 2015 @ 15:47
    Tyler Brown
    0

    Rusty,

    Since it's a number field, I've just used integers, but I just tried using a decimal for amount and I get the same error.

    I get the same result whether or not I have any constraints.

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Sep 22, 2015 @ 17:23
    Rusty Swayne
    0

    Can you post the data from the row in the OfferSettings table. May help figure out what is going on.

  • Tyler Brown 62 posts 209 karma points
    Sep 22, 2015 @ 17:49
    Tyler Brown
    0
    [{"$id":"1","OfferSettingsKey":"f8e72b3f-fe01-45f0-96de-0f66b229d74c","OfferCode":"20OFF","ComponentKey":"a1cce36a-c5aa-4c50-b659-cc2fbdeaa7b3","TypeFullName":"Merchello.Web.Discounts.Coupons.Rewards.CouponDiscountLineItemReward","Values":[{"Key":"lineItemName","Value":"20% OFF"},{"Key":"adjustmentType","Value":"percent"},{"Key":"amount","Value":"20"}]},{"$id":"2","OfferSettingsKey":"f8e72b3f-fe01-45f0-96de-0f66b229d74c","OfferCode":"20OFF","ComponentKey":"15ddf0ea-9c60-489a-96a8-d2aaadbef328","TypeFullName":"Merchello.Web.Discounts.Coupons.Constraints.ProductSelectionFilterConstraint","Values":[{"Key":"productConstraints","Value":"[{\"productKey\":\"99159308-2600-4a47-ac2b-edaa0096e8e0\",\"variantKeys\":[],\"specifiedVariants\":false}]"}]}]
    

    Above is the value of configurationData. Below is the row as it is/was in the database:

    enter image description here

  • Tyler Brown 62 posts 209 karma points
    Sep 23, 2015 @ 13:44
    Tyler Brown
    0

    I don't know if this sheds any more light, but it looks like reporting is not working either. When I click on the node, nothing happens. I'm not getting any errors in the console either. I updated this install awhile ago and I don't remember exactly how I did it so I'm going to attempt a reinstall of Merchello...

    EDIT/UPDATE:

    I'm looking at the merchTypeField table and I don't have a column called 'CustomerCredit'. What data type should this be?

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Sep 23, 2015 @ 15:34
    Rusty Swayne
    0

    The CustomerCredit would affect the coupons. That needs to be added to your merchTypeField table ...

  • Tyler Brown 62 posts 209 karma points
    Sep 23, 2015 @ 16:19
    Tyler Brown
    0

    ok. what is the data type for the CustomerCredit Field? Is there documentation on that somewhere? Sorry if this should be obvious, I'm just not finding it :)

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Sep 23, 2015 @ 17:35
    Rusty Swayne
    0

    @Tyler I just tried adding a coupon after deleting that field and it was successful ... so there must be something else going on. I did looked at the install again, and I commented out this field for the time being - so sorry for the confusion here.

    The value will be but it's not going to us much good.

       CD0FB122-DE4E-4F1A-939F-EC5859777EAE | Customer Credit | CustomerCreditKey
    

    Are there JS errors in your console window?

  • Tyler Brown 62 posts 209 karma points
    Sep 24, 2015 @ 11:49
    Tyler Brown
    0

    Rusty,

    My original post has the console errors. I probably wasn't clear: I get an error with no stack trace in a dialog window, but the console shows the error detail. When I add a discount amount to the coupon, I get this in the console:

    /umbraco/backoffice/Merchello/MarketingApi/PutUpdateOfferSettings 500 (Internal Server Error)

    Then, if I go back to the main marketing section, nothing shows up in the main window and I get this in the console:

    /umbraco/backoffice/Merchello/MarketingApi/PutUpdateOfferSettings 500 (Internal Server Error)

    Everything is fine if I delete the record that was created in the merchOfferSettings table.

  • Tyler Brown 62 posts 209 karma points
    Sep 24, 2015 @ 13:47
    Tyler Brown
    0

    The 500 error on PutUpdateOfferSettings response is:

    {"message":"The requested resource does not support http method 'GET'."}

  • Tyler Brown 62 posts 209 karma points
    Sep 24, 2015 @ 14:18
    Tyler Brown
    0

    ok a little more info, just to be clear, this only happen when I click the save button in the Offer Reward Dialog (Merchello.Marketing.Dialogs.OfferRewardCouponDiscountPrice) and ONLY if I place a value in the textbox or try and change the radio button. If I just save the dialog without changing anything it saves fine.

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Sep 24, 2015 @ 15:17
    Rusty Swayne
    0

    Wow that makes no sense. GET?

    Can you search for 'PutUpdateOfferSettings' in

    /App_Plugins/Merchello/js/merchello.resources.js

    The method should look like

                      saveOfferSettings: function(offerSettings) {
                    offerSettings.componentDefinitionExtendedDataToArray();
                    setUtcDates(offerSettings);
                    return umbRequestHelper.resourcePromise(
                        $http.post(baseUrl + "PutUpdateOfferSettings",
                            offerSettings
                        ),
                        'Failed to create offer');
                },
    
  • Tyler Brown 62 posts 209 karma points
    Sep 24, 2015 @ 15:31
    Tyler Brown
    0

    actually, disregard the GET error (I think I've been staring at this too long!)

    I tried reinstalling Merchello 1.9.0 and I get the 500 error. BUT I'm seeing a response with a stack trace now that should help:

    {"message":"An error has occurred.","exceptionMessage":"Attempt by method 'Merchello.Web.Discounts.Coupons.Rewards.CouponDiscountLineItemReward.get_AdjustmentType()' to access method 'Umbraco.Core.Enum`1<Merchello.Web.Discounts.Coupons.Rewards.CouponDiscountLineItemReward+Adjustment>.Parse(System.String, Boolean)' failed.","exceptionType":"System.MethodAccessException","stackTrace":"   at Merchello.Web.Discounts.Coupons.Rewards.CouponDiscountLineItemReward.get_AdjustmentType() in c:\\Working Repositories\\GitHub\\Merchello\\src\\Merchello.Web\\Discounts\\Coupons\\Rewards\\CouponDiscountLineItemReward.cs:line 76\r\n   at Merchello.Web.Discounts.Coupons.Rewards.CouponDiscountLineItemReward.get_DisplayConfigurationFormat() in c:\\Working Repositories\\GitHub\\Merchello\\src\\Merchello.Web\\Discounts\\Coupons\\Rewards\\CouponDiscountLineItemReward.cs:line 90\r\n   at lambda_method(Closure , Object )\r\n   at AutoMapper.Impl.PropertyGetter.GetValue(Object source)\r\n   at AutoMapper.Impl.MemberGetter.Resolve(ResolutionResult source)\r\n   at AutoMapper.PropertyMap.<ResolveValue>b__6(ResolutionResult current, IValueResolver resolver)\r\n   at System.Linq.Enumerable.Aggregate[TSource,TAccumulate](IEnumerable`1 source, TAccumulate seed, Func`3 func)\r\n   at AutoMapper.PropertyMap.ResolveValue(ResolutionContext context)\r\n   at AutoMapper.Mappers.TypeMapObjectMapperRegistry.PropertyMapMappingStrategy.MapPropertyValue(ResolutionContext context, IMappingEngineRunner mapper, Object mappedObject, PropertyMap propertyMap)"}
    

    I've double-checked that I'm using the Merchello 1.9.0 dlls

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Sep 24, 2015 @ 16:25
    Rusty Swayne
    0

    I sent you a DM on twitter.

  • Tyler Brown 62 posts 209 karma points
    Sep 24, 2015 @ 19:49
    Tyler Brown
    100

    Welp, still not sure what the issue was, but I started incrementing my Umbraco install and I no longer get the error when using Umbraco 7.2.2 so I'm calling that a win!

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    Sep 24, 2015 @ 20:22
    Rusty Swayne
    0

    Awesome - there must have been an Umbraco dependency that created a slight breaking change that I did not know about. Great work getting it sorted!

  • Tyler Brown 62 posts 209 karma points
    Sep 25, 2015 @ 12:57
    Tyler Brown
    0

    Spoke too soon!

    Marketing works, but Products, Sales, Customers, etc are now throwing errors (value cannot be null errors) on top of that, I can't get to the developer section in Umbraco- I'm not authorized. Gonna try and sort this out :)

  • Tyler Brown 62 posts 209 karma points
    Oct 13, 2015 @ 15:18
    Tyler Brown
    1

    Circling back to older posts... My latest problem was simply a routing problem from an unrelated project. So we're good.

Please Sign in or register to post replies

Write your reply to:

Draft