Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 6 of 6

Thread: Nuke Product in V9+

  1. #1
    netprocity is offline Member
    Join Date
    Dec 2008
    Posts
    80

    Default Nuke Product in V9+

    Hello,

    I can't figure out how to Nuke product. We have many products from testing or others that I want to get rid of out of my product list completely. Right now you can only click the little X to soft delete it. At least that's all I can find.

    How can I get rid of a product permanently in the v9 version.

    Thanks
    James

  2. #2
    AspDotNetStorefront Staff - Scott's Avatar
    AspDotNetStorefront Staff - Scott is offline Administrator
    Join Date
    Mar 2007
    Location
    Ashland, OR
    Posts
    2,390

    Default

    There's no nuke function in the new Product Manager page at the moment. We'll likely add that back in a future release. In the meantime, you can use the SQL queries below to remove products and all references to them:

    DELETE FROM Product
    DELETE FROM ProductAffiliate
    DELETE FROM ProductCategory
    DELETE FROM ProductCustomerLevel
    DELETE FROM ProductDistributor
    DELETE FROM ProductGenre
    DELETE FROM ProductLocaleSetting
    DELETE FROM ProductManufacturer
    DELETE FROM ProductSection
    DELETE FROM ProductVariant
    DELETE FROM ProductVector
    DELETE FROM ShippingByProduct

    Add 'WHERE xxx' clauses to specify the products you want to remove, and of course make sure you backup the DB first.

  3. #3
    netprocity is offline Member
    Join Date
    Dec 2008
    Posts
    80

    Default Further Help

    Hi,

    Thanks for the response. I am sorry to ask such a dumb question, but I don't quite understand the exact code I am supposed to use as I am not familiar with SQL. You said to add the "where xxx". Can you give me an exact code snippet for the following?

    I have a product I want to delete with an product id of "2".

    Thanks so much for your help. Maybe this dumb question will help others Nuke products that don't have any SQL knowledge.

    Thanks
    James

  4. #4
    AspDotNetStorefront Staff - Scott's Avatar
    AspDotNetStorefront Staff - Scott is offline Administrator
    Join Date
    Mar 2007
    Location
    Ashland, OR
    Posts
    2,390

    Default

    Sure. If all you want to remove is ProductID 2, it would be:

    DELETE FROM Product WHERE ProductID=2
    DELETE FROM ProductAffiliate WHERE ProductID=2
    DELETE FROM ProductCategory WHERE ProductID=2
    DELETE FROM ProductCustomerLevel WHERE ProductID=2
    DELETE FROM ProductDistributor WHERE ProductID=2
    DELETE FROM ProductGenre WHERE ProductID=2
    DELETE FROM ProductLocaleSetting WHERE ProductID=2
    DELETE FROM ProductManufacturer WHERE ProductID=2
    DELETE FROM ProductSection WHERE ProductID=2
    DELETE FROM ProductVariant WHERE ProductID=2
    DELETE FROM ProductVector WHERE ProductID=2
    DELETE FROM ShippingByProduct WHERE ProductID=2

  5. #5
    netprocity is offline Member
    Join Date
    Dec 2008
    Posts
    80

    Default

    Hi.
    Thanks once again. And once again I am going to ask another dumb question. I went into the Advanced = Run SQL area of admin and put the exact code you recommended. It gave me back the following error:

    ERROR: Exception=Invalid column name 'ProductID'.

    What should I do?

    Thanks
    James

  6. #6
    AspDotNetStorefront Staff - Scott's Avatar
    AspDotNetStorefront Staff - Scott is offline Administrator
    Join Date
    Mar 2007
    Location
    Ashland, OR
    Posts
    2,390

    Default

    Just take off the last line (DELETE FROM ShippingByProduct WHERE ProductID=2), looks like that was changed to VariantID a while back. If you're actually using Shipping by Individual Product Costs you'll have to look up the product's variant ID and use this instead, but that's not used often:

    DELETE FROM ShippingByProduct WHERE VariantID=2