Forums / Setting Up Categories, Products, Attributes / Changing many descriptions at once

Changing many descriptions at once

Locked

Views: 530

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
24 Sep 2010, 4:24 PM
#1
cuddlingwolf avatar

cuddlingwolf

New Zenner

Join Date:
May 2010
Posts:
13
Plugin Contributions:
0

Changing many descriptions at once

I recently took over administration of a web site run on Zencart, which I am very familiar with.

The last genius who ran this site copy/pasted a section of text into every product description for about 1700 products, which included information that could change over time.

It has changed...

Now I need to replace a repeating block of text in 1700 product descriptions with the new block of text.

Please tell me I can do this somehow without manually editing every product. Maybe go into the database itself and do some sort of replace command in an editor?

24 Sep 2010, 4:39 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Changing many descriptions at once

BE SURE TO DO A FULL DATABASE BACKUP FIRST!!!!

SQL command could be:```
update products_description set products_description = REPLACE(products_description, 'from_str' , 'to_str');


I RECOMMEND TESTING ON A *TEST* DATABASE FIRST, and NOT on a live site.

.
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.

24 Sep 2010, 11:03 PM
#3
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,876
Plugin Contributions:
7

Re: Changing many descriptions at once

To re-use blocks of text in repeated product descriptions, you could set up boilerplate text as described here

http://www.thatsoftwareguy.com/zencart_php_in_description.html

It works very well.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...