We have a client who has been running uCommerce for a while. This week-end a customer ordered a product from a category that was deleted eight months ago. The product had not been in other categories.
The category does not show up in the category tree - but when we search for products that we know were placed in that category then they show up as active products in the deleted category in the backend.
Furthermore the categories have been indexed by search engines - and when we type in deleted category names and the site name - the search engines still find the pages with the categories - and ucommerce can still show the deleted categories.
How can we avoid this behaviour in the future? Perhaps set DisplayOnSite to false - Save - and then delete?
And how can we fix this for the remaining categories that have been deleted - but still holds and displays obsolete products? I cannot reach the categories from the uCommerce administration.
uCommerce are using a concept of "softdeletable" which means some entities are still existing in the database just with their "Deleted" column set to 1. As I recall categories are a part of this. You can just create a new category with the exact same name and perhaps the same place in the structure (if you can remember) and uCommerce should be reusing the one from the database.
You should also be able to just change the status directly in the database but in that case I would take a backup before changing anything directly if you're not familar with uCommerce entity model :)
Best regards Martin
Edit: A possible fix can be checking whether a category has been deleted before showing it. If it's deleted you can send the user to a 404 page instead or do some url redirecting depending on how you want to handle it.
Thank You for your input. I ended up making a check on the category / product before showing it - and then redirect the user to a 404 if the product was placed in a deleted category.
Categories can still be shown after deletion
Hi everybody,
We have a client who has been running uCommerce for a while. This week-end a customer ordered a product from a category that was deleted eight months ago. The product had not been in other categories.
The category does not show up in the category tree - but when we search for products that we know were placed in that category then they show up as active products in the deleted category in the backend.
Furthermore the categories have been indexed by search engines - and when we type in deleted category names and the site name - the search engines still find the pages with the categories - and ucommerce can still show the deleted categories.
How can we avoid this behaviour in the future? Perhaps set DisplayOnSite to false - Save - and then delete?
And how can we fix this for the remaining categories that have been deleted - but still holds and displays obsolete products? I cannot reach the categories from the uCommerce administration.
Kind regards,
Sonni T.
Hi Sonni,
uCommerce are using a concept of "softdeletable" which means some entities are still existing in the database just with their "Deleted" column set to 1. As I recall categories are a part of this. You can just create a new category with the exact same name and perhaps the same place in the structure (if you can remember) and uCommerce should be reusing the one from the database.
You should also be able to just change the status directly in the database but in that case I would take a backup before changing anything directly if you're not familar with uCommerce entity model :)
Best regards Martin
Edit: A possible fix can be checking whether a category has been deleted before showing it. If it's deleted you can send the user to a 404 page instead or do some url redirecting depending on how you want to handle it.
Hi Martin,
Thank You for your input. I ended up making a check on the category / product before showing it - and then redirect the user to a 404 if the product was placed in a deleted category.
Kind regards
Sonni T.
is working on a reply...