products deleted, but still in the database

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
9 years ago
hi

I have deleted the product , but they are in product table with a field "deleted" made TRUE.. why?

how can I do to deleted definitively?

BR
9 years ago
cicciuzzo wrote:
hi

I have deleted the product , but they are in product table with a field "deleted" made TRUE.. why?

how can I do to deleted definitively?

BR


nopCommerce uses soft-delete, this is normal. ;)
9 years ago
The problem is that in the Specification Attributes ... it is seen that there are associated with specific products that there are not more ...

Number of associated products (10) but in reality the products are only 3. (this not correct)

I did a view in the DB and I found all the products deleted.

is there a way to do general cleaning?
9 years ago
cicciuzzo wrote:
The problem is that in the Specification Attributes ... it is seen that there are associated with specific products that there are not more ...

Number of associated products (10) but in reality the products are only 3. (this not correct)

I did a view in the DB and I found all the products deleted.

is there a way to do general cleaning?


I have not looked into this, perhaps that's a bug. But nopCommerce usually will only retrieve not-deleted items, so there might be a bug that did not account into this. You might want to file a report on CodePlex. :)
9 years ago
wooncherk wrote:

I have not looked into this, perhaps that's a bug. But nopCommerce usually will only retrieve not-deleted items, so there might be a bug that did not account into this. You might want to file a report on CodePlex. :)



there is a way to do cleaning this products and all relations with all the table?
9 years ago
If you want to delete a product from Product table permanently,
add this line at the bottom to :


\Libraries\Nop.Services\Catalog\ProductService.cs

        public virtual void DeleteProduct(Product product)
        {
            if (product == null)
                throw new ArgumentNullException("product");
            
            //delete product
            product.Deleted = true;            
            UpdateProduct(product);


            // ADD THIS LINE BELOW  (permanately deletes the product) :
            _productRepository.Delete(product);            
        }

9 years ago
cicciuzzo wrote:

I have not looked into this, perhaps that's a bug. But nopCommerce usually will only retrieve not-deleted items, so there might be a bug that did not account into this. You might want to file a report on CodePlex. :)


there is a way to do cleaning this products and all relations with all the table?


if you are good at SQL, why not? :D
9 years ago
Because (I think), if you have order items that reference those products, you've just created widows.
7 years ago
Suggested solution here is wrong. There are other tables in database that can have information related to the product like: attributes, combinations, images, store mapping and maybe more.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.