My first ZenCart tip
April 25, 2007collect_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:
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>
<td colspan="2"><table border="0" cellspacing="0" cellpadding="0"> <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>
And paste the entire section right beneath the part you just copied. Then edit it so it looks like so:
<?php // YOUR NAME HERE ?>
<tr>
<td class="main" valign="top"><?php if ($i == 0) echo TEXT_PRODUCTS_DESCRIPTION; ?></td>
<td colspan="2"><table border="0" cellspacing="0" cellpadding="0"> <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>
Save as previously described.









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