OSCOMMERCE SUPPORT CALL 702-453-3332

 

Help - Search - Members - Calendar
Full Version: simple add-ons
osCommerce Community Support Forums > osCommerce Online Merchant v2.x > Tips and Tricks
desidil4ever
hey,

I hope this one helps someone. I had looked through a lot of forum articles, googled, and other sources but could't find a solution. So since I did stumble on it finally I am putting this down for someone who might find it useful.
Many of us have used the contribution http://www.oscommerce.com/community/contributions,1501/
in case if you want to add a 0-9 listing by building a range...you could just add this piece of code. Nice n easy trick:)

QUOTE
<a href="' . tep_href_link("allprods.php", 'fl>=0andfl<=9', 'NONSSL') . '">#</A>


I am starting this thread so that people can add just small small things which can be useful to a lot of other people:)

Time to give back to Oscommerce Team for all they have done for us:)
desidil4ever
Another quick add-on is to display savings in amount and percentage value. You could use the MSRP contribution or if you want a quick way out you could just play a bit with listing code and do it without adding another query and burdening your server!!!

You just have to update the specials table...run a query or add individual specials for various items. I actually made a 5% reduction on all my products_price. So now we have two prices for all products....the regular price and specials price. The specials is also listed by default in almost all oscommerce pages which display prices. So only thing you need to do is add another line to display the SAVINGS

EXAMPLE
QUOTE
<span class="productSpecialPrice">You Save: </span></td><td class="smalltext"><span class="productSpecialPrice">' . $currencies->display_price(($listing['products_price'] - $listing['specials_new_products_price']), tep_get_tax_rate($listing['products_tax_class_id'])) . ' (' . ceil((($listing['products_price'] - $listing['specials_new_products_price']) / $listing['products_price']) * 100) . '%)


I am posting just a example. This is from product_listing in includes/modules.....please do remember different files have different queries so you have to make sure you match these.

QUOTE
case 'PRODUCT_LIST_PRICE':
$lc_align = 'right';
if (tep_not_null($listing['specials_new_products_price'])) {
$lc_text = ' <s>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span> ';
} else {
$lc_text = ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' ';
}
break;


see and compare:

QUOTE
case 'PRODUCT_LIST_PRICE':
$lc_align = 'right';
if (tep_not_null($listing['specials_new_products_price'])) {
/* $lc_text = ' <s>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span> '; */

$lc_text = '<table border="0" width="100%" cellspacing="0" cellpadding="0"><tr><td class="smalltext">Wholesale Price:</td><td class="smalltext"><s>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s></td></tr><tr><td class="smalltext">Our Special Price:</td><td class="smalltext">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</td></tr><tr><td class="smalltext"><span class="productSpecialPrice">You Save: </span></td><td class="smalltext"><span class="productSpecialPrice">' . $currencies->display_price(($listing['products_price'] - $listing['specials_new_products_price']), tep_get_tax_rate($listing['products_tax_class_id'])) . ' (' . ceil((($listing['products_price'] - $listing['specials_new_products_price']) / $listing['products_price']) * 100) . '%)</span></td></tr></table>';
} else {
$lc_text = ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' ';
}
break;


Just use a bit of commonsense and this should be easy to implement wherever it can be and wherever you want it to be:)
desidil4ever
Changing the way breadcrumbs look:

In the header file search for
QUOTE
<td class="headerNavigation">&nbsp;&nbsp;<?php echo $breadcrumb->trail(' &raquo; '); ?></td>

change it to
QUOTE
<td class="headerNavigation">&nbsp;&nbsp;<?php echo $breadcrumb->trail(' : '); ?></td>
if you want dots instead of >> also....u could change the color by adding Font properties inside the brackets or in the <td> tag whichever way works for you.

Since we are talking about breadcrumbs, here is another cool thing you could do...some of you who would wanna move it around somewhere out of the header.php...that piece of line is what you can delete from header.php and add wherever you would prefer it



****would prefer if others also add any lil bit of neat tricks to help new users or people looking for simpler but effective add-ons for their sites***
stubbsy
QUOTE (desidil4ever @ Sep 25 2006, 08:10 AM) *
Another quick add-on is to display savings in amount and percentage value. You could use the MSRP contribution or if you want a quick way out you could just play a bit with listing code and do it without adding another query and burdening your server!!!

You just have to update the specials table...run a query or add individual specials for various items. I actually made a 5% reduction on all my products_price. So now we have two prices for all products....the regular price and specials price. The specials is also listed by default in almost all oscommerce pages which display prices. So only thing you need to do is add another line to display the SAVINGS

EXAMPLE
I am posting just a example. This is from product_listing in includes/modules.....please do remember different files have different queries so you have to make sure you match these.
see and compare:
Just use a bit of commonsense and this should be easy to implement wherever it can be and wherever you want it to be:)


Nice tip!

Thanks for that

Dave
mondocar
QUOTE (desidil4ever @ Sep 25 2006, 07:43 AM) *
hey,

I hope this one helps someone. I had looked through a lot of forum articles, googled, and other sources but could't find a solution. So since I did stumble on it finally I am putting this down for someone who might find it useful.
Many of us have used the contribution http://www.oscommerce.com/community/contributions,1501/
in case if you want to add a 0-9 listing by building a range...you could just add this piece of code. Nice n easy trick:)
I am starting this thread so that people can add just small small things which can be useful to a lot of other people:)

Time to give back to Oscommerce Team for all they have done for us:)


I have this for product_info.php:

CODE
$products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '<br><span class="productSpecialPrice">Risparmi il </span></td><td class="smalltext"><span class="productSpecialPrice">' . $currencies->display_price(($product_info['products_price'] - $product_info['new_price']), tep_get_tax_rate($product_info['products_tax_class_id'])) . ' (' . ceil((($product_info['products_price'] - $product_info['new_price']) / $product_info['products_price']) * 100) . '%) . '</span>';


You can tall me why Not working ???? sad.gif

Thanks
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.