Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Code to play the same with IE8 and Firefox


29gk

Recommended Posts

Posted

I recently installed Featured Products 1.5.8 and Short Descriptions . Everything is working fine except the following code which shows different results in Internet Explorer 8, while working perfectly with firefox.

 

Into featured.php i add the following to show the shorts descriptions in featured products infobox that i have on the first ( index) page :

 

ORIGINAL FEATURED.PHP CODE :

 

1)

 

. '</a><br><s>' .

 

REPLACED BY :

 

'</a><br>' . strip_tags($description['products_description']) . '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']). '">' . DESCR_READ_MORE . '</a><br>  <a href="' . tep_href_link(FILENAME_DEFAULT_HOME, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products['products_id']) . '"></a> <s>' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($featured_products['specials_new_products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</span>');

 

2)

 

. '</a><br>' .

 

REPLACED BY :

 

'</a><br>' . strip_tags($description['products_description']) . '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']). '">' . DESCR_READ_MORE . '</a><br>  <a href="' . tep_href_link(FILENAME_DEFAULT_HOME, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products['products_id']) . '"></a> <span class="productPrice">' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])));

 

I have also added in stylesheet.css the following class :

 

SPAN.productPrice {

font-family: Verdana, Arial, sans-serif;

font-size: 12px;

font-weight: bold;

color: Black;

}

 

 

What i am trying to do is to change the font of the products title and the prices on the short descriptions in the featured products box. So you can see that i added the <span class="productPrice"> and the result is that in firefox , both the name and also the prices are black and bold.

 

But not in IE8 :blink:

 

There the prices are OK but products names do not change to bold when a product has "normal" price, but products with special prices have both their names AND their descriptions in ..... bold !!

 

I ve spent 2 days on this but seems that i am missing something....... Please help :(

Posted

My bad, you need to see the whole lines.

 

So the first is this one :

 

'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products['products_image'], $featured_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '"><span class="productPrice">' . $featured_products['products_name'] . '</a><br>' . strip_tags($description['products_description']) . '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']). '">' . DESCR_READ_MORE . '</a><br>  <a href="' . tep_href_link(FILENAME_DEFAULT_HOME, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products['products_id']) . '"></a> <s>' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($featured_products['specials_new_products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</span>');

 

and the second one :

 

'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products['products_image'], $featured_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '"<span class="productPrice">' . $featured_products['products_name'] . '</a><br>' . strip_tags($description['products_description']) . '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']). '">' . DESCR_READ_MORE . '</a><br>  <a href="' . tep_href_link(FILENAME_DEFAULT_HOME, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products['products_id']) . '"></a> <span class="productPrice">' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])));

Posted

And finally i found it, with the help from this post

 

http://www.oscommerce.com/forums/topic/348995-how-to-make-something-bboldb-or-uunderlinedu-directly-in-code/

 

The correct code i am using for anyone using Featured Products 1.5.8 and Short Description in products is the following in includes\modules\fetured.php

 

 

'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products['products_image'], $featured_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '"><b>' . $featured_products['products_name'] . '</b></a><br>' . strip_tags($description['products_description']) . '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']). '">' . DESCR_READ_MORE . '</a><br>  <a href="' . tep_href_link(FILENAME_DEFAULT, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products['products_id']) . '"></a> <s>' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($featured_products['specials_new_products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '</span>');

} else {

$info_box_contents[$row][$col] = array('align' => 'center',

'params' => 'class="smallText" width="33%" valign="top"',

'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $featured_products['products_image'], $featured_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '"><b>' . $featured_products['products_name'] . '</b></a><br>' . strip_tags($description['products_description']) . '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']). '">' . DESCR_READ_MORE . '</a><br>  <a href="' . tep_href_link(FILENAME_DEFAULT, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products['products_id']) . '"></a> <span class="productPrice">' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])));

 

 

with the use of the following addition in stylesheet.css

 

SPAN.productPrice {

font-family: Verdana, Arial, sans-serif;

font-size: 12px;

font-weight: bold;

color: Black;

}

Archived

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

×
×
  • Create New...