Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Join Date
    Aug 2011
    Location
    UK
    Posts
    41
    Plugin Contributions
    0

    Default Bulk Edit Product Names & Descriptions

    Hi all, I'm using ZC 139h and need help with a sql script for updating several product titles and descriptions on mass.

    I sell pin badges, but am now able to make magnets too so need to update all my product titles to include the word "magnet". I have hundreds of products so cannot do this by hand.

    Example of current title "Retro Toy Badge - Care Bears" needs updating to "Retro Toy Badge/Magnet - Care Bears"

    I also need to bulk update all the descriptions, which are basically the same thing but with the title included in it.

    Example of current description "1980's Care Bear Cousins badge. Measures 45mm." needs updating to "1980's Care Bear Cousins badge or magnet. Measures 45mm."

    I've amended a sql script I found on this forum here http://www.zen-cart.com/showthread.p...g-an-SQL-Query, but it failed to work (simple stated "failed").

    I changed this (where the forum member wanted "Chord" replaced with "Cord":

    Code:
    UPDATE products_description
    SET products_name = REPLACE(products_name,'Cord','Chord')
    WHERE products_name like '%cord%'
    to this:

    Code:
    UPDATE products_description
    SET products_name = REPLACE(products_name,'Retro Toy Badge/Magnet -','Retro Toy Badge -')
    WHERE products_name like '%retro toy badge -%'
    I also exported my sql database and amended that, but it failed to import when using phpmyadmin (#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' CREATE TABLE `module_version_tracker` (`ID` int(10) NOT NULL AUTO_INCRE' at line 1 ))

    Can anybody help me a sql script for my two updates please? Either for use in Zen Cart or phpmyadmin.

    Thanks in advance for any help!
    Last edited by pinksparklegirl; 30 Sep 2012 at 03:32 PM. Reason: Spelling!

  2. #2
    Join Date
    Jan 2012
    Posts
    488
    Plugin Contributions
    0

    Default Re: Bulk Edit Product Names & Descriptions

    **** BACK UP YOUR DB BEFORE DOING ANYTHING ****


    This query works just fine for product titles:

    UPDATE products_description
    SET products_name = REPLACE(products_name,'EXISTING','NEW')
    WHERE products_name like '%CASEINSENSITIVE EXISTING%'


    And this works for changing the text within the description:

    UPDATE products_description
    SET products_description = REPLACE(products_description,'EXISTING','NEW')
    WHERE products_description like '%CASEINSENSITIVE EXISTING%'
    Last edited by Limitless; 30 Sep 2012 at 04:34 PM.

  3. #3
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Bulk Edit Product Names & Descriptions

    Code:
    Retro Toy Badge/Magnet - Care Bears
    Try replacing characters with html escape codes
    Zen-Venom Get Bitten

  4. #4
    Join Date
    Feb 2009
    Posts
    81
    Plugin Contributions
    0

    Default Re: Bulk Edit Product Names & Descriptions

    Quote Originally Posted by Limitless View Post

    This query works just fine for


    And this works for changing the text within the description:

    UPDATE products_description
    SET products_description = REPLACE(products_description,'EXISTING','NEW')
    WHERE products_description like '%CASEINSENSITIVE EXISTING%'
    so If I have html in my product description and I want to replace that part will I add the html code or just the text?
    , which I tried using the code above with html but the SQL patch replied with failed...

  5. #5
    Join Date
    Feb 2009
    Posts
    81
    Plugin Contributions
    0

    Default Re: Bulk Edit Product Names & Descriptions

    Zen Cart v1.5.1/v1.5.0


    what I mean is
    I want to edit this description

    you can read our client reviews here at
    <a href="https://www.etsy.com/shop/MGDezigns/reviews" target="_blank">Etsy </a> and here at <a href="http://www.################################/reviews/mgdezigns-custom-wedding-invitations-stationery-redwood-city/041a3e52a41c4763.html" target="_blank"> WeddingWire</a> <br /><br />

    and take out this part from the description above


    and here at <a href="http://www.################################/reviews/mgdezigns-custom-wedding-invitations-stationery-redwood-city/041a3e52a41c4763.html" target="_blank"> WeddingWire</a>

    I tried using code
    UPDATE products_description
    SET products_description = REPLACE(products_description,'you can read our client reviews here at
    <a href="https://www.etsy.com/shop/MGDezigns/reviews" target="_blank">Etsy </a> and here at <a href="http://www.################################/reviews/mgdezigns-custom-wedding-invitations-stationery-redwood-city/041a3e52a41c4763.html" target="_blank"> WeddingWire</a>','you can read our client reviews here at-
    <a href="https://www.etsy.com/shop/MGDezigns/reviews" target="_blank">Etsy </a>')
    WHERE products_description like '%you can read our client reviews here at
    <a href="https://www.etsy.com/shop/mgdezigns/reviews" target="_blank">etsy </a> and here at <a href="http://www.################################/reviews/mgdezigns-custom-wedding-invitations-stationery-redwood-city/041a3e52a41c4763.html" target="_blank"> weddingwire</a>%'

    but the SQL patch "Failed"


    any help is more than appreciated!
    Thanks
    Maria

  6. #6
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Bulk Edit Product Names & Descriptions

    Quote Originally Posted by maria82g View Post
    Zen Cart v1.5.1/v1.5.0


    what I mean is
    I want to edit this description

    you can read our client reviews here at
    <a href="https://www.etsy.com/shop/MGDezigns/reviews" target="_blank">Etsy </a> and here at <a href="http://www.################################/reviews/mgdezigns-custom-wedding-invitations-stationery-redwood-city/041a3e52a41c4763.html" target="_blank"> WeddingWire</a> <br /><br />

    and take out this part from the description above


    and here at <a href="http://www.################################/reviews/mgdezigns-custom-wedding-invitations-stationery-redwood-city/041a3e52a41c4763.html" target="_blank"> WeddingWire</a>

    I tried using code
    UPDATE products_description
    SET products_description = REPLACE(products_description,'you can read our client reviews here at
    <a href="https://www.etsy.com/shop/MGDezigns/reviews" target="_blank">Etsy </a> and here at <a href="http://www.################################/reviews/mgdezigns-custom-wedding-invitations-stationery-redwood-city/041a3e52a41c4763.html" target="_blank"> WeddingWire</a>','you can read our client reviews here at-
    <a href="https://www.etsy.com/shop/MGDezigns/reviews" target="_blank">Etsy </a>')
    WHERE products_description like '%you can read our client reviews here at
    <a href="https://www.etsy.com/shop/mgdezigns/reviews" target="_blank">etsy </a> and here at <a href="http://www.################################/reviews/mgdezigns-custom-wedding-invitations-stationery-redwood-city/041a3e52a41c4763.html" target="_blank"> weddingwire</a>%'

    but the SQL patch "Failed"


    any help is more than appreciated!
    Thanks
    Maria
    Unfortunately "Failed" does not provide enough information to diagnose the specific issue that is identified on your system. Please either provide the specific error message, or if the query was run from within the ZC admin Install SQL patches section, an error log should have been generated in the cache directory if in fact you are still using ZC 1.3.9h... otherwise In the logs directory for ZC 1.5.1 and above. Look for myDebugxxxx related files.. If it is an admin myDebug (which is expected) do not post your admin directory as part of the information (Replace with something else).
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Feb 2009
    Posts
    81
    Plugin Contributions
    0

    Default Re: Bulk Edit Product Names & Descriptions

    Quote Originally Posted by mc12345678 View Post
    Unfortunately "Failed" does not provide enough information to diagnose the specific issue that is identified on your system. Please either provide the specific error message, or if the query was run from within the ZC admin Install SQL patches section, an error log should have been generated in the cache directory if in fact you are still using ZC 1.3.9h... otherwise In the logs directory for ZC 1.5.1 and above. Look for myDebugxxxx related files.. If it is an admin myDebug (which is expected) do not post your admin directory as part of the information (Replace with something else).
    Hi Thanks for responding, it was not in admin folder
    but in the directory root of zencart all 3 files, have same text must be because of the three times I attempted sql patch
    this is what it says

    [04-Mar-2015 15:11:03 UTC] PHP Parse error: syntax error, unexpected '}' in /hermes/bosnaweb10a/b1526/ipg.sitecom/mydirectory/includes/functions/sessions.php on line 16

  8. #8
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Bulk Edit Product Names & Descriptions

    That's actually not directly related to this issue, but trying the sql may have illuminated or helped discover an issue.

    Before suggesting how to correct that one, what php version is your store on and what are your plans for upgrading?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    Feb 2009
    Posts
    81
    Plugin Contributions
    0

    Default Re: Bulk Edit Product Names & Descriptions

    MySQL Version 5.5.32
    Perl Version 5.8.8
    PHP Version 5.3

    No plans of upgrading PHP

  10. #10
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Bulk Edit Product Names & Descriptions

    Quote Originally Posted by maria82g View Post
    MySQL Version 5.5.32
    Perl Version 5.8.8
    PHP Version 5.3

    No plans of upgrading PHP
    Sorry, should have been clearer on the question, what plans do you have for upgrading zc? I know that using php 5.4 with zc 1.3.9 causes issues, but at the moment not sure about the version currently used.

    So it seems like either the sessions.php file has been modified, or in "putting together" the php code to present the page, something had/has an additional right curly bracket } that causes one of them in the sessions file to "close" the file prematurely. Tracking that down could be "fun", but not impossible.

    Perhaps could try a very generic SQL statement and see if the same type of error occurs?
    Code:
    select * from products;
    There is no "result" expected, but hopefully no failure either. Double check the logs at that point.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Is it possible to bulk edit product categories?
    By annav in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 13 Mar 2013, 02:57 PM
  2. Product Qty Maximum Bulk Edit
    By townsend2009 in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 22 Sep 2011, 09:54 PM
  3. Editing Product Names & Descriptions
    By timmah70 in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 20 Jul 2011, 02:43 AM
  4. Replies: 13
    Last Post: 29 Aug 2010, 05:59 PM
  5. suddenly can't edit product descriptions!
    By p m in forum General Questions
    Replies: 3
    Last Post: 23 Oct 2006, 03:02 AM

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