Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / Can I add a line of text to all products at once?

Can I add a line of text to all products at once?

6 Feb 2012, 2:55 AM
#1
jcrewe avatar

jcrewe

Zen Follower

Join Date:
Jul 2011
Posts:
107
Plugin Contributions:
0

Post #1 by jcrewe

Hi there!

Just wondering if anyone knows if I can add a line of text in the product description of all of my products at once and, if so, how do I accomplish this? I have over 300 products so if I was to have to add the new text to each product individually it will take me forever.

Thanks in advance :smile:

Jennifer

6 Feb 2012, 12:47 PM
#2
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Post #2 by rodg

jcrewe:

Hi there!

Just wondering if anyone knows if I can add a line of text in the product description of all of my products at once and, if so, how do I accomplish this? I have over 300 products so if I was to have to add the new text to each product individually it will take me forever.

Thanks in advance :smile:

Jennifer

This is 'off the top of my head' so the syntax may not be 100% correct.

UPDATE `products_description` SET `products_description`= CONCAT(`products_description`, " New Text") WHERE 1 ;
```To use this code you'll need to be using a tool such as phpmyadmin. First select your zencart products_description database table, then click the 'SQL' button and paste the code. 
Change " New Text" to whatever you desire, then click the 'Go' button. 

WARNING: There is no going back after pressing 'Go'.  You'll either be greeted with some kind of error, or the upgrade will be almost instant.   Like all database upgrades it will be prudent to make a copy of the database table *before* invoking this code.  

Cheers
Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

6 Feb 2012, 2:38 PM
#3
digiwinkel avatar

digiwinkel

New Zenner

Join Date:
Jul 2010
Location:
Velsen-Zuid
Posts:
33
Plugin Contributions:
0

Post #3 by digiwinkel

Open includes/templates/YOUR_TEMPLATE/templates and find product_info_display.php

You can add HTML nearly anywhere before the <!--bof--> en after the <!--eof--> lines:

Example:

Your HTML

<!--bof Category Icon --> <?php if ($module_show_categories != 0) {?> <?php /** * display the category icons */ require($template->get_template_dir('/tpl_modules_category_icon_display.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_category_icon_display.php'); ?> <?php } ?> <!--eof Category Icon -->

More HTML etc. etc...

6 Feb 2012, 3:39 PM
#4
jcrewe avatar

jcrewe

Zen Follower

Join Date:
Jul 2011
Posts:
107
Plugin Contributions:
0

Post #4 by jcrewe

Thank you RodG and Digiwinkel for your replies. RodG, I havent tried your suggestion yet because I am more comfortable working with HTML than I am with editing my database.

Digiwinkel, I tried your suggestion and it worked great! I am wondering, though, if I am able to delete this from a handful of products that it doesnt apply to? I know my original post stated that I wanted to apply it to all of the products but I was thinking that there would be a way to actually add to the product description in bulk and then just remove the newly added text individually from the few products it doesnt apply to as removing the newly added text from the few products it doesnt apply to would be a lot quicker than adding to all the products it does apply to.

I hope that makes sense :smile:

6 Feb 2012, 3:54 PM
#5
digiwinkel avatar

digiwinkel

New Zenner

Join Date:
Jul 2010
Location:
Velsen-Zuid
Posts:
33
Plugin Contributions:
0

Post #5 by digiwinkel

Editing Product_info_display will show your changes on any product in your cart :-)

If you want to add bulk HTML to more or most products Try Easypopulate CSV.

That way you can use Excel to add the HTML to the various product descriptions to selected products in Excel (product)rows.

Remember to Back-up your Dbase before making changes to it whatsoever!

:smile:

7 Feb 2012, 4:56 AM
#6
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Post #6 by rodg

jcrewe:

I know my original post stated that I wanted to apply it to all of the products but I was thinking that there would be a way to actually add to the product description in bulk and then just remove the newly added text individually from the few products it doesnt apply to as removing the newly added text from the few products it doesnt apply to would be a lot quicker than adding to all the products it does apply to.

I hope that makes sense :smile:

Question. Exactly is it what you want to change? If it is the products pages then Digiwinkels solution is what you need.

If you wish to change the products descriptions then you'll need the SQL solution to change the descriptions in the database.

Cheers
Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

7 Feb 2012, 5:20 AM
#7
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,764
Plugin Contributions:
0

Post #7 by Kim

Maybe check the Free Addons for the Boilerplate mod. I haven't used it but it might do what you want.

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

7 Feb 2012, 7:08 AM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #8 by gjh42

Actually, there is not a boilerplate mod in Free Addons yet. You can use swguy's boilerplate tips given on his website, or the Extra Boilerplate mod currently posted in How to Add Content Below category listings?

These do require there to be an HTML comment in the description as a hook to replace or key in the new text.

17 Mar 2015, 3:48 PM
#9
maria82g avatar

maria82g

New Zenner

Join Date:
Feb 2009
Posts:
81
Plugin Contributions:
0

Post #9 by maria82g

RodG:

If you wish to change the products descriptions then you'll need the SQL solution to change the descriptions in the database.

Cheers
Rod

THE SQL says ```
SELECT * FROM products_description WHERE 1

so if I want to remove a few lines from the description what do I change and where?