ianhaney Posted June 16, 2012 Share Posted June 16, 2012 Hi I am doing a mobile version of my website www.irhtoys.co.uk/mobile-index.php it is all ok apart from I am changing one of the tabs that was Reviews to New Products I have copied the coding from my products_new.php page and is displaying the products and the prices but the prices are displaying as £0.00 Can any one help please The coding below is from my mobile-index.php <div id="categories"><div id="latestPosts-one"><div class="latestposts"> <h1>New Products</h1> <?php $products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name"; $products_new_split = new splitPageResults($products_new_query_raw, MAX_DISPLAY_PRODUCTS_NEW); $row = 0; $products_new_query = tep_db_query($products_new_split->sql_query); while ($products_new = tep_db_fetch_array($products_new_query)) { if ($new_price = tep_get_products_special_price($products_new['products_id'])) { $products_price = '<del>' . $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id'])) . '</del> <span class="productPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($products_new['products_tax_class_id'])) . '</span>'; } else { $products_price = $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id'])); } echo ' <div class="m productlisting"> <div class="m-image"><a href="' . tep_href_link(FILENAME_MOBILE_INFO, 'products_id=' . $products_new['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $products_new['products_image'], $products_new['products_name'], '50', '50') . '</a></div> <div class="m-name"><a href="' . tep_href_link(FILENAME_MOBILE_INFO, 'products_id=' . $products_new['products_id']) . '"><strong><u>' . $products_new['products_name'] . '</u></strong></a></div><br /> <div class="m-price">'. $currencies->display_price($new_price['products_price'], tep_get_tax_rate($products_new['products_tax_class_id'])) . '<br /></div></div><div class="clear"></div> ' . "\n"; if ((($row / 3) == floor($row / 3))) { } } ?> </div></div></div></div> The code below is from my products_new.php page if it helps <?php $products_new_query = tep_db_query($products_new_split->sql_query); while ($products_new = tep_db_fetch_array($products_new_query)) { if ($new_price = tep_get_products_special_price($products_new['products_id'])) { $products_price = '<del>' . $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id'])) . '</del> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($products_new['products_tax_class_id'])) . '</span>'; } else { $products_price = $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id'])); } ?> <tr> <td width="<?php echo SMALL_IMAGE_WIDTH + 10; ?>" valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $products_new['products_image'], $products_new['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?></td> <td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '"><strong><u>' . $products_new['products_name'] . '</u></strong></a><br />' . TEXT_DATE_ADDED . ' ' . tep_date_long($products_new['products_date_added']) . '<br />' . TEXT_PRICE . ' ' . $products_price; ?><?php echo tep_draw_separator('pixel_trans.gif', '10', '50'); ?></td> <td align="right" valign="middle" class="smallText"><?php echo tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', tep_href_link(FILENAME_PRODUCTS_NEW, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new['products_id'])); ?></td> </tr> <?php } ?> Quote Link to comment https://forums.phpfreaks.com/topic/264309-mobile-version-of-my-website/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.