Can't edit/remove product definitions on Sitecore
Hey guys, we are dealing with a problem here while trying to edit/remove product definitions:
- Go to Commerce Settings / Product Definitions and create a new definition
- Go to sitecore Content Editor and check for the two new templates that were created just fine.
- Then we try to edit those templates by updating the layout and/or sub-layouts at the standard values item and save the changes.
- Then open up the presentation/details again and you will notice no changes at sight, meaning no changes were saved.
- Then go to the commerce settings/products definitions again and remove the new created item there.
- Then go back to sitecore content editor and you will see the two templates are still there.
- Then try to remove them manually and you will notice nothing happens.
So wondering if it could be something going wrong with unicorn or is there something else?
We are working with:
- Sitecore.NET 8.2 (rev. 161221)
- Latest code pulled from https://bitbucket.org/uCommerce/avenue-clothing-for-sitecore
We tried to replicate the errors you are getting on a fresh environment and cannot replicate step 4. You can check in the database in the SharedFields after you save the template for the specific template’s id and the look up the values are attributed to the field? That might give us an indication of what is overwriting it and why the changes don’t get saved.
Also, in regards to step 6, this is our intended behavior. You can delete the Product Definition, but it is only a soft delete as some products might be using those definitions.
AdminUcommerce (Admin, uCommerce) commented
Yes, I have been working with clean uCommerce, Sitecore and the latest version of the Avenue Clothing Sitecore Accelerator.
Regarding #4, from you you mentioned, it sounds like something is fishy with the Data Providers. You can try to delete one of the templates and debug it to see if the uCommerce Data Provider will be trying to restore it. If the item has been picked up by Unicorn as a Sitecore item, this might be the reason why it is not picking up on the changes in the Presentation/Details.
Regarding #6, for now there are no plans to change the policy, but I have added the suggestion to our backlog. If you want them to be removed from the Content Editor altogether, I suggest you remove them from the database, after you made sure that no product is using that Product Definition. This is also the reason why we chose to soft delete.
P.S. You can also write to us directly at email@example.com .
Ruben De Leon commented
Regarding step #4, can you confirm whether you are using the avenue-clothing solution from bitbucket? or you just tested it on top of a clean sitecore solution and ucommerce package only? So I've a bit more info about this issue, and just in case let me confirm you that I'm working with the avenue-clothing-for-site project as my accelerator. Details below:
-. Using the master DB at the sitecore page editor, I keep adding layouts/sublayouts and after saving it and opening it up again no changes are reflected.
-. If I go to the database those templates (Items) doesn't exist, which makes sense if we use unicorn since those items are being serialized Am I right?
-. Now on the other hand, if I publish that template to web DB and I switch from databases I do see those layouts/sublayouts by going to presentation/details for the standard values of that template. This also makes sense because when we do a publish to WEB sitecore do create the items and fields on the web database.
So based on the above, it seems that when I make changes to the standard values at master DB the changes are actually serialized correctly even if I can't see the changes when I go to presentation/details (i.e: considering that when we publish we see them at the web database). So I think something is going wrong with the de-serialization at the master database.
On the other hand for step #6, I understand if we remove the product definition from the ucommerce settings we do a soft delete meaning we keep the real templates at the sitecore side but, I would say we should be able to manually delete those templates from the Sitecore Content Editor because if ucommerce doesn't let us do that, we will then anyways need to manually run cleanup scripts on the database. Is this something that can be improved or we should work it around?