roboy Posted April 1, 2013 Share Posted April 1, 2013 We are running Prestashop version 1.4.9 in our live shop. Unfortunately we are unable to delete many of our products when they no longer exist in stock. We can only deactivate them. Our categories are full of deactivated products now and it's getting quite cumbersome. In addition the shop has grown unnecessarily big in size, which makes it difficult to create backups. When we try to delete the products we receive the following error message: "An error occurred during deletion: this product is contained in an order." (Please see the attached screenshot) Despite a lot of trying we are still not able to delete. The problem is general and does not only concern the Prestashop sample products. I have changed the status of all orders, except the new ones, to either 'Delivered' och 'Cancelled' but no luck. The new orders does not contain any of the concerned products, since those products have been deactivated much earlier. Should we be forced to delete all our previous orders? We really want them for the shop's statistics. I would really really appreciate if anyone could help us resolve this issue, without deleting the orders!! Link to comment Share on other sites More sharing options...
Doulas Akula Posted April 1, 2013 Share Posted April 1, 2013 In your shop if you dont necessarily need to monitor stock of products. You may disable stock management in the products sub menu in back office. I have done that for my shop and am able to delete products I wish to. However I dont take track of the stock. As in when one buys it neither decreases nor do I have to restock. So I suggest you try this if you dont need a stock inventory. Link to comment Share on other sites More sharing options...
roboy Posted April 1, 2013 Author Share Posted April 1, 2013 I already have stock management (back office > preferences > products) disabled so unfortunately that cannot be the problem. Thanks very much anyway for trying to help! Does anyone else have a clue as to what might be wrong here? I find this problem unlikely to be a bug in PS 1.4.9 - the most developed version of Prestashop 1.4. Link to comment Share on other sites More sharing options...
roboy Posted April 2, 2013 Author Share Posted April 2, 2013 Clarification: This problem has no apparent connection with stock management or products being out of stock. The inability to delete old products seems to occur due to the presence of those products in customer orders. For some reason Prestashop does not allow the deletion of products that exist in orders. At one point I thought it had to do with order statuses so I changed all statuses of previous orders into either 'Delivered' och 'Cancelled', but still I am unable to delete the products. This behaviour by the Prestashop platform does not seem logical and it looks like a bug to me (please correct me if I'm wrong). Yes, I am aware that the 1.4.9 version is not the latest, but it's still widely used in live shops due to its stability, The answer to this problem should therefore be of general interest. I hope that anyone will be able to offer a solution or at least an explanation. Thanks in advance! Link to comment Share on other sites More sharing options...
roboy Posted April 5, 2013 Author Share Posted April 5, 2013 Anyone? I would really appreciate some help... Link to comment Share on other sites More sharing options...
PascalVG Posted April 6, 2013 Share Posted April 6, 2013 The problem here is that your orders need the old products to get the info they need to be a valid order (the order needs to know what is sold, it sometimes shows pictures of the sold products etc.) so these products are needed if you don't want to delete your old orders, as you mentioned. So if you can't delete them, the best you can do is getting them out of your active shop part. To get them out of the way, you could consider to first 'clean them up a little', by deleting all unnecessary extra pictures added to them, combinations not used, etc. This to reduce their size as much as possible, decreasing the overhead in backup etc. Then change their category to a new category named 'Old products'. Remove them from your active categories. This way they don't show up in the product lists of that category in BO, having a cleaner list with only 'current' products, making maintenance easier. Make sure the new Category 'Old Products' has it's 'Displayed' set to "NO", so that it doesn't pop up in your front office. Not a real solution, but maybe a good compromise?? My 2 cents, Pascal 2 Link to comment Share on other sites More sharing options...
roboy Posted April 9, 2013 Author Share Posted April 9, 2013 Thanks very much for the really great workaround I will do that until there is a permanent solution. It surpises me though that Prestashop has chosen this path. In earlier versions there was never any problem deleting old products regardless of their existence in orders. I remember that when a product had been deleted it was still mentioned in the order, but without any product image. It was working just fine. I really can't see a reason why we need this limitation, but perhaps I just have lack of understanding? . Can anyone please explain why this change took place? In version 1.2.5 it was always possible to delete products. Link to comment Share on other sites More sharing options...
Timss86 Posted September 19, 2013 Share Posted September 19, 2013 I'm not to sure if this has been resolved already, I see the topic and comments are from April. What we did was follow the steps Pascal mentioned above and as soon as we moved the items to the "old post" category, we then deleted that entire category and it then deleted the items within that category. My worry though is that its hard to just delete the items without following all the steps. By creating that category and placing all the items into the "Old Products" and then deleting that entire "Old Products" category without it giving that error, does it mean the products are indeed gone for good or have they just moved or placed themselves into another area? We have looked by searching by a specific product name and it says "no results found" but I worry that it might have moved somewhere else. please advise. Link to comment Share on other sites More sharing options...
PascalVG Posted September 19, 2013 Share Posted September 19, 2013 Hi Timss, What you can do is have a look in ps_product_lang; make sure ALL records show (SQL: select * from `ps_product_lang` where 1) and then search (Ctrl-F) for a string that used to be in one of the old product names you deleted. If you don't find them, they're probably gone forever... My 2 cents, pascal Link to comment Share on other sites More sharing options...
Timss86 Posted September 23, 2013 Share Posted September 23, 2013 Hi Timss, What you can do is have a look in ps_product_lang; make sure ALL records show (SQL: select * from `ps_product_lang` where 1) and then search (Ctrl-F) for a string that used to be in one of the old product names you deleted. If you don't find them, they're probably gone forever... My 2 cents, pascal Thank you so much Pascal I think we ave successfully deleted all of them, nothing came up. Link to comment Share on other sites More sharing options...
El Patron Posted September 23, 2013 Share Posted September 23, 2013 since you can simply set show only 'enabled' products one would think that would suffice... anyone coming through here and thinking it's a good idea to delete products that have attached orders...can expect unpredictable results my three cents Link to comment Share on other sites More sharing options...
PascalVG Posted September 23, 2013 Share Posted September 23, 2013 Yep, You're right El Patron! I mentioned the reason why PS had this limitation in my post #6. If people found away to delete them anyway, the underlying reason DOESN'T disappear. So take El Patron's advise, and reconsider before deleting products. Make Back Up's and if you do, check if orders are still accessible etc. Thanks for the warning, El Patron! pascal Link to comment Share on other sites More sharing options...
El Patron Posted September 23, 2013 Share Posted September 23, 2013 Yep, You're right El Patron! I mentioned the reason why PS had this limitation in my post #6. If people found away to delete them anyway, the underlying reason DOESN'T disappear. So take El Patron's advise, and reconsider before deleting products. Make Back Up's and if you do, check if orders are still accessible etc. Thanks for the warning, El Patron! pascal thanks for reiterating our shared opinion. I think one of the most important mod responsibility is keeping people from shooting themselves in the foot. btw(appreciate that mod review you did for me, I am going to get on answering soon) Link to comment Share on other sites More sharing options...
Flmbx Posted March 7, 2014 Share Posted March 7, 2014 OK this is a pretty good workaround for "deleted" products in the shop. But what about Google and SEO?? Is it sufficient to have these products excluded from sitemap.xml? Or will the robots still find those disabled products in the shop anyway even when removed from sitemap.xml?? Link to comment Share on other sites More sharing options...
Recommended Posts