Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Show Price in Product Desc.


Guest

Recommended Posts

Posted

Hopefully this is an easy one, but some customers miss the price because it is displayed in the top right of the product page. I've tried adding it to the product description manually, but this is a pain, especially when we offer sales.

 

Can someone please tell me how to make the price show in the product description, preferably as the last line of the desc?

 

e.g. on http://www.towerink.com/product_info.php?c...&products_id=57, I'd like this to show our price under the OEM price.

 

Thanks for your help.... I thought this would be easy but I couldn't find the solution anywhere.

Posted

You just need to modify the product_info.php file and change where the price display field is placed.

 

Move

 

<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>

 

down.

 

You can even make it Red if you want.

Posted

In product_info.php find this code:

<?php
   }
?>
         <p><?php echo stripslashes($product_info['products_description']); ?></p>

...and replace it with this:

    }
$str = stripslashes($product_info['products_description']);
eval("\$str = \"$str\";");
?>
         <p><?php echo $str; ?></p>
         <!--
   <p><?php #echo stripslashes($product_info['products_description']); ?></p>
   //-->

Once you make that change you can include any variable in the script and have it parsed.

 

For example, you can use this:

Some description...
another line...
and another...

The price for this product is: $products_price

 

On display it will be like this:

Some description...
another line...
and another...

The price for this product is: $39.99

 

Do not use variables like $variable['something'] and ONLY use ones like $variable.

 

Bobby

Posted
You just need to modify the product_info.php file and change where the price display field is placed.

 

Move

 

<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>

 

down.

 

You can even make it Red if you want.

That will work as he wants it as part of the description to be formatted and seamless with the content. If you merely move it down it will always be below the description and cannot be tailored for the individual product.

 

IMO, the method I presented is quick and very effective given his requirements.

 

Bobby

Posted

Thanks for the help guys. I couldn't get the more elegant solution to work (it kept giving me crazy errors).

 

I ended up just adding that tag later in the page as well. It gave me a chance to do some other trimming on the page, which it needed.

Archived

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

×
×
  • Create New...