PupStar Posted December 13, 2013 Posted December 13, 2013 Hi Guys, I have 3 modules running side by side on the index.php - new_products, specials and best_sellers. If you look at the attached image you will see the problem I am having with the specials module. For some reason the price of the 1st product is leaching into the seond product urgh. The code for the specials module is this <?php /* $Id$ $Loc: catalog/includes/modules/ $ $Mod: Specials Image Overlay 1.0 20121209 Kymation $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2010 osCommerce Released under the GNU General Public License */ $special_products_query = tep_db_query("select distinct p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p join " . TABLE_PRODUCTS_DESCRIPTION . " pd on pd.products_id = p.products_id join " . TABLE_SPECIALS . " s on s.products_id = p.products_id where p.products_status = '1' and pd.language_id = '" . ( int ) $languages_id . "' and s.status = '1' order by RAND() limit " . MAX_DISPLAY_NEW_PRODUCTS); $num_special_products = tep_db_num_rows($special_products_query); if ($num_special_products > 0) { $counter = 0; $col = 0; $special_prods_content = '<table border="0" width="40%" align="center" cellspacing="0" cellpadding="0">'; while ($special_products = tep_db_fetch_array($special_products_query)) { $counter++; $new_overlay = true; if( $special_products['status'] == '1' && tep_not_null( $special_products['specials_new_products_price'] ) ) $new_overlay = true; $special_products_previous_price = '<div class="productPriceSmall"><b>' . TEXT_PREVIOUS_PRICE . '</b> <del>' . $currencies->display_price($special_products['products_price'], tep_get_tax_rate($special_products['products_tax_class_id'])) . '</del></div>'; $special_products_price .= '<div class="productPriceLarge" style="float: left;">' . $currencies->display_price($special_products['specials_new_products_price'], tep_get_tax_rate($special_products['products_tax_class_id'])) . '</div>'; if ($col === 0) { $special_prods_content .= '<tr>'; } $special_prods_content .= '<td width="10%" valign="middle" style="padding: 2px;"><div class="ui-widget ui-corner-all infoBoxContentsProductListing shadow" style="padding-left: 2px;"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $special_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $special_products['products_image'], $special_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, '', $new_overlay) . '</a></div><div style="clear: both; padding:2px;"></div><div style="height: 32px;"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $special_products['products_id']) . '"><span class="productListingTitle">' . $special_products['products_name'] . '</span></a></div><div style="clear: both; padding:1px;"></div><div style="float: left;">' . $special_products_previous_price . '</div><div style="clear: both;"></div><div class="productListingPrice" style="float: left;">' . $special_products_price . '</div><div style="float: right;"><a class="moreinfobutton" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $special_products['products_id']). '">more info »</a></div></td>'; $col ++; if (($col > 0) || ($counter == $num_special_products)) { $special_prods_content .= '</tr>'; $col = 0; } } $special_prods_content .= '</table>'; ?> <div class="contentText"> <?php echo $special_prods_content; ?> </div> <?php } ?> Can anyone see what I am not :wacko: thanks Mark
♥bruyndoncx Posted December 13, 2013 Posted December 13, 2013 $special_products_price .= ' see the litte dot, that appends to the existing string , remove the dot KEEP CALM AND CARRY ON I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support). So if you are still here ? What are you waiting for ?! Find the most frequent unique errors to fix: grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt
PupStar Posted December 13, 2013 Author Posted December 13, 2013 $special_products_price .= ' see the litte dot, that appends to the existing string , remove the dot Carine, Thank you very much. I knew it was something simple but I just could not see it lol Mark
Recommended Posts
Archived
This topic is now archived and is closed to further replies.