My first ZenCart tip
April 25, 2007general.php
Do a search for “zen_get_products_description”. You will be taken to an area that says:
function zen_get_products_description($product_id, $language_id) {
global $db;
$product = $db->Execute("select products_description
from " . TABLE_PRODUCTS_DESCRIPTION . "
where products_id = '" . (int)$product_id . "'
and language_id = '" . (int)$language_id . "'");
return $product->fields['products_description'];
}
Copy this entire section, and paste the section directly beneath it. Edit the new section so it looks like so:
// YOUR NAME HERE
function zen_get_products_description2($product_id, $language_id) {
global $db;
$product = $db->Execute("select products_description2
from " . TABLE_PRODUCTS_DESCRIPTION . "
where products_id = '" . (int)$product_id . "'
and language_id = '" . (int)$language_id . "'");
return $product->fields['products_description2'];
}
Save the file, appended with “NEW” (so, “generalNEW.php”). Then you want to save the file *again* as the original filename (“general.php”).
Why do I have you do this? Because if you make this change, and it works for you, that’s great. But if you ever upgrade your ZenCart installation, then the upgrade will overwrite these file changes, and you’ll lose everything. By keeping the files as “NEW”, they will remain untouched – so if you upgrade, right there is the stuff you need. Plus, you can keep track of where things are.









P.O. Box 46
Sorry, comments are now closed on this post. You may thank the spammers for that one. But if you have any questions, please feel free to email me and ask - maybe it'll make for a good update in a future post. :)