Copied to clipboard

Flag this post as spam?

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


  • Julian 13 posts 83 karma points
    16 days ago
    Julian
    0

    Cannot add product variants

    I'm trying to evaluate TeaCommerce for a site we are developing, but I'm having issues adding variants to a product, my variants appear when I edit the product, but having selected my variants and clicking "add variant options" fails, if i look in the developer tools I have the following JS error

    enter image description here

    I think that the issue is the "docTypeProperties" item in the "variant-editor-controller" is undefined. Any ideas what I may have missed?

  • Brian Lyk Larsen 16 posts 210 karma points
    15 days ago
    Brian Lyk Larsen
    1

    Hi Julian,

    The problem might be in your settings on the Tea Commerce: Variant Editor data type.

    I managed to get the same error when I entered something invalid in the Variant group document types and Variant group name fields.

    Can you share your settings?

  • Julian 13 posts 83 karma points
    15 days ago
    Julian
    0

    Hi Brian,

    Spot on, that was the issue I had the alias of the values doc Type in there, I can now select the variants, but I was expecting to be able to edit them as I have a doc type set in the "Variant document type" field on the editor. I only get the "edit variant types" or "delete" options, not the option to edit extended fields, sorry for all the questions but I couldn't find any docs telling me how to set this up.

  • Brian Lyk Larsen 16 posts 210 karma points
    15 days ago
    Brian Lyk Larsen
    0

    No worries. Parts of the documentation could use some work :)

    You should indeed be able to edit variant properties when a doc type is set in Variant document type.

    Does the - Open all - button do anything? Do you get any errors in the console when you click on a variant?

  • Julian 13 posts 83 karma points
    15 days ago
    Julian
    0

    Yes, I have the Variant Document Type set to the doc type alias of the document type that contains my extended properties. I don't get an error, but I don't get the "Fold Out" icon on the variant (like the one that appears on the example site), just the edit and delete icons

    enter image description here

  • Julian 13 posts 83 karma points
    1 week ago
    Julian
    0

    Hi, still can't get this working, can anybody shed any light? Tried emailing TeaCommerce and got an out of office for the next 4 weeks!

  • Julian 13 posts 83 karma points
    1 week ago
    Julian
    0

    Ok, think I found the problem.

    We are using version 7.11.0 of Umbraco, I think the "properties" tab on a doc type has now been removed. There is a line of code in the variant-editor-controller.js that removes the final tab (what it believes is the "properties" tab) from its array of tabs before iterating through all the properties on each remaining tab, as my doc type only had one tab it didn't think that my variant doc type had any properties.

    the solution is to comment out the line that removes the final tab from the array, the final line below should be commented out

    if ($scope.settings.docTypeAlias) {
      //There's a document type from the settings to load
      contentResource.getScaffold(-20, $scope.settings.docTypeAlias).then(function (data) {
        // Remove the last tab
        $scope.doctype = data.tabs.pop();
    
  • David Mill 8 posts 78 karma points
    1 week ago
    David Mill
    0

    Hi Julian,

    This is the same issue as I am having! (Umbraco 7.11.1 though)

    I've edited the variant-editor.controller.js but it's having no effect what-so-ever on the functionality of the variants. I even commented out the entire JS just to make sure.

    Have I missed something?

  • Julian 13 posts 83 karma points
    1 week ago
    Julian
    0

    Hi David, can you select the variants for the product, but just can't edit any extended fields (the fields in your variant doc type)?

  • David Mill 8 posts 78 karma points
    1 week ago
    David Mill
    0

    Yeah, Exactly this

    I have the variants selected but no dropdown arrow.

  • Julian 13 posts 83 karma points
    1 week ago
    Julian
    0

    David, Not sure what happened to the other posts in this thread, or if you got my last post. Are there any errors in the developer tools console of the browser when you edit a product and its variants?

  • David Mill 8 posts 78 karma points
    1 week ago
    David Mill
    0

    I got the email for that last post, sorry for the delay. I thought I was going nuts when I couldn't see the posts!

    No, I'm not getting any errors on the developer tools at all or within the umbracolog.

  • Julian 13 posts 83 karma points
    1 week ago
    Julian
    0

    Make sure the code is updated to exclude the last tab only if it is the "properties" tab and clear all browser cache then reload and edit the product. (see post above)

    After that, the only thing I can suggest is putting a breakpoint on about line 550 of the variant-editor.controller.js and making sure that the $scope.doctypeProperties is populated with the list of properties in your variant doc type. If not then put a breakpoint on the line above the one that I suggested you comment out or add the if statement around (about line 753) and see what the returned data from the call to contentResource.getScaffold is and are your properties/ tabs populated correctly.

  • David Mill 8 posts 78 karma points
    1 week ago
    David Mill
    0

    This might sound like I'm just being daft (I might well be..)

    It doesn't seem to matter what changes I do to the variant-editor.controller.js file, it changes no behaviour at all. even commenting out the entire file, adding in console logs or alerts, etc.

    Am I missing something stupid like having to rebuild something? =/

  • Rune Grønkjær 1228 posts 2692 karma points
    1 week ago
    Rune Grønkjær
    0

    That's probably just umbraco's backoffice cache messing with you.

    Try setting the website in debug mode in the web.config and then make sure to clear your browser cache as well.

    /Rune

  • David Mill 8 posts 78 karma points
    1 week ago
    David Mill
    0

    It appears my last comment disappeared again =S

    Anyhows, if you hadn't seen an email

    Rune, this worked great :) I didn't even think of that ¬¬

    Thank you both for your help!

    Cheers, David

  • Rune Grønkjær 1228 posts 2692 karma points
    1 week ago
    Rune Grønkjær
    0

    Hi Julian,

    Nice work. That sounds correct. I think we need to figure out how to identify the Properties tabs, if it's there, and remove it only then.

    Thanks for your insights.

    /Rune

  • Julian 13 posts 83 karma points
    1 week ago
    Julian
    0

    Thanks Rune, yes something like

        // Remove the last tab if it is the properties tab
        if (data.tabs[data.tabs.length - 1].alias === 'Properties') {
            $scope.doctype = data.tabs.pop();
        }
    

    should work across all versions

  • Rune Grønkjær 1228 posts 2692 karma points
    1 week ago
    Rune Grønkjær
    0

    Yes. I'm just worried that someone would make a custom tab and call i "Properties" :/ So there's potential for another bug there.

  • Julian 13 posts 83 karma points
    1 week ago
    Julian
    0

    Hmmm true, maybe check for a standard umbraco property on the tab such as "LastEdited" before removing

  • Rune Grønkjær 1228 posts 2692 karma points
    1 week ago
    Rune Grønkjær
    0

    Yes. That could work.

Please Sign in or register to post replies

Write your reply to:

Draft