hey, i'm new to uCommerce, and i'm in the middle of trying to understand how uCommerce works. i've tried to find editor manual for uCommerce, but couldn't find one, too bad.
1. i'll start with defintions, why do i need category defintion and how it helps me? (example will be helpful) 2. let's say i want to display with linq the roots categories, what is the correct way to do it ? 3. i created some categories and then deleted them by deleting the root category. now i try to create a categoy with a name of a category that i already deleted but it tells me "Name already exists within catalog.", what can i do ?
And perhaps Twitter - where i found out you had a problem :-)
The category- and productdefinitions are very handy for structuring your data for your shop. Think of them as documenttypes in Umbraco. You can build different data-definitions for your different products and productgroups. Properties could fx. be header, short desciption, image, title-tag, meta-description etc. You can always extend your list of definitions and their properties in the future, but be sure that you structure your definitions correct and select the right definitions for your products and productgroups when you create those.
About listing the root categories you should use the uCommerce API. Example:
hmm... the last one about deleting the root... I guess it has something to do with a unique constraint in the database. And the category will proberbly not actually get deleted, it will just have a "deleted-flag" set. I think you should navigate to the record en the db an remove the deleted-flag, and then thats it. Not the most beatyfull solution, and i guess it could be considered as a bug.
i want to improve the code and get the first catalog and not count on Id or Name of the catalog, how can i do it ? about the bug, your advice about the deleted flag fixed it :)
If you want to pick just the first catalog, then this should do it:
ProductCatalog.FirstOrDefault(x => true);
Pretty generic, but not the best solution if you suddenly end up with more than one catalog in your solution.
You usually identify your catalogs by name. So a better way in my opinion is to use something like this:
string catalogName = "my catalog name from somewhere... could be from the hosting Umbraco"; ProductCatalog myCatalog = ProductCatalog.FirstOrDefault(x => x.Name == catalogName);
some questions
hey, i'm new to uCommerce, and i'm in the middle of trying to understand how uCommerce works.
i've tried to find editor manual for uCommerce, but couldn't find one, too bad.
1. i'll start with defintions, why do i need category defintion and how it helps me? (example will be helpful)
2. let's say i want to display with linq the roots categories, what is the correct way to do it ?
3. i created some categories and then deleted them by deleting the root category. now i try to create a categoy with a name of a category that i already deleted but it tells me "Name already exists within catalog.", what can i do ?
thank you.
Eran.
Hi Eran
First, there is not that much structured documentation on uCommerce yet. The best ressources will definately be:
The category- and productdefinitions are very handy for structuring your data for your shop. Think of them as documenttypes in Umbraco. You can build different data-definitions for your different products and productgroups. Properties could fx. be header, short desciption, image, title-tag, meta-description etc. You can always extend your list of definitions and their properties in the future, but be sure that you structure your definitions correct and select the right definitions for your products and productgroups when you create those.
About listing the root categories you should use the uCommerce API. Example:
hmm... the last one about deleting the root... I guess it has something to do with a unique constraint in the database. And the category will proberbly not actually get deleted, it will just have a "deleted-flag" set. I think you should navigate to the record en the db an remove the deleted-flag, and then thats it. Not the most beatyfull solution, and i guess it could be considered as a bug.
Regards
Anders
thank you for your answers.
about the root categories i found out about Category.GetRootCategories and i got the following code
i want to improve the code and get the first catalog and not count on Id or Name of the catalog, how can i do it ?
about the bug, your advice about the deleted flag fixed it :)
Hi Eran
If you want to pick just the first catalog, then this should do it:
Pretty generic, but not the best solution if you suddenly end up with more than one catalog in your solution.
You usually identify your catalogs by name. So a better way in my opinion is to use something like this:
i decided to go with your advice and get the catalog by the name.
thank you for your help !!
I like to add that you also should keep an eye on Lasse's blog (he's the other guy behind uCommerce):
http://blog.lasseeskildsen.net/
Bye
Christian
is working on a reply...