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
I think that the issue is the "docTypeProperties" item in the "variant-editor-controller" is undefined. Any ideas what I may have missed?
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.
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
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();
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.
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?
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.
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? =/
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
I think that the issue is the "docTypeProperties" item in the "variant-editor-controller" is undefined. Any ideas what I may have missed?
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?
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.
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?
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
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!
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
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?
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)?
Yeah, Exactly this
I have the variants selected but no dropdown arrow.
And you have the "variant documnet type" set to the alias of your variant doc type in the "Tea Commerce: Variant Editor"?
I do yup.
Any console errors in the browser dev tools when you edit a product's varaints?
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?
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.
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.
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? =/
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
Thanks Rune,
This fixed that one!
So thanks both of you for the help :) Have a good one
David.
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
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
Thanks Rune, yes something like
should work across all versions
Yes. I'm just worried that someone would make a custom tab and call i "Properties" :/ So there's potential for another bug there.
Hmmm true, maybe check for a standard umbraco property on the tab such as "LastEdited" before removing
Yes. That could work.
is working on a reply...