[eng] More than one description box in 'add product'

hex

No avatar

2005-10-14 18:52

Witam,
Could anyone tell me how to add more than a one description box in add product page? there is a short description and a full description, i want to divide full description on a number of part_full descriptions and puta a static image (on products_show) between them. Could you tell me how to define more [xdescription] and add them to a product_form, products.html?
thanks in advance.

chcialbym dodac wiecej niz jedno pole pelnego opisu, to jest tego wyswietlanego na stronie z produktem, chcialbym je podzielic na kilka mniejszych w add product i oddzielic pozniej statycznymi obrazkami )o stalych adresach) w product_show.tpl.

nie wiem tylko jak zdefiniowac kolejne zmienne tak by pojawialy sie kolejne pola takie jak [fulldescription] i [shortdescription] i byly zapisywane tak jak te wlasnie i mozliwe do wykorzystania w product_show.tpl.

z gory dziekuje za pomoc

pozdrawiam,
hex

hex

No avatar

2005-10-14 18:54

i mean product.php and product_form.tpl files

Bug

No avatar

2005-10-14 19:00

edit the products files in core!

products.php
pdor..admin.php
prod..ff.php

there are line for all optiona wich are in admin product_form.tpl template
add as mach extra lines you want after edit the template add new fields for whis lines. remember to put the names right in tpl as in php.. look this files how it is there now wrotten..
:D

hex

No avatar

2005-10-14 19:11

could you give me a sample of new box, what to add and in which files?


regards,
hex

hex

No avatar

2005-10-14 19:25

i cant fix it out. i have added lines to those three files mentioned by you, but
i keep getting 1 instead of what i typed in adding product.

while editing it i've got '1', and no, one is not what i typed while inserting descriptions to add product form.

could anyone provide me with sample changes to alle the files i need to edit?
please, pretty please :)

hex

No avatar

2005-10-15 10:28

could anyone help me?

hex

No avatar

2005-10-15 11:06

i guess that i put it in a wrong order, so it keeps displaying status variable in my next input box on add page

hex

No avatar

2005-10-15 11:22

i checked the db file products.php, and my entry (the text from created input box is not there) so there should be more that i should change
modified files looks like this:

prodcts.php //core:
======================================
<?php
if( !function_exists( 'listProducts' ) ){
/**
* Wyswietlanie spisu produktow
* @return string
* @param string $sFile
* @param string $sOption
*/
function listProducts( $sFile = 'products_list.tpl', $sOption = 'list' ){

if( !isset( $_GET['page'] ) || !is_numeric( $_GET['page'] ) || $_GET['page'] < 1 )
$_GET['page'] = 1;

if( isset( $_SESSION['iUserQC'] ) )
$iStatus = 0;
else
$iStatus = 1;

if( $sOption == 'category' ){
$aData = dbListProductsCategory( $iStatus, $_GET['iCategory'] );
$sPage = $_GET['p'].'&amp;iCategory='.$_GET['iCategory'];
}
elseif( $sOption == 'search' ){
$aData = dbListProductsSearch( $iStatus, trim( $_GET['sWord'] ) );
$sPage = $_GET['p'].'&amp;sWord='.$_GET['sWord'];
}
else{
$aData = dbListProducts( $iStatus );
$sPage = $_GET['p'];
}

if( isset( $aData ) && is_array( $aData ) )
$content = throwProductsData( $sFile, $aData, $sPage );
else
$content = $GLOBALS['tpl']->tbHtml( $sFile, 'NOT_FOUND' );

return $content;
} // end function listProducts
}

if( !function_exists( 'throwProductsData' ) ){
/**
* Wyswietlanie produktow z podanej juz tablicy
* @return string
* @param string $sFile
* @param array $aData
* @param string $sPage
*/
function throwProductsData( $sFile, $aData, $sPage ){
global $tpl, $aProducts, $oFoto;

$aFoto = throwFirstPhoto( 1 );
$iCount = count( $aData );
$content = null;
$aCategories = throwCategories( );

for( $i = 0; $i < $iCount; $i++ ){
list( $aProducts['position'], $aProducts['name'], $aProducts['id'], $aProducts['category'], $aProducts['price'], $aProducts['shortDescription'], $aProducts['fullDescription'], $aProducts['status'], $aProducts['fullDescription2'] ) = $aData[$i];

if( isset( $aFoto[$aProducts['id']] ) && is_file( DIR_PRODUCTS_FILES.$aFoto[$aProducts['id']]['foto'] ) ){
$aName = $oFoto->throwNameExtOfFile( $aFoto[$aProducts['id']]['foto'] );
$aProducts['file'] = $aFoto[$aProducts['id']]['foto'];
$aProducts['fotoSmall'] = DIR_PRODUCTS_FILES.$aName[0].'_m.'.$aName[1];
$aProducts['fotoBig'] = DIR_PRODUCTS_FILES.$aFoto[$aProducts['id']]['foto'];
$aProducts['foto'] = $tpl->tbHtml( $sFile, 'FOTO' );
}
else
$aProducts['foto'] = '&nbsp;';

if( empty( $aProducts['shortDescription'] ) )
$aProducts['shortDescription'] = '&nbsp;';
if( empty( $aProducts['fullDescription'] ) )
$aProducts['fullDescription'] = '&nbsp;';
if( empty( $aProducts['fullDescription2'] ) )
$aProducts['fullDescription2'] = '&nbsp;';


if( isset( $aCategories[$aProducts['category']] ) )
$aProducts['sCategory'] = $aCategories[$aProducts['category']];

$aProducts['basketLink'] = ( function_exists('productHasAttributes') && productHasAttributes($aProducts['id']) ) ? '?p=productsMore&amp;iProduct='.$aProducts['id'] : '?p=ordersBasket&amp;sOption=add&amp;iProduct='.$aProducts['id'].'&a mp;amp;iQuantity=1' ;
$content .= $tpl->tbHtml( $sFile, 'LIST_LIST' );

} // end for

$aProducts['pages'] = countPages( $aData[0]['iFindAll'], PRODUCTS_LIST, $_GET['page'], $sPage );
return $tpl->tbHtml( $sFile, 'LIST_HEAD' ).$content.$tpl->tbHtml( $sFile, 'LIST_FOOTER' );
} // end function throwProductsData
}

if( !function_exists( 'throwProduct' ) ){
/**
* Zwracanie danych
* @return array
* @param int $iProduct
*/
function throwProduct( $iProduct ){
global $oFoto;

if( isset( $_SESSION['iUserQC'] ) )
$iStatus = 0;
else
$iStatus = 1;

$aData = dbThrowProduct( $iProduct, $iStatus );

if( isset( $aData ) ){
$aCategories = throwCategories( );

list( $aProduct['position'], $aProduct['name'], $aProduct['id'], $aProduct['category'], $aProduct['price'], $aProduct['shortDescription'], $aProduct['fullDescription'], $aProduct['status'], $aProduct['fullDescription2'], ) = $aData ;

if( isset( $aCategories[$aProduct['category']] ) ){
$iParentCategory = throwCategoriesParentId( $aProduct['category'] );
$aProduct['sCategory'] = $aCategories[$aProduct['category']];

if( $iParentCategory != $aProduct['category'] ){
$aProduct['sCategory'] = $aCategories[$iParentCategory].' - '.$aProduct['sCategory'];
}
}
else{
$aProduct['sCategory'] = '&nbsp;';
}

return $aProduct;
}
else
return null;
} // end function throwProduct
}

if( !function_exists( 'throwProducts' ) ){
/**
* Zwracanie produktow w tablicy
* @return array
*/
function throwProducts( ){
return dbThrowProducts( );
} // end function throwProducts
}
?>
============================
products_admin.php /core
============================
<?php
if( !function_exists( 'addProduct' ) ){
/**
* Dodawanie produktu
* @return void
* @param array $aForm
*/
function addProduct( $aForm ){
$aForm['iProduct'] = throwLastId( ) + 1;

if( checkLength( $aForm['sShortDescription'], 1 ) )
$aForm['sShortDescription'] = changeTxt( $aForm['sShortDescription'], 'Br' );
if( checkLength( $aForm['sFullDescription'], 1 ) )
$aForm['sFullDescription'] = changeTxt( $aForm['sFullDescription'], 'Br' );
if( checkLength( $aForm['sFullDescription2'], 1 ) )
$aForm['sFullDescription'] = changeTxt( $aForm['sFullDescription2'], 'Br' );
if( empty( $aForm['iPosition'] ) || !is_numeric( $aForm['iPosition'] ) )
$aForm['iPosition'] = 9;

$aForm['sName'] = changeTxt( $aForm['sName'] );
$aForm['fPrice'] = ereg_replace( ',', '.', $aForm['fPrice'] );
$aForm['fPrice'] = tPrice( $aForm['fPrice'] );

addFiles( $aForm, $aForm['iProduct'], PRODUCTS_FOTO_SIZE, 1 );
dbAddProduct( $aForm );

} // end function addProduct
}

if( !function_exists( 'changeProduct' ) ){
/**
* Zmiana danych produktu
* @return void
* @param array $aForm
*/
function changeProduct( $aForm ){

if( isset( $aForm['aFileDescriptionChange'] ) && is_array( $aForm['aFileDescriptionChange'] ) ){
foreach( $aForm['aFileDescriptionChange'] as $iKey => $sValue ){
dbChangeFileDescription( Array( $iKey, $aForm['iProduct'], $aForm['aFileNameChange'][$iKey], changeTxt( ereg_replace( '\'', '', $sValue ) ), $aForm['aFileType'][$iKey] ), 1 );
}
}

if( isset( $aForm['aDelFile'] ) && is_array( $aForm['aDelFile'] ) ){
$iCount = count( $aForm['aDelFile'] );
for( $i = 0; $i < $iCount; $i++ )
delFile( $aForm['aDelFile'][$i], 1 );
}

if( checkLength( $aForm['sShortDescription'], 1 ) )
$aForm['sShortDescription'] = changeTxt( $aForm['sShortDescription'], 'Br' );
if( checkLength( $aForm['sFullDescription'], 1 ) )
$aForm['sFullDescription'] = changeTxt( $aForm['sFullDescription'], 'Br' );
if( checkLength( $aForm['sFullDescription2'], 1 ) )
$aForm['sFullDescription'] = changeTxt( $aForm['sFullDescription2'], 'Br' );
if( empty( $aForm['iPosition'] ) || !is_numeric( $aForm['iPosition'] ) )
$aForm['iPosition'] = 9;

$aForm['sName'] = changeTxt( $aForm['sName'] );
$aForm['fPrice'] = ereg_replace( ',', '.', $aForm['fPrice'] );
$aForm['fPrice'] = tPrice( $aForm['fPrice'] );

addFiles( $aForm, $aForm['iProduct'], PRODUCTS_FOTO_SIZE, 1 );
dbChangeProduct( $aForm );
} // end function changeProduct
}

if( !function_exists( 'delProduct' ) ){
/**
* Usuwanie produktu
* @return void
* @param int $iProduct
*/
function delProduct( $iProduct ){
delFiles( $iProduct, 1 );
dbDelProduct( $iProduct );
} // end function delProduct
}
?>
============================
products_ff.php /core
============================
<?php
if( !function_exists( 'dbListProducts' ) ){
/**
* Pobieranie z bazy produktow
* @return array
* @param int $iStatus
*/
function dbListProducts( $iStatus ){

$aFile = file( DIR_DB.DB_PRODUCTS );
$iCount = count( $aFile );
$iFindPage = 0;
$iFindAll = 0;
sort( $aFile );

for( $i = 1; $i < $iCount; $i++ ){
$aExp = explode( '$', $aFile[$i] );
if( $aExp[7] >= $iStatus ){
$iFindPage++;
$iFindAll++;

if( $iFindPage == 1 )
$aPageStart[] = $i;

if( isset( $aPageStart[$_GET['page'] - 1] ) && !isset( $aPageEnd[$_GET['page'] - 1] ) ){
$aData[] = $aExp;
}

if( $iFindPage == PRODUCTS_LIST ){
$aPageEnd[] = $i;
$iFindPage = 0;
}
}
} // end for

if( isset( $aData ) ){
$aData[0]['iFindAll'] = $iFindAll;
return $aData;
}
else
return null;
} // end function dbListProducts
}

if( !function_exists( 'dbListProductsSearch' ) ){
/**
* Pobieranie z bazy produktow z wyszukiwanym slowem
* @return array
* @param int $iStatus
* @param string $sWord
*/
function dbListProductsSearch( $iStatus, $sWord ){

$aFile = file( DIR_DB.DB_PRODUCTS );
$iCount = count( $aFile );
$iFindPage = 0;
$iFindAll = 0;
sort( $aFile );

for( $i = 1; $i < $iCount; $i++ ){
$aExp = explode( '$', $aFile[$i] );
if( $aExp[7] >= $iStatus && eregi( $sWord, $aFile[$i] ) ){
$iFindPage++;
$iFindAll++;

if( $iFindPage == 1 )
$aPageStart[] = $i;

if( isset( $aPageStart[$_GET['page'] - 1] ) && !isset( $aPageEnd[$_GET['page'] - 1] ) ){
$aData[] = $aExp;
}

if( $iFindPage == PRODUCTS_LIST ){
$aPageEnd[] = $i;
$iFindPage = 0;
}
}
} // end for

if( isset( $aData ) ){
$aData[0]['iFindAll'] = $iFindAll;
return $aData;
}
else
return null;
} // end function dbListProductsSearch
}

if( !function_exists( 'dbListProductsCategory' ) ){
/**
* Pobieranie z bazy produktow danej kategorii
* @return array
* @param int $iStatus
* @param int $iCategory
*/
function dbListProductsCategory( $iStatus, $iCategory ){

$aFile = file( DIR_DB.DB_PRODUCTS );
$iCount = count( $aFile );
$iFindPage = 0;
$iFindAll = 0;
$aCategories= throwCategoriesTree( $iCategory );
sort( $aFile );

for( $i = 1; $i < $iCount; $i++ ){
$aExp = explode( '$', $aFile[$i] );

if( $aExp[7] >= $iStatus && in_array( $aExp[3], $aCategories ) === true ){
$iFindPage++;
$iFindAll++;

if( $iFindPage == 1 )
$aPageStart[] = $i;

if( isset( $aPageStart[$_GET['page'] - 1] ) && !isset( $aPageEnd[$_GET['page'] - 1] ) ){
$aData[] = $aExp;
}

if( $iFindPage == PRODUCTS_LIST ){
$aPageEnd[] = $i;
$iFindPage = 0;
}
}
} // end for

if( isset( $aData ) ){
$aData[0]['iFindAll'] = $iFindAll;
return $aData;
}
else
return null;
} // end function dbListProductsCategory
}

if( !function_exists( 'dbThrowProduct' ) ){
/**
* Zwracanie danych produktu
* @return array
* @param int $iProduct
* @param int $iStatus
*/
function dbThrowProduct( $iProduct, $iStatus ){
$aFile = file( DIR_DB.DB_PRODUCTS );
$iCount = count( $aFile );

for( $i = 1; $i < $iCount; $i++ ){
$aExp = explode( '$', $aFile[$i] );
if( $aExp[2] == $iProduct && $aExp[7] >= $iStatus ){
return $aExp;
}
} // end for

return null;
} // end function dbThrowProduct
}

if( !function_exists( 'dbThrowProducts' ) ){
/**
* Zwracanie produktow w tablicy
* @return array
*/
function dbThrowProducts( ){
return $GLOBALS['oFF']->throwFileArraySmall( DIR_DB.DB_PRODUCTS, null, 2, 1 );
} // end function dbThrowProducts
}

if( !function_exists( 'dbAddProduct' ) ){
/**
* Dodawanie danych do pliku
* @return void
* @param array $aForm
*/
function dbAddProduct( $aForm ){
global $oFF;
extract( $aForm );
$oFF->setRow( Array( sprintf( '%02.0f', $iPosition ), $sName, $iProduct, $iCategory, $fPrice, $sShortDescription, $sFullDescription, $iStatus, $sFullDescription2 ) );
$oFF->addToFile( DIR_DB.DB_PRODUCTS );
} // end function dbAddProduct
}

if( !function_exists( 'dbChangeProduct' ) ){
/**
* Zmienianie danych produktu
* @return void
* @param array $aForm
*/
function dbChangeProduct( $aForm ){
global $oFF;
extract( $aForm );
$oFF->setRow( Array( sprintf( '%02.0f', $iPosition ), $sName, $iProduct, $iCategory, $fPrice, $sShortDescription, $sFullDescription, $iStatus, $sFullDescription ) );
$oFF->changeInFile( DIR_DB.DB_PRODUCTS, $iProduct, 2 );
} // end function dbChangeProduct
}

if( !function_exists( 'dbDelProduct' ) ){
/**
* Usuwanie danych produktu
* @return void
* @param int $iProduct
*/
function dbDelProduct( $iProduct ){
$GLOBALS['oFF']->deleteInFile( DIR_DB.DB_PRODUCTS, $iProduct, 2 );
} // end function dbDelProduct
}
?>
================================
and in actions admin dict:
products.php
================================
<?php
include DIR_CORE.'files-'.$config['db_type'].'.php';
include DIR_CORE.'files-admin.php';
include DIR_CORE.'files.php';

include DIR_CORE.'products-'.$config['db_type'].'.php';
include DIR_CORE.'products-admin.php';
include DIR_CORE.'products.php';

include DIR_CORE.'categories-'.$config['db_type'].'.php';
include DIR_CORE.'categories-admin.php';
include DIR_CORE.'categories.php';

if( $a == 'List' ){
if( !isset( $iCategory ) )
$iCategory = null;

$sSelectCategory = listCategories( 'categories_select.tpl', 1, null, $iCategory );

$content .= $tpl->tbHtml( 'products_list.tpl', 'PRODUCTS_HEAD' );

if( isset( $iCategory ) && is_numeric( $iCategory ) ){
$content .= listProducts( 'products_list.tpl', 'category' );
}
else{
if( isset( $sWord ) && throwStrlen( $sWord ) > 0 ){
$content .= listProducts( 'products_list.tpl', 'search' );
}
else{
$content .= listProducts( 'products_list.tpl' );
}
}
}
elseif( $a == 'Form' ){
if( isset( $_POST['option'] ) && $_POST['option'] == 'save' ){
$link = 'productsList&amp;iCategory='.$_POST['iCategory'];

if( isset( $iProduct ) && is_numeric( $iProduct ) ){
changeProduct( $_POST );
$content .= $tpl->tbHtml( 'operations.tpl', 'CHANGED' );
}
else{
addProduct( $_POST );
$content .= $tpl->tbHtml( 'operations.tpl', 'ADDED' );
}

}
else{
if( isset( $iProduct ) && is_numeric( $iProduct ) )
$aProduct = throwProduct( $iProduct );
if( !isset( $iCategory ) )
$iCategory = null;

if( isset( $aProduct ) && is_array( $aProduct ) ){
$aFiles = listFiles( $iProduct, 'products_form.tpl', 1 );

$aProduct['shortDescription'] = changeTxt( $aProduct['shortDescription'], 'nl' );
$aProduct['fullDescription'] = changeTxt( $aProduct['fullDescription'], 'nl' );
$aProduct['fullDescription2'] = changeTxt( $aProduct['fullDescription2'], 'nl' );

}
else{
$aProduct['category'] = $iCategory;
$aProduct['status'] = 1;
$aProduct['position'] = 50;
}
$sSelectCategory = listCategories( 'categories_select.tpl', 1, null, $aProduct['category'] );
$sSelectStatus = throwYesNoSelect( $aProduct['status'] );

$content .= $tpl->tbHtml( 'products_form.tpl', 'FORM' );
}
}
elseif( $a == 'Delete' && isset( $nr ) && is_numeric( $nr ) ){
if( isset( $pewny ) && $pewny == 'tak' ){
delProduct( $nr );
$link = 'productsList';
$content .= $tpl->tbHtml( 'operations.tpl', 'DELETED' );
}
else
$content .= $tpl->tbHtml( 'operations.tpl', 'DELETE' );
}
?>
=================================
and in templates directory:
products_form.php:
<!-- BEGIN FORM -->
<script type='text/javascript' src='$config[dir_js]checkForm.js'> </script>

<form action='?p=$p&amp;iProduct=$iProduct' enctype='multipart/form-data' method='post' onsubmit='return checkForm( this,
Array(
Array( "sName" )
,Array( "iCategory", "int" )
,Array( "fPrice", "float" )
,Array( "sShortDescription", "txt", 3 )
,Array( "iPosition", "int", "-1", null, ">", "false" )
,Array( "iPosition", "int", "999", null, "<", "false" )
) );'>

<table cellspacing='0' style='border: 0px; background: #d3d3d3; width: 750px;' class='tekst'>
<tr style='background: #f3f3f3;'>
<td colspan='2' style='padding: 10px;' class='h1'>
$lang[Product_data]
</td>
</tr>
<tr>
<td style='text-align: right; padding: 5px;'>
$lang[Name]:&nbsp;
</td>
<td>
<input type='text' name='sName' value="$aProduct[name]" size='70' class='input' />
</td>
</tr>

<tr>
<td style='text-align: right; padding: 5px;'>
$lang[Category]:&nbsp;
</td>
<td>
<select name='iCategory' class='input'>
<option value=''>$lang[choose]</option>
$sSelectCategory
</select>
</td>
</tr>

<tr>
<td style='text-align: right; padding: 5px;'>
$lang[Price]:&nbsp;
</td>
<td>
<input type='text' name='fPrice' value="$aProduct[price]" size='8' maxlength='8' style='text-align: right;' class='input' />
$config[currency_symbol]
</td>
</tr>

<tr>
<td style='text-align: right; padding: 5px;'>
$lang[Short_description]:&nbsp;
</td>
<td>
<textarea name='sShortDescription' cols='70' rows='5' class='input'>$aProduct[shortDescription]</textarea>
</td>
</tr>
<tr>
<td style='text-align: right; padding: 5px;'>
$lang[Full_description]:&nbsp;
</td>
<td>
<textarea name='sFullDescription' cols='70' rows='15' class='input'>$aProduct[fullDescription]</textarea>
</td>
</tr>
<tr>
<td style='text-align: right; padding: 5px;'>
Druga:&nbsp;
</td>
<td>
<textarea name='sFullDescription2' cols='70' rows='15' class='input'>$aProduct[fullDescription2]</textarea>
</td>
</tr>
$sProductAttributes
<tr>
<td style='text-align: right; padding: 5px;'>
$lang[Position]:&nbsp;
</td>
<td>
<input type='text' name='iPosition' value='$aProduct[position]' style='text-align: right;' class='input' size='3' maxlength='4' />
00 ... 98
</td>
</tr>
<tr>
<td style='text-align: right; padding: 5px;'>
$lang[Visible]:&nbsp;
</td>
<td>
<select name='iStatus' class='input'>
$sSelectStatus
</select>
</td>
</tr>
<tr>
<td></td>
<td>
<table style='width: 100% border: 0px;' cellpadding='2' cellspacing='0' />
<tr>
<td>
$lang[File]
</td>
<td>
$lang[Description]
</td>
</tr>
<tr>
<td>
<input type='file' name='sFile[]' value='' size='30' class='submit' />
</td>
<td>
<input type='text' name='aFileDescription[]' value='' maxlength='40' size='25' class='input' />
</td>
</tr>
<tr>
<td>
<input type='file' name='sFile[]' value='' size='30' class='submit' />
</td>
<td>
<input type='text' name='aFileDescription[]' value='' maxlength='40' size='25' class='input' />
</td>
</tr>
<tr>
<td>
<input type='file' name='sFile[]' value='' size='30' class='submit' />
</td>
<td>
<input type='text' name='aFileDescription[]' value='' maxlength='40' size='25' class='input' />
</td>
</tr>
</table>
</td>
</tr>
$aFiles[default_photo]
$aFiles[photos]
$aFiles[files]
<tr>
<td colspan='2' style='text-align: center; background-color: #f3f3f3; padding: 5px;'>
<input type='hidden' name='iProduct' value="$iProduct" />
<input type='hidden' name='option' value="save" />
<input type='submit' value='$lang[save]' />
</td>
</tr>
<tr>
<td colspan='2' style='text-align: center; background-color: #f3f3f3; padding: 5px;'>
<a href='javascript:history.back()'>$lang[go_back]</a>
</td>
</tr>
</table>
</form>
<!-- END FORM -->

<!-- BEGIN FOTO_DEFAULT -->
<tr>
<tr>
<td style='text-align: right; padding: 5px;'>
$lang[Delete]
</td>
<td style='padding: 5px;'>
$lang[Description], $lang[Name]
</td>
</tr>
</tr>
<tr>
<td style='text-align: right; padding: 5px;'>
<input type='checkbox' name='aDelFile[]' value='$aList[id]' />
</td>
<td>
<input type='text' name='aFileDescriptionChange[$aList[id]]' value="$aList[description]" maxlength='40' size='25' class='input' />
<input type='hidden' name='aFileNameChange[$aList[id]]' value="$aList[file]" />
<input type='hidden' name='aFileType[$aList[id]]' value="$aList[type]" />
<b>$aList[file]</b> [<a href='javascript:windowFoto( "$aList[fotoBig]" );'>$lang[big]</a>] [<a href='javascript:windowFoto( "$aList[fotoSmall]" );'>$lang[small]</a>]
</td>
</tr>
<!-- END FOTO_DEFAULT -->

<!-- BEGIN FOTO_HEAD -->
<!-- END FOTO_HEAD -->

<!-- BEGIN FOTO_LIST -->
<tr>
<td style='text-align: right; padding: 5px;'>
<input type='checkbox' name='aDelFile[]' value='$aList[id]' />
</td>
<td>
<input type='text' name='aFileDescriptionChange[$aList[id]]' value="$aList[description]" maxlength='40' size='25' class='input' />
<input type='hidden' name='aFileNameChange[$aList[id]]' value="$aList[file]" />
<input type='hidden' name='aFileType[$aList[id]]' value="$aList[type]" />
$aList[file] [<a href='javascript:windowFoto( "$aList[fotoBig]" );'>$lang[big]</a>] [<a href='javascript:windowFoto( "$aList[fotoSmall]" );'>$lang[small]</a>]
</td>
</tr>
<!-- END FOTO_LIST -->

<!-- BEGIN FOTO_FOOTER -->
<!-- END FOTO_FOOTER -->

<!-- BEGIN FILES_HEAD -->
<!-- END FILES_HEAD -->

<!-- BEGIN FILES_LIST -->
<tr>
<td style='text-align: right; padding: 5px;'>
<input type='checkbox' name='aDelFile[]' value='$aList[id]' />
</td>
<td>
<input type='text' name='aFileDescriptionChange[$aList[id]]' value="$aList[description]" maxlength='40' size='25' class='input' />
<input type='hidden' name='aFileNameChange[$aList[id]]' value="$aList[file]" />
<input type='hidden' name='aFileType[$aList[id]]' value="$aList[type]" />
<a href='$config[dir_files]$config[dir_products_files]$aList[file]' target='_blank'>$aList[file]</a>
</td>
</tr>
<!-- END FILES_LIST -->

<!-- BEGIN FILES_FOOTER -->
<!-- END FILES_FOOTER -->
===================================
and change it should change at last db entry, but it does not

could anyone help me with adding description boxes on add-products page?

kind regards



hex

No avatar

2005-10-15 11:23

variable fullDescription2 isthat what, which holds the data for additional description box

hex

No avatar

2005-10-15 17:33

boost

anyone?

Bug

No avatar

2005-10-15 19:37

Hex hi! Give me your site adress!

prodcts.php //core in line

list( $aProducts['position'], $aProducts['name'], $aProducts['id'], $aProducts['category'], $aProducts['price'], .. add new field like:

list( $aProducts['position'], $aProducts['newfield1'], $aProducts['name'], $aProducts['id'], $aProducts['category'], $aProducts['price'],

change it 2 times as this line is in 2 places!
______________________________________
products_admin.php /core

do nothing
_______________________________________
products_ff.php /core in line

$oFF->setRow( Array( sprintf( '%02.0f', $iPosition ), $sName, $iProduct, $iCategory, $fPrice, $sShortDescription, $sFullDescription, $iStatus, $sFullDescription2 ) ); make it like

$oFF->setRow( Array( sprintf( '%02.0f', $iPosition ), $snewfield1, $sName, $iProduct, $iCategory, $fPrice..

also 2 times!!
________________________________________
in form TPL
add new field like:

<input type='text' name='snewfield1' value="$aProduct[newfield1]" size='70' class='input' /> ...
________________________________________

and thats it! TRY OK!?

Bug

No avatar

2005-10-15 19:39

sori also, add in admin product..

$aForm['snewfield'] = changeTxt( $aForm['snewfield'] );

hex

No avatar

2005-10-15 22:31

ok, i will try it and let you know.
btw, bug could you give me your e-mail addres? i will contact you directly with my site address and also can send you my site code if i wiont be able to fix it out myself. and it will be easier to keep in touch.

my addres is waxxed (at) gmail.com.

thanks for help, i will check it.

hex

No avatar

2005-10-15 22:47

it doesnt work
after adding product and than when editing it fields are empty and in listing of products there is a lot of misstyped names, for status stands products name and as a products name it keeps displaying status variable value.

maybe you could change this code in example files (riginal files) and send it to me? have you check what you have written here? does it work for you?

thanks for help, once more

hex

No avatar

2005-10-16 16:02

ehh, i cant fix it out.

please, somebody help me

Do góry
o nas | kontakt