December 9, 2010 – 8:37 pm
Product MiniDescriptions for OSCommerce 2.3
Adding minidescription to your product listing in OSCommerce 2.3 is easy:
- Create a new field in products_description. (use the following in phpMyAdmin)
ALTER TABLE `products_description` ADD `products_minidescp` TEXT NOT NULL
Then type the product mini-descriptions directly into the database.
- On about line 121 in index.php
change:
case 'PRODUCT_LIST_NAME':
$select_column_list .= 'pd.products_name, ';
break;
to this:
case 'PRODUCT_LIST_NAME':
$select_column_list .= 'pd.products_name, pd.products_minidescp, ';
break;
- In includes/modules/product_listing.php
change this:
case 'PRODUCT_LIST_NAME':
if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {
$prod_list_contents .= ' <td><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a></td>';
} else {
$prod_list_contents .= ' <td><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a></td>';
}
to this:
case 'PRODUCT_LIST_NAME':
if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {
$prod_list_contents .= ' <td><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a><br/>'. $listing['products_minidescp'].'</td>';
} else {
$prod_list_contents .= ' <td><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a><br/>'. $listing['products_minidescp'].'</td>';
}
That’s it!
In OSCommerce 2.2RC2a step three above is different:
3. In includes/modules/product_listing.php
change this:
$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>';
To this:
$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a><br/>'. $listing['products_minidescp'];
December 9, 2010 – 8:00 pm
Make it a bit less challenging to create an account. This adds an email entry field adjacent to the ‘create account’ button. When the user fills in an email and clicks the submit button, they go as usual to create_account.php, but the email field is filled in. If they enter nothing on login.php, they still proceed to create_account.php and fill in the form as normal. It’s kind of like Amazon, sort of.
-
Place the following on login.php : (replaces the submit button)
<?php
echo tep_draw_form('email_login', tep_href_link(FILENAME_CREATE_ACCOUNT, 'action=post', 'SSL'));
echo '<p class="right">'.tep_draw_input_field('email_login', 'enter email address'). tep_draw_separator('pixel_trans.gif', '10', '10').tep_image_submit('', '', 'value="Create Account"');
echo '</p></form>';
?>
-
Place the following on create_account.php (replaces the email field)
<?php
$email_login = $HTTP_POST_VARS['email_login'];
echo '<p>'.ENTRY_EMAIL_ADDRESS.'<br/>'.tep_draw_input_field('email_address', $email_login) . ' ' . (tep_not_null(ENTRY_EMAIL_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>': '');
?>
posted on the OSCommerce forum under ‘Tips and Tricks’:
Create Account Variation
December 1, 2010 – 8:39 pm
This code can be used to install a CSS style search box anywhere on a OSCommerce shopping cart. It uses OSCommerce functions and clears when clicked on.
Paste this code where you would like to have the search box:
<div class="search-box">
<?php echo tep_draw_form('quick_find', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'SSL', false), 'get'); ?>
<input type=text name="keywords" size="10" maxlength="25" class="search-field" value="Search..." onclick="this.value='';" onblur="if(!this.value) {this.value='Search...'; }">
<input type="hidden" name="search_in_description" value="1" />
<input type="hidden" name="inc_subcat" value="1" />
<?php echo tep_hide_session_id() .'<input type="submit" name="search" value="" class="search-go" border="0" width="79" height="25">';?>
</form>
</div>
Add this to your style sheet:
.search-box{ /*outer background*/float:right; height: 26px; padding: 10px 10px 0px 10px; }
input.search-field{ /*input field */ color:#999999; float: left; border:1px dotted #CCCCCC; border-width: 1px 0px 1px 1px; margin:0; padding: 3px 0px 0px 4px; height:16px; width: 92px; }
input.search-go { /*search icon */ float:left; border:1px solid #CCCCCC; border-width: 1px 1px 1px 0px; margin:0; padding:0; margin-left: 0px; height: 21px; width: 21px; background: #F2F2F2 url(img/icon-search.png) no-repeat top left; cursor: pointer; }
input.search-go:hover{ /*search icon hover "Does Not work in ie6" */ background:url(images/icon-search.png) no-repeat bottom left; }
Now upload this icon,

to the ‘images’ folder on your site.
November 9, 2010 – 8:44 pm
upgrade OSC to CSS to OSCommerce 2.3
Upgrading OSC to CSS to 2.3 is tedious but not much different than installing contributions. Here is a link to the official instructions:
Upgrade to 2.3
Note you can do as much or as little of an upgrade as you need. If you want to only upgrade the security aspects, the pick the items marked (SEC). Work top to bottom.