My first ZenCart tip
collect_info.php
$parameters = array('products_name' => '',
'products_description' => '',
'products_url' => '',
Add a line right there (there’s a lot more to the array - I’m only showing you the important part!) so it looks like so:
// YOUR NAME HERE
$parameters = array('products_name' => '',
'products_description' => '',
'products_description2' => '',
'products_url' => '',
Next section:
if (isset($_GET['pID']) && empty($_POST)) {
$product = $db->Execute(”select pd.products_name, pd.products_description, pd.products_url,
Again, that’s a long string, and I’m only showing you the important part. Change that section so it reads:
// YOUR NAME HERE
if (isset($_GET['pID']) && empty($_POST)) {
$product = $db->Execute(”select pd.products_name, pd.products_description, pd.products_description2, pd.products_url,
Next section:
$pInfo->objectInfo($product->fields);
} elseif (zen_not_null($_POST)) {
$pInfo->objectInfo($_POST);
$products_name = $_POST['products_name'];
$products_description = $_POST['products_description'];
$products_url = $_POST['products_url'];
}
gets changed to:
// YOUR NAME HERE
$pInfo->objectInfo($product->fields);
} elseif (zen_not_null($_POST)) { // YOUR NAME HERE
$pInfo->objectInfo($_POST);
$products_name = $_POST['products_name'];
$products_description = $_POST['products_description'];
$products_description2 = $_POST['products_description2'];
$products_url = $_POST['products_url'];
}
Here’s another part where you need to copy an entire section. You want to copy this area:
And paste the entire section right beneath the part you just copied. Then edit it so it looks like so: Save as previously described. 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. <tr>
<td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>
<td colspan="2">
<tr>
<td class="main" width="25" valign="top"><?php echo zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . ‘/images/’ . $languages[$i]['image'], $languages[$i]['name']); ?> </td>
<td class=”main” width=”100%”>
<?php if ($_SESSION['html_editor_preference_status']==”FCKEDITOR”) {
$oFCKeditor = new FCKeditor(’products_description[' . $languages[$i]['id'] . ‘]’) ;
$oFCKeditor->Value = (isset($products_description[$languages[$i]['id']])) ? stripslashes($products_description[$languages[$i]['id']]) : zen_get_products_description($pInfo->products_id, $languages[$i]['id']) ;
$oFCKeditor->Width = ‘99%’ ;
$oFCKeditor->Height = ‘150′ ;
// $oFCKeditor->Config['ToolbarLocation'] = ‘Out:xToolbar’ ;
// $oFCKeditor->Create() ;
$output = $oFCKeditor->CreateHtml() ; echo $output;
} else { // using HTMLAREA or just raw “source”
echo zen_draw_textarea_field('products_description[' . $languages[$i]['id'] . ‘]’, ’soft’, ‘100%’, ‘30′, (isset($products_description[$languages[$i]['id']])) ? stripslashes($products_description[$languages[$i]['id']]) : zen_get_products_description($pInfo->products_id, $languages[$i]['id'])); //,’id=”‘.’products_description’ . $languages[$i]['id'] . ‘”‘);
} ?>
</td>
</tr>
</table>
</td>
</tr>
<?php // YOUR NAME HERE ?>
<tr>
<td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>
<td colspan="2">
<tr>
<td class="main" width="25" valign="top"><?php echo zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . ‘/images/’ . $languages[$i]['image'], $languages[$i]['name']); ?> </td>
<td class=”main” width=”100%”>
<?php if ($_SESSION['html_editor_preference_status']==”FCKEDITOR”) {
$oFCKeditor = new FCKeditor(’products_description2[' . $languages[$i]['id'] . ‘]’) ;
$oFCKeditor->Value = (isset($products_description2[$languages[$i]['id']])) ? stripslashes($products_description2[$languages[$i]['id']]) : zen_get_products_description2($pInfo->products_id, $languages[$i]['id']) ;
$oFCKeditor->Width = ‘99%’ ;
$oFCKeditor->Height = ‘150′ ;
// $oFCKeditor->Config['ToolbarLocation'] = ‘Out:xToolbar’ ;
// $oFCKeditor->Create() ;
$output = $oFCKeditor->CreateHtml() ; echo $output;
} else { // using HTMLAREA or just raw “source”
echo zen_draw_textarea_field('products_description2[' . $languages[$i]['id'] . ‘]’, ’soft’, ‘100%’, ‘30′, (isset($products_description2[$languages[$i]['id']])) ? stripslashes($products_description2[$languages[$i]['id']]) : zen_get_products_description2($pInfo->products_id, $languages[$i]['id'])); //,’id=”‘.’products_description2′ . $languages[$i]['id'] . ‘”‘);
} ?>
</td>
</tr>
</table>
</td>
</tr>
Comments
Adam.Trackbacks & Pingbacks



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…
Spoken on March 6th, 2008 at 1:05 pm