Copied to clipboard

Flag this post as spam?

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


  • Jamie Howarth 306 posts 773 karma points c-trib
    Sep 23, 2019 @ 12:48
    Jamie Howarth
    0

    Variants not persisting due to an Angular error

    Hi folks,

    So I've got an issue with variants refusing to persist on a product. I've walked the stack trace in Devtools and it's attached.

    Teacommerce Angular bug

    The error seems to be in $scope.getCheckedVariantGroups, but I haven't been able to isolate it any further, sadly.

    This is my variant collection:

    Variant collection in Teacommerce

    Thanks,

    Benjamin

  • Jamie Howarth 306 posts 773 karma points c-trib
    Sep 23, 2019 @ 12:54
    Jamie Howarth
    0

    Worked it out! If you have an attribute group, but no attributes, then it errors out. Deleting the empty attribute group fixes it.

    Line 200 of variant-editor.controller.js needs a null check on variantGroup.items!

    Cheers,

    B

  • Matt Brailsford 4124 posts 22220 karma points MVP 9x c-trib
    Sep 23, 2019 @ 13:04
    Matt Brailsford
    0

    Hey Ben,

    Nicely figured out.

    If you are up for it, this file should form part of the OS Umbraco front end for TC, so would be super awesome if you had the time to submit a PR for it https://github.com/TeaCommerce/Tea-Commerce-for-Umbraco/pulls

    No worries if not though, I'll pick it up on my next round of updates.

    Matt

  • Jamie Howarth 306 posts 773 karma points c-trib
    Sep 23, 2019 @ 14:18
    Jamie Howarth
    0

    Gladly! I'll send in a PR shortly 🙂

Please Sign in or register to post replies

Write your reply to:

Draft