Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2009
    Posts
    414
    Plugin Contributions
    0

    Default Best way to remove product from database?

    I deleted products several times, and then the price was missing from the import. It was several days ago, and several deletions ago, so I cannot say for sure that the price was ever there.

    I deleted another set of products, which had the price showing and also the icon for the product showing, and now the price is there but the icon does not show.

    I tried Linda McGrath's suggestion in another post:

    Look at your database to see how many rows are in the tables:
    products
    products_description
    products_to_categories

    These should match ...

    If so, go to the Tools ... Store Manager ... and run, in order:
    Update master_categories_id
    Update products_price_sorter

    Now see if everything is set right ...

    Updating the master_categories_id will take the categories_id from the products_to_categories table and update all master_categories_id with that value ...

    Updating the products_price_sorter will update the field used for sorting prices when in the Catalog so that things sort correctly without having to do any calculations on the sort ...
    However, there was no change.

    This is a test site, and I can easily restore the backup and start fresh.

    I was just wondering if something as simple as copying prices into PHPMyAdmin could be done when the upload with Easy Populate does not place the products in the database.

    Or, does it really interrelate with a lot of tables when you delete something, so that if you delete products by deleting the subcateories, you run the risk of damaging the database and needing to restore it, so that maybe deleting products one-by-one is really the only safe method of deletion.

    One related question: My product numbers are getting to be very high even though I really do not have any products in my store yet; I am using test files. Is there a way to renumber the products?

    Thanks.

    Notageek

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Best way to remove product from database?

    Quote Originally Posted by notageek View Post
    Or, does it really interrelate with a lot of tables when you delete something, so that if you delete products by deleting the subcateories, you run the risk of damaging the database and needing to restore it
    Yes.
    Quote Originally Posted by notageek View Post
    One related question: My product numbers are getting to be very high even though I really do not have any products in my store yet; I am using test files. Is there a way to renumber the products?
    At a strictly technical level yes, but due to the interrelation of all the products across all tables, it's a very complicated procedure. You'd have to touch EVERY record in EVERY table that has a products_id column, as well as several other tables where products_id is stored in different column names perhaps combined with other data. And any addons that may store that data in different ways in custom tables might also create complications. So, in essence, the real answer is no.
    It would be better to wipe all products and start clean, adding/importing fresh.
    And, since this is a test shop, a fresh clean wipe of the entire database is probably your smartest move.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Mar 2009
    Posts
    414
    Plugin Contributions
    0

    Default Re: Best way to remove product from database?

    What I think happened in my case is that I was tinkering with the category names, and reloaded the same products once or twice or more for a few smaller tests, and the Zen Cart must have recognized the products as existing somewhere in the database and linked them, thereby triggering some sort of mechanism in the price structure.

    Can anyone corroborate that?

    Is there any explanation of why the pictures no longer show for some of the products in a second file I uploaded as a test?

    Notageek

  4. #4
    Join Date
    Mar 2009
    Posts
    414
    Plugin Contributions
    0

    Default Re: Best way to remove product from database?

    Well, it turns out my "backup" is using the same database as the test site, so they are identical. I should have made a separate database for the backup copy.

    So I would appreciate any comments on whether there is a way to rectify the situation where the price doesn't show, and in one case the column for price has actually disappeared.

    I'm suspecting I will have to start over from scratch.

    Thanks.

    Notageek

  5. #5
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Best way to remove product from database?

    Sounds like you've damaged your database significantly, either by making bad raw edits, or importing bad data somehow. Starting fresh would be the best course of action.

    And keeping full backup copies of the database by exporting the entire thing to a .sql file is always strongly recommended.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Mar 2009
    Posts
    414
    Plugin Contributions
    0

    Default Re: Best way to remove product from database?

    Dr. Byte,

    Thanks very much for your help.

    Notageek

  7. #7
    Join Date
    Mar 2009
    Posts
    414
    Plugin Contributions
    0

    Default Re: Best way to remove product from database?

    Dr. Byte,

    Because I was researching an error message in Easy Populate after uploading products, I was reading this post #2605 in the Easy Populate 1.2.4.5 thread:

    Quote:
    Originally Posted by NickPCs
    I just installed EasyPopulate on my new zencart and I am trying to upload a datafile to it. I get the following errors when I try to upload "An SQL error has occured. Please check your input data for tabs within fields and delete these. If this error continues, please forward your error log to the Easy Populate maintainer" I dont have an easypopulate errorlog in my Temp folder and I dont really know what to do, it said that the file itself may be causing the issue so I will post that as well. Any info would be a great help, thank you!
    What EP version are you using? The 1.2.5.6 CSV version?

    (I personally don't use these newer "csv" versions as they appear to be a bit buggy).

    Your v_products_price...

    $35.61
    $341.76
    $341.80
    $335.07
    $341.80
    $341.80
    $30.65
    $169.33
    $299.06
    $347.04


    You are including a $ symbol before the price. This column should just be the numeric value - NO currency symbol.
    ##############################___
    I never let my schooling interfere with my education - (Mark Twain).
    Well, the missing price problem was solved when I discovered I did indeed have the $ in my price column, which may have somehow been put there automatically by Excel 2007, because when I tried to work with the file in Open Office, I couldn't delete the $. I researched and found how to remove it (same method in both Excel and Open Office: select cells, right click, choose numeric format), and I was finally able to see a price again in my uploads.

    I still see the message after upload of products through Easy Populate telling me to check for extra tabs in fields, but I looked at my file and found none. I believe this has solved the missing price problem, which had carried over into my fresh install of Zen Cart. Maybe that message will go away soon.

    Your careful comment in this thread provided the magic key. Thank you for sharing your expertise.

    Notageek

  8. #8
    Join Date
    Mar 2009
    Posts
    414
    Plugin Contributions
    0

    Default Re: Best way to remove product from database?

    I am currently using Product - General to upload music CDs, because Easy Populate 1.2.5.4 does not upload the Product - Music type, and I prefer to go with 1.2.5.4 for reliability reasons.

    If I were to move products over to the Product - Music type later, by just creating a new product and copying the data into the new product, I am wondering what the correct sequence would be to do this.

    Given that I will be creating identical products, should I assume the cart will consider the new product type not in conflict with the other product so that I can just turn off the other product; or should I delete the general type product once I have it installed as a music type product?

    In the event I were to temporarily change over my Easy Populate version to a version that will populate the Product - Music type, just for this change-over operation, would I first need to delete the Product - General type products with the same model number before loading the files into the Product - Music type?

    Thanks for any comments.

 

 

Similar Threads

  1. best way to remove product price ?
    By pilot in forum Customization from the Admin
    Replies: 17
    Last Post: 4 Jun 2011, 05:04 AM
  2. what's the best way to access another database?
    By delia in forum Contribution-Writing Guidelines
    Replies: 1
    Last Post: 3 May 2010, 02:16 PM
  3. the best way to remove woz?
    By wagnerguy in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 22 Apr 2010, 09:48 PM
  4. How do I remove (Best Way) brackets?
    By 121webconsultancy in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 13 Oct 2008, 06:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg