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

    Default Re: Force update all products

    I'll try and make this simple so you don't have to bother polishing your crystal ball Mr Byte! Hopefully I can save you and your duster a job.

    I've added four simple text fields

    text1

    text2

    text3

    text4

    They are all added into the table 'products' in the database and show up as empty fields in the Zen Cart admin on the product information page.

    Each field should have a default value, however as they are new fields the default value does not show up on the front end or in the admin panel.
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

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

    Default Re: Force update all products

    No its nothing to do with stripping html tags, that is independent.
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  3. #13
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Force update all products

    Quote Originally Posted by Nick1973 View Post
    I've added four simple text fields

    text1

    text2

    text3

    text4

    They are all added into the table 'products' in the database and show up as empty fields in the Zen Cart admin on the product information page.

    Each field should have a default value, however as they are new fields the default value does not show up on the front end or in the admin panel.
    Okay. How does using the Preview/Update page in the admin set a value into those fields? How is that value calculated/determined in your site?

    And why can't you run a simple SQL query to set those fields the same way?
    ie:
    Code:
    update products set text1='default1', text2='default2', text3='default3', text4='default4' where text1='';
    or for more detailed control:
    Code:
    update products set text1='value1' where text1='';
    update products set text2='value2' where text2='';
    update products set text3='value3' where text3='';
    update products set text4='value4' where text4='';
    Or is there a calculation performed? If so, what?
    .

    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.

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

    Default Re: Force update all products

    It is just plain text, not a calculation. The default value should automatically show in each field in the admin and on the front end, without having to go through every product and trigger an update to each individual product.
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  5. #15
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Force update all products

    Quote Originally Posted by Nick1973 View Post
    It is just plain text, not a calculation. The default value should automatically show in each field in the admin and on the front end, without having to go through every product and trigger an update to each individual product.
    Okay, then the 2nd SQL I posted above should take care of fixing all the records you've already inserted (or which are blank because of how you added the fields to the database without specifying a default).

    And you could change the default value on those fields, in the database schema itself, to something other than blank, so that new records you inject from an external source automatically get that defined default.

    Or, you could experiment with the Easy Populate plugin that mc12345678 has been updating and maintaining recently, to do all this editing in a spreadsheet which you can upload to replace the data in your database, periodically as necessary.
    .

    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. #16
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,227
    Plugin Contributions
    6

    Default Re: Force update all products

    So are you saying that if I specify a default when creating the fields in the database, then it will cause Zen Cart to automatically see the default? If so then the easier option would be just to recreate the fields with the default.
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

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

    Default Re: Force update all products

    Somewhat following up in the rear with this, it is possible to add a default value for new input when using the ZC standard product entry. That said, it may have already been added, seeing that 1) question related to it hasn't been asked, and 2) such a process (edit and update each product) appears possible at this time.

    Yes, EP4 could be used to modify product table entries.

    In regards to a plugin that does "require" stepping through the preview/update process, CEON URI Mapping does make modifications as well as Numinix additional fields to name a few... though Numinix's fields are basically additional products table fields, but one could always add some sort of processing function to the code instead of perhaps AJAX to accomodate whatever concept.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

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

    Default Re: Force update all products

    I tried Numinix Products Fields, but while I have used it on other installs, I'm not entirely sure why, but it wouldn't see the fields so I decided to create the fields myself manually which was in fact alot easier in this case anyway.
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

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

    Default Re: Force update all products

    Quote Originally Posted by Nick1973 View Post
    So are you saying that if I specify a default when creating the fields in the database, then it will cause Zen Cart to automatically see the default? If so then the easier option would be just to recreate the fields with the default.
    Yes .
    .

    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. #20
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Force update all products

    Quote Originally Posted by mc12345678 View Post
    In regards to a plugin that does "require" stepping through the preview/update process, CEON URI Mapping does make modifications
    Yes. Those are brutally intrusive, and a mess to recreate the way Nick1973 is asking here. Thankfully he hasn't mentioned that. That would require writing a bunch of custom scripts to do it ... something the CEON URI mod doesn't provide, but they're happy to charge extra for if you can find someone there to respond anymore now that Conor's family has taken it over.
    .

    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 2 of 3 FirstFirst 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