My first ZenCart tip

Finito!

And you’re done. Go to any product in your cart, and you will see a secondary products description field. Of course, *both* fields have the same title: “Product Description”. You can change that easily, but it’s not a big deal. For those of you that it *will* irritate to have both fields named the same thing, simple open up the “collect_info.php” file, and in that BIG section I had you copy (the one with the table cells), find this:

<td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>

and change it to this:

<td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION2; ?></td>

..and save the file. Then open up zencart/admin/includes/languages/english/product.php and do a search for “TEXT_PRODUCTS_DESCRIPTION”. When you find it, copy the line and paste a second one below it, and edit. So that this:

define('TEXT_PRODUCTS_DESCRIPTION', 'Products Description:');

Becomes this:

define('TEXT_PRODUCTS_DESCRIPTION', 'Products Description:');
// YOUR NAME HERE
define('TEXT_PRODUCTS_DESCRIPTION2', 'Secondary Products Description:');

Once you use this tip to add your second field, you’re preview is going to look a bit funky (meaning, the two descriptions will run into each other on the preview screen) - but it’s not a big deal because people aren’t going to see your preview screen. My preview screen never looks like what it’s going to on the site, anyway. But the information is there, and that’s what matters (if the secondary description doesn’t show up, then you’ve missed something.)

You may then style and code as needed.

A little disclaimer here - this method worked for me. I will stress the need to back up your files and your database, and never do experiments like this on a working store. Test it out first. This post is here for informational purposes only - you don’t have to do it. But doing it is your choice, and I can’t be held responsible if things get royally screwed!

So keep a backup. At least that way it’s fixable.

Now…I just need to edit the Easy Populate contribution so I can do the double descriptions through that route, rather than one-by-one in the admin panel. Than I’m golden!

Enjoy!


Page 1 2 3 4 5 6 7 8 9 10

Comments

Melvin says...
1

I can’t begin to tell you how wonderful this is. I’ve searched the Zen site over and over and nothing could touch what I needed. THANKS…. BUT…. The admin collect_info works, the preview_info works, but it’s not writing the input to the database. I opend php MyAdmin and verified the fields are correct. Also I verified the new records are writing to the database but the new fileds are blank. Additionally Both New records and Updated records are not writing to the new fields, AND I’m not getting any error messages. If I could beg your help, Can you point me to areas to look for possible mistakes or errors? I’m so close I can smell it…

Thanks a MILLION…

AdamN says...
2

You are a god(dess)! this has saved me so much hassle writing html code for mulitple descriptions in product listings/pages, the only change is Ive removed the original products description from the product page, so now my listings show a short info piece - the original product description section, and my product page just shows the secondary description - so much easier than writing class code into each description.

Many many thanks for the contrib.
Adam.

Trackbacks & Pingbacks

Leave a Reply