Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Add an image if the product is on special offer


diy

Recommended Posts

I want to add an image if a product is on special price (something like special offer or stock sale) . Not sure where to put the image .

 

Searched in contributions did not find anything usefull.

 

Any help on the code will be apreciated .

Link to comment
Share on other sites

  • 3 weeks later...

I am referring to osc 2.2

 

 

Found the solution my self .

 

Since you can add TEXT to the image as this post by burt suggests

 

http://www.clubosc.com/how-to-show-special-price-more-clearly.html

 

You can add an image aw you can add text

 

in product_info.php

 

just add

 tep_image(DIR_WS_IMAGES . 'image.jpg')  .  

 

in front of

 

$products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';

 

making it

 

 

$products_price = tep_image(DIR_WS_IMAGES . 'image.jpg')  .'<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';

 

 

make an image with the name image.jpg or change image jpg to your image name

 

You can also add a pic in product listing

 

in includes/modules/product listing

 

I have adden an image and deleted the strikethrough price as i didint like it

 

I Changed

 

$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> ';

 

to

 

$lc_text = ' '. tep_image(DIR_WS_IMAGES . 'image.jpg')  . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span> ';

.

 

 

Use it at your own risk and back up any file you change.

 

PS where is everybody in this forum??

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...