Hello Paul O’B & deathshadow60,
thank you, thank you
you have both given me lots of great info to try/work with.
The code I was using came from a Modification code that I found, to add “Item Condition” to my Buy-Sell script,
Below I have pasted the complete code, it works, yet lacks any customizing for Font size,color etc.
Thanks to you both I can now add that customizing
===============================================================================
IN FILE: templates/sell_item_detail.tpl.php -find
===============================================================================
<tr class="c1">
<td width="150" align="right"><?=MSG_ITEM_DESCRIPTION;?></td>
<td><textarea id="description_main" name="description_main" style="width: 400px; height: 200px; overflow: hidden;"><?=$item_details['description'];?></textarea>
<?=$item_description_editor;?>
</td>
</tr>
<tr class="reguser">
<td></td>
<td><?=MSG_ITEM_DESC_EXPL;?></td>
</tr>
================================================================================
under it place this code:
================================================================================
<tr class="c1">
<td width="150" align="right">Item Condition:</td>
<td> <SELECT NAME="item_condition">
<OPTION VALUE="0" SELECTED>See description</OPTION>
<OPTION VALUE="1" <? echo ($item_details['item_condition']==1) ? 'selected' : ''; ?>>New</OPTION>
<OPTION VALUE="2" <? echo ($item_details['item_condition']==2) ? 'selected' : ''; ?>>Used</OPTION>
<OPTION VALUE="3" <? echo ($item_details['item_condition']==3) ? 'selected' : ''; ?>>Good</OPTION>
<OPTION VALUE="4" <? echo ($item_details['item_condition']==4) ? 'selected' : ''; ?>>Fair</OPTION>
<OPTION VALUE="5" <? echo ($item_details['item_condition']==5) ? 'selected' : ''; ?>>Poor</OPTION>
<OPTION VALUE="6" <? echo ($item_details['item_condition']==6) ? 'selected' : ''; ?>>Defective</OPTION>
</SELECT></td>
</tr>
==============================================================================================================
IN FILE: templates/sell_item.tpl.php -find
===================================================================================
<input type="hidden" name="description" value="<?=$item_details['description'];?>" >
==========================================================================================
under it place this code
===========================================================================================
<input type="hidden" name="item_condition" value="<?=$item_details['item_condition'];?>" >
===================================================================================
IN FILE: includes/class_item.php -find
==================================================================================
creation_in_progress='" . $item_details['creation_in_progress'] . "', state='" . $item_details['state'] . "',
is_draft='" . $is_draft . "'
WHERE auction_id='" . $item_details['auction_id'] . "' AND owner_id='" . $owner_id . "'");
===============================================================================================================
replace with this code
=========================================================================================================================
creation_in_progress='" . $item_details['creation_in_progress'] . "', state='" . $item_details['state'] . "',
is_draft='" . $is_draft . "', item_condition='" . $item_details['item_condition'] . "'
WHERE auction_id='" . $item_details['auction_id'] . "' AND owner_id='" . $owner_id . "'");
=======================================================================================================================================
find:
===============================================================================================================
if ($relist_option == 1)
{
$sql_relist_auction = $this->query("INSERT INTO " . DB_PREFIX . "auctions
(name, description, quantity, auction_type, start_price, reserve_price, buyout_price, bid_increment_amount,
country, zip_code, shipping_method, shipping_int, payment_methods, category_id, owner_id, hpfeat, catfeat,
bold, hl, hidden_bidding, currency, postage_amount, insurance_amount, type_service, enable_swap,
addl_category_id, shipping_details, hpfeat_desc, list_in, direct_payment, apply_tax, auto_relist_bids,
approved, listing_type, is_offer, offer_min, offer_max, auto_relist_nb, state)
SELECT
name, description, quantity, auction_type, start_price, reserve_price, buyout_price, bid_increment_amount,
country, zip_code, shipping_method, shipping_int, payment_methods, category_id, owner_id, hpfeat, catfeat,
bold, hl, hidden_bidding, currency, postage_amount, insurance_amount, type_service, enable_swap,
addl_category_id, shipping_details, hpfeat_desc, list_in, direct_payment, apply_tax, auto_relist_bids,
approved, listing_type, is_offer, offer_min, offer_max, auto_relist_nb, state
FROM " . DB_PREFIX . "auctions WHERE auction_id=" . $auction_id . " AND owner_id=" . $user_id);
=======================================================================================================================================
replace with this code:
=========================================================================================================================================
if ($relist_option == 1)
{
$sql_relist_auction = $this->query("INSERT INTO " . DB_PREFIX . "auctions
(name, description, quantity, auction_type, start_price, reserve_price, buyout_price, bid_increment_amount,
country, zip_code, shipping_method, shipping_int, payment_methods, category_id, owner_id, hpfeat, catfeat,
bold, hl, hidden_bidding, currency, postage_amount, insurance_amount, type_service, enable_swap,
addl_category_id, shipping_details, hpfeat_desc, list_in, direct_payment, apply_tax, auto_relist_bids,
approved, listing_type, is_offer, offer_min, offer_max, auto_relist_nb, state, item_condition)
SELECT
name, description, quantity, auction_type, start_price, reserve_price, buyout_price, bid_increment_amount,
country, zip_code, shipping_method, shipping_int, payment_methods, category_id, owner_id, hpfeat, catfeat,
bold, hl, hidden_bidding, currency, postage_amount, insurance_amount, type_service, enable_swap,
addl_category_id, shipping_details, hpfeat_desc, list_in, direct_payment, apply_tax, auto_relist_bids,
approved, listing_type, is_offer, offer_min, offer_max, auto_relist_nb, state, item_condition
FROM " . DB_PREFIX . "auctions WHERE auction_id=" . $auction_id . " AND owner_id=" . $user_id);
===============================================================================================================
find:
===============================================================================================================
$sql_insert_item = $this->query("UPDATE " . DB_PREFIX . "wanted_ads SET
name='" . $word_filter['name'] . "', description='" . $word_filter['description'] . "',
duration='" . $item_details['duration'] . "', country='" . $item_details['country'] . "',
zip_code='" . $item_details['zip_code'] . "', category_id='" . $item_details['category_id'] . "',
owner_id='" . $owner_id . "', addl_category_id='" . $item_details['addl_category_id'] . "',
end_time='" . $end_time . "', start_time='" . $start_time . "',
creation_in_progress='0', state='" . $item_details['state'] . "'
WHERE wanted_ad_id='" . $item_details['wanted_ad_id'] . "' AND owner_id='" . $owner_id . "'");
===============================================================================================================
Replace with:
===============================================================================================================
$sql_insert_item = $this->query("UPDATE " . DB_PREFIX . "wanted_ads SET
name='" . $word_filter['name'] . "', description='" . $word_filter['description'] . "',
duration='" . $item_details['duration'] . "', country='" . $item_details['country'] . "',
zip_code='" . $item_details['zip_code'] . "', category_id='" . $item_details['category_id'] . "',
owner_id='" . $owner_id . "', addl_category_id='" . $item_details['addl_category_id'] . "',
end_time='" . $end_time . "', start_time='" . $start_time . "',
item_condition='" . $item_details['item_condition'] . "',
creation_in_progress='0', state='" . $item_details['state'] . "'
WHERE wanted_ad_id='" . $item_details['wanted_ad_id'] . "' AND owner_id='" . $owner_id . "'");
====================================================================================================================
IN FILE: Themes/your theme/templates/auction_details.tpl.php -find
=========================================================================================================================
<? if ($item_details['quantity']) { ?>
<tr class="c1">
<td><b><?=GMSG_QUANTITY;?></b></td>
<td><?=$item_details['quantity'];?></td>
</tr>
<? } ?>
============================================================================================================
under it place this code
======================================================================================================================================
<tr class="c1">
<td><b>Item Condition</b></td>
<td>
<? if ($item_details['item_condition']==0) { ?>See description
<? } else if ($item_details['item_condition']==1) { ?>New
<? } else if ($item_details['item_condition']==2) { ?>Used
<? } else if ($item_details['item_condition']==3) { ?>Good
<? } else if ($item_details['item_condition']==4) { ?>Fair
<? } else if ($item_details['item_condition']==5) { ?>Poor
<? } else if ($item_details['item_condition']==6) { ?>Defective<? } ?></td>
</tr>
====================================================================================================================