Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'd like to use CMS Import to import Products into Tea Commerce.
Firstly I've managed to get the top-level details added in from a CSV file.
And so on.
However when working with more complex property Types for instance:
Nested Content & Tea Commerce Variants
How do we structure the CSV file to accommodate these?
Is there an example of an Excel file/CSV file someone has used before we can have a lok at?
Even if the Variants are just say - Colour and Size for instance. How do we handle that in the spreadsheet? And Map using CMS Import?
I worked with Anders on some Teacommerce extensions years ago. Don't know if theses are still valid but you can find them here https://www.dropbox.com/s/xhuwizhqe27tmt2/CMSImport.TeaCommerce-source.rar?dl=0
The variants is in here and work as a seperate child import, so you basically have Categories -> Products (Child import of categories) -> Product variants (Child import of Products). Variants allows you to map to a variant and price
Nested content is not something CMSImport can handle since it's a definition of it's own.
Hope you can use the source code.
Thanks, I'll take a look.
For things like Multi Media Pickers, Content Tree Pickers, Multi-Node Tree Pickers.
Is there a format that information needs adding to a cell? Then generate the CSV.
For instance, in a Multi-Media Picker, do we just list the file location of the images comma delimited?
e.g - C:\Documents\Pic1.png, C:\Documents\Pic2.png
And so on? Do they need to be in quotes?
Is there a definitive guide on how we need to format cells in our spreadsheet so the CMS Import can map the values correctly to the corresponding property type?
For media Pickers use a relative path to the media item /images/pic1.png etc for link pickers use the title.
Best to watch the video import Content First https://soetemansoftware.nl/cmsimport/videos that explains how to map the things.
Yes, I'm aware of how to map things in CMS Import, I select the corresponding item in the dropdown.
I Just want to know how it should be saved/formatted in the Excel Spreadsheet so CMS Import knows how to map the value entered into the cell of the spreadsheet to the corresponding property type.
Can it handle multiple images for the Multi-Image Picker?
If I add the paths like this in a cell:
will CMS Import know that it will import 2 images to that Property Type of Multi-Media Picker?
Do I need the quotes around the file path?
Also when you say relative path for images, is this relative to Umbraco?
So in the images folder add an image and reference in the Excel spreadsheet?
I have tried /images/product_images/pic1.png and this just fails, I get an error when opening the created product node, it can't find that URL.
Or do I need to upload the images to Umbraco's Media folder, and then add the relative path to the Excel spreadsheet?
Surely this should all be documented somewhere?
I've spent the best part of a day testing paths, text, in the hope it will magically map what I've added, is there any reference documentation I can use to make sure what I'm adding to my cells in Excel can be mapped correctly on import?
The images need to be relative to the root folder. Did you set the advanced settings on the mapping?
Below the sheet and the images folder I used in the video.
Thanks, I'll take a look at the Excel sheets.
I guess it's all going to be nested with Keys to determine what each nestable options which rely on its parent.
Hopefully, I can get this code to work for Tea Commerce Variants and the client can build up their Excel sheets accordingly.
Where do I set up advanced settings on the mapping?
Do I need to purchase a license to see those options. We're using the default one at the min to test we can import before committing and buying a license, but if we need it to set these options, we'll buy the license
Ah that explains. The free version doesn't support media import If you email [email protected] I'll reply with a Trial license. And then you should see a settings icon after the Image property mapping.
Hope this helps,
Brilliant, email sent.
I'm trying to implement this - https://www.dropbox.com/s/xhuwizhqe27tmt2/CMSImport.TeaCommerce-source.rar?dl=0
I've got it compiling into a DLL, added it to my bin folder, and referenced it in Visual Studio.
I'm running a 'Create Child Definition' from the imported Products.
Setting a ParentId and Id of the Variant, however it doesn't seem to map the Variants correctly?
As you can see it just creates them as Child Nodes of Type Variant.
It's mapping some of the Properties Ok, so think I'm nearly there with it.
When I Map the Property Types, There doesn't seem to be mapping for Colour and Sizes.
Any pointers on how to get this working correctly?
Did you use the TeacommerceVariant Import provider in that child import? I think you've used the standard one?
Hmmm, no i cant see that Option:
Using Umbraco 7.15.5 and CMS Import 3.7.8
Do you happen to have a compiled DLL to use with it, I assume if it's not showing up here it's not setup/working correctly?
Looking at the code base you sent, TeacommerceVariantImportProvider has a couple of errors:
public static ImportState GetPersistedStateByWizardID(Guid stateID)
var state = (ImportState)SerializeHelper.DeserializeBase64(DataHelper.LoadState(stateID)); < ------Cannot Access internal method
/// Gets a list of child state by parent ID. This is a list because more than 1 child import can be stored under a parent
/// <param name="stateID">The state ID.</param>
public static List<ImportState> GetChildStateByParentID(Guid stateID)
List<ImportState> childStateList = new List<ImportState>();
List<Guid> childStateIds = DataHelper.LoadChildStateIDs(stateID); <------ Cannot Access internal method
if (childStateIds.Count > 0)
foreach (Guid childStateID in childStateIds)
I've commented these out to get it to build, as LoadChildStateIDs and LoadState are Internals. Unsure if they are needed or not? As GetChildStateByParentID has no references to being used?
if they are needed, is there a way for it to access these internal methods?
Ok think im getting somewhere with this now:
I have the Teacommerce Variant provider
I can't import a child definition, have to use Import Data to be able to select the Teacommerce Variant provider.
When I run it against the Excel sheet I have i get the following error:
2021-03-29 12:19:47,072 [P37020/D13/T442] ERROR CMSImportLibrary.Import.ImportProviders - CMSImport:Error during import
System.Data.SqlClient.SqlException (0x80131904): Cannot find the object "CMSImportTeacommerceVariantImport" because it does not exist or you do not have permissions.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func)
at Umbraco.Core.Persistence.Database.Execute(String sql, Object args)
at CMSImport.TeaCommerce.Services.VariantService.ClearTempTable() in C:\Users\Neil\source\repos\CMSImport.TeaCommerce-source\CMSImport.TeaCommerce\Services\VariantService.cs:line 16
at CMSImport.TeaCommerce.ImportProviders.TeacommerceVariantImportProvider.Import(ImportState state, ImportOptions importOptions, ImportStatistics importStatistics) in C:\Users\Neil\source\repos\CMSImport.TeaCommerce-source\CMSImport.TeaCommerce\ImportProviders\TeacommerceVariantImportProvider.cs:line 136
at CMSImportLibrary.Import.ImportProviders.(ImportState , ImportOptions , ImportStatistics , DataProvider )
2021-03-29 12:19:47,072 [P37020/D13/T442] INFO CMSImport.Extensions.Providers.ImportProviders.ImportProvider - CMSImport:Import finished, Records in datasource: 0, Records Added 0, Records Updated 0, Records skipped 0, Records deleted 0, Errors 1, duration 00:00:00
Ok, sort of got this working now :)
However the Table - CMSImportTeacommerceVariantImport has a NodeId of 0
It stores the JSON in the VariantJSON column but unsure why my NodeId is not getting populated.
I think once that's sorted this will then import the variants.
All working as should now!
The NodeId is returning. I think the import needed the Parent Id of the Product import, now all working correctly.
Thanks for your help, Richard!
Great to hear Neil, was about to go through your questions..
Yes, sorry about the barrage of questions, hopefully, me documenting it in this way will help someone else looking for the same thing in the future :)
Thanks again Richard
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted