adding new product field - Part Number

shadowness

No avatar

2007-06-11 15:13

Hello,

I want to add a new product field (part number). This way on order details page i get the part number of each product (becomes more easy to find in database).

I've searched the forum.. but not found what i'm looking for.

So what i did:

core/products-admin.php
added SRef;

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

templates/admin/products_form.tpl
added sRef;

Array( 'sName' )
,Array( 'sRef' )
,Array( 'aCategories[]' )
,Array( 'fPrice', 'float' )
,Array( 'sDescriptionShort' )
,Array( 'iPosition', 'int', '-99', null, '>=', 'false' )
,Array( 'iPosition', 'int', '999', null, '=<', 'false' )
) );">


(...)

<tr>
<th>
<strong>$lang[Ref]</strong>
</th>
<td>
<input type="text" name="sRef" value="$aData[sRef]" size="70" />
</td>
</tr>


finally in templates/admin/orders_details.tpl
added sRef field;

<table id="list" cellspacing="0">
<tr class="lh">
<td>
$lang[Name]
</td>
<td>
$lang[Ref]
</td>
<td>
$lang[Price]&nbsp;[$config[currency_symbol]]
</td>
<td>
$lang[Quantity]
</td>
<td>
$lang[Summary] [$config[currency_symbol]]
</td>
</tr>
<!-- END LIST_HEAD -->

<!-- BEGIN LIST_LIST -->
<tr class="l_$aList[iStyle]">
<td>
$aList[sProduct]
</td>
<td class="label">
$aList[sRef]
</td>
<td class="label">
$aList[fPrice]
</td>
<td class="label">
$aList[iQuantity]
</td>
<td class="label">
$aList[fSummary]
</td>
</tr>
<!-- END LIST_LIST -->
<!-- BEGIN LIST_FOOT -->
<tr class="l_0">
<td colspan="3" class="label">
$lang[Summary_basket]
</td>
<td class="label">
$aList[fSummary]
</td>
</tr>
<!-- END LIST_FOOT -->






I don't get any error... but it doesn't work! :(

Does anyone can help me?

Thanks :)

» Quick.Cart v2.x

merci

No avatar

2007-06-12 10:11

shadowness - well, you have to edit also files: core/products-ff.php function dbSaveProduct and core/products.php function throwProduct. It will save and throw your data in admin panel. You can read also http://opensolution.org/forum/?p=readTopic&nr=1019
To add this field also to order, you have to edit few functions (core/orders.php) and templates, but it is more complicated and hard to describe shortly. If you will have problems with that, contact with us via e-mail, we can do this for you.

Back to top
about us | contact