Page 1 of 3 123 LastLast
Results 1 to 10 of 21
  1. #1
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    Default Force update all products

    I need to add some default values to all products which I plan to do through MYSQL so all products have the same values for product descriptions.

    In order to pick up the values from the database, Zen Cart requires each product to be updated through the admin. There's alot of products so how would I force the admin to update all products at the same time rather than going through each one and clicking 'Preview' then 'Update'
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  2. #2
    Join Date
    Jul 2012
    Posts
    16,740
    Plugin Contributions
    17

    Default Re: Force update all products

    There is a SQL tool where you can enter your SQL to perform your desired action. In admin->tools->install sql patches.

    When entering your sql, refer to the table(s) without a prefix, ie. products not zen_products, and be sure to end your sql query with a semi-colon (;).

    Suggest backing up your database before doing any of this though...

    As for the above description, in one place identified the need to update the description, in another stated that all that was needed was to select preview then update. While the above explanation accomplishes the first part, it doesn't accomplish the second... Was that just information left off, or are you expecting an action that is normally performed upon moving through preview to update to also be performed?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    Default Re: Force update all products

    Quote Originally Posted by mc12345678 View Post
    or are you expecting an action that is normally performed upon moving through preview to update to also be performed?
    Yes I am expecting the update to be performed without the need to login and go through every product to update them one by one once fields have been updated in the database.
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  4. #4
    Join Date
    Jan 2004
    Posts
    66,380
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Force update all products

    Quote Originally Posted by Nick1973 View Post
    In order to pick up the values from the database, Zen Cart requires each product to be updated through the admin.
    Please explain more about this "requirement".

    The only such "requirement" I can think of is a recalculation of the cached values of products_price_sorter which contains the lowest available price based on applicable discounts. And you can force the recalculation of this via Admin->Tools->Store Manager.

    What other "requirements" are you saying need to be done?
    .

    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.

  5. #5
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    Default Re: Force update all products

    Ok, I have added some extra fields and I want to apply a default value to these in MYSQL. The fields in MYSQL update in the database, however they don't update in the admin or on the front end as I would need to click preview and then update for them to process.
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  6. #6
    Join Date
    Jan 2004
    Posts
    66,380
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Force update all products

    Quote Originally Posted by Nick1973 View Post
    Ok, I have added some extra fields and I want to apply a default value to these in MYSQL. The fields in MYSQL update in the database, however they don't update in the admin or on the front end as I would need to click preview and then update for them to process.
    Then, since only you know the unique custom updates required for those fields, perhaps it's best that you write the SQL queries that will auto-update those fields the same way you've coded the Preview/Update pages to update them.
    .

    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.

  7. #7
    Join Date
    Jul 2012
    Posts
    16,740
    Plugin Contributions
    17

    Default Re: Force update all products

    Quote Originally Posted by Nick1973 View Post
    Yes I am expecting the update to be performed without the need to login and go through every product to update them one by one once fields have been updated in the database.
    Well, see, there's a difference between running a sql to update the data and the actions that can be programmed into the evolution of preview to update. There are plugins that call additional code during this preview/update process which would not get activated when running a sql command. Therefore, if wanting action to be taken exactly related to the process performed by ZC during the review/update process then something else needs to be considered besides a sql command. This may now be a duplicate of DrBytes response, but I already wrote this, so submitting anyways.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #8
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    Default Re: Force update all products

    Your answer doesn't really help that much to be honest in this instance. Perhaps give me an idea of what I should write, that would be a starting point.
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  9. #9
    Join Date
    Jan 2004
    Posts
    66,380
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Force update all products

    Quote Originally Posted by mc12345678 View Post
    There are plugins that call additional code during this preview/update process
    Please elaborate. Which plugins? And what do they do?

    EDIT: mc12345678 ... sorry, I thought you were Nick1973 there.
    If there are actual plugins involved here, we need to know what they are.

    There's nothing in ZC currently that automatically simulates the whole preview/update process.

    There isn't enough info available about what the actual updates are that Nick1973 needs to fire on all records.


    Quote Originally Posted by Nick1973 View Post
    Your answer doesn't really help that much to be honest in this instance. Perhaps give me an idea of what I should write, that would be a starting point.
    I can't give you any useful help without knowing entirely how you've altered your site from original Zen Cart code. Maybe my crystal ball needs polishing?
    Last edited by DrByte; 15 Apr 2016 at 06:23 PM. Reason: hmmmm
    .

    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.

  10. #10
    Join Date
    Jan 2004
    Posts
    66,380
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Force update all products

    Is this whole discussion entirely related to your other discussion too? Strip HTML and WORD formatting
    Or is there more beyond that?
    .

    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.

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. Replies: 3
    Last Post: 13 Nov 2012, 02:26 PM
  2. v139h Update attributes for all products?
    By gotyed in forum General Questions
    Replies: 2
    Last Post: 5 Mar 2012, 06:22 PM
  3. Update all products via database?
    By rschultz in forum General Questions
    Replies: 4
    Last Post: 15 Aug 2011, 07:31 PM
  4. Update ALL Products Price Sorter
    By ctcentralinfo in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 3 Apr 2007, 02:17 AM
  5. How to update Quantity for all products?
    By doubletiger in forum General Questions
    Replies: 2
    Last Post: 6 Oct 2006, 10:05 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR