Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

how to add "from" $


dandelion

Recommended Posts

Does anyone know how to add the word from to the price that shows on the category page and the top of the item page when the item has an option like size that affects the price?

 

See my unscented products page for an example of where this would work.

 

My Webpage

 

Thanks

 

Dandelion

Link to comment
Share on other sites

Hi

 

In catalog/includes/modules/product_listing.php find the following code:

 

 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'])) . ' ';
           }

 

(this may look slightly different - I think I have a contribution called specials installed, cant remember whether its in the standard osc code or not, but it should look roughly as above - just look for case 'PRODUCT_LIST_PRICE': )

 

Change it to (again, if your code is different to above, just change the relevant portions of your own code)

 

 case 'PRODUCT_LIST_PRICE':
           $lc_align = 'right';
           if (tep_not_null($listing['specials_new_products_price'])) {
             $lc_text = ' From <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 = ' From ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' ';
           }

 

The only change is from nbsp; to nbsp;Fromnbsp;

 

You then need to edit your catalog/product_info.php file. find:

 

<tr><td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr height="40">
           <td class="pageHeading"><?php echo $product_info['products_name']; ?></td>
           <td align="right" class="pageHeading"><?php echo $products_price; ?>

 

and change to:

 

<tr><td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr height="40">
           <td class="pageHeading">From: <?php echo $product_info['products_name']; ?></td>
           <td align="right" class="pageHeading"><?php echo $products_price; ?>

 

Enjoy!

Please note - if I have suggested a contrib above, it doesnt mean it will work! Most of the contribs are not ones I've used, but may be useful for your particular problem....

Have you tried a refined search? Chances are your problem has already been dealt with elsewhere on the forums.....

if (stumped == true) {

return(square_one($start_over)

} else {

$random_query = tep_fetch_answer($forum_query)

}

Link to comment
Share on other sites

Thanks so much but the problem is that then it always says "from". I only want the from to be there for the products that have options listed. Do you know how to do that?

 

Ruth

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...