Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

Hi there!

 

I´m trying to get specials on index, but the contributions i´ve tried has not satisfied me, i have my product listing in rows, (under eachother).

 

I´v managed to modify "mindsparx specials" so the products are under eachother but i cant get the special prices up.

 

Someone who can help me?

 

Best regards!

Posted

If there is nothing you like inthe add ons section, it might be a case of you need to write your own add on for this.

Nic

 

 

Thats myu problem i´m not so good to code myself,

 

But like i said, i´v managed to get specials in row like i want. but i cant get the code to get the special prices right.

 

Here is my New_products.php that i modified.

 

But i cant get special prices

 

<!--p /* $Id: new_products.php 1806 2008-01-11 22:48:15Z hpdl $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2008 osCommerce Released under the GNU General Public License */ --><!-- new_products //--><!--p $search = array ("'<script-->]*?>.*?'si", // Strip out javascript "'<[\/\!]*?[^<>]*?>'si", // Strip out html tags "'([\r\n])[\s]+'", // Strip out white space "'&(quot|#34);'i", // Replace html entities "'&(amp|#38);'i", "'&(lt|#60);'i", "'&(gt|#62);'i", "'&(nbsp|#160);'i", "'&(iexcl|#161);'i", "'&(cent|#162);'i", "'&(pound|#163);'i", "'&(copy|#169);'i", "'&#(\d+);'e"); // evaluate as php $replace = array ("", "", "\\1", "\"", "&", "<", ">", " ", chr(161), chr(162), chr(163), chr(169), "chr(\\1)"); $info_box_contents = array(); $info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B'))); ?> <div class="new_product" style="padding-bottom: 5px; padding-left: 8px; padding-top: 5px"><!--p echo sprintf(BOX_HEADING_SPECIALS, strftime('%B'))--></div><!--p if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) { $new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, pd.products_name, if(s.status, s.specials_new_products_price, p.products_price) as products_prix from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by RAND() limit " . MAX_DISPLAY_NEW_PRODUCTS); } else { $new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, p.products_price, pd.products_name, if(s.status, s.specials_new_products_price, p.products_price) as products_prix from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by RAND() limit " . MAX_DISPLAY_NEW_PRODUCTS); } $row = 0; $col = 0; $info_box_contents = array(); while ($new_products = tep_db_fetch_array($new_products_query)) { $sql = 'SELECT `products_description` FROM `products_description` WHERE products_id ='.$new_products['products_id'].' && language_id='.(int)$languages_id; $description_query = tep_db_query($sql); $description = mysql_fetch_array($description_query, MYSQL_ASSOC); $description['products_description'] = substr($description['products_description'], 0, 200);// mindsparx, Stripping down products description $desc_len = strlen($description['products_description']); $show['desc'] = $description['products_description'] ; $new_products['products_name'] = substr($new_products['products_name'], 0, 30); // mindsparx, Stripping down products name so we dont brake the tables if products name is to long $prod_name = $new_products['products_name'] ; $info_box_contents[$row][$col] = array('align' => 'left', 'params' => 'class="smallText" valign="top"', 'text'-->' <div style="padding: 5px"><table border="0" cellspacing="0" cellpadding="0" width="540"><tbody><tr><td colspan="2" height="0" valign="middle" bgcolor="#231f20"> </td></tr><tr><td><table border="0" cellspacing="0" cellpadding="0" width="100%" height="160" class="box_outline"><tbody><tr><td width="150" align="center" valign="middle"><a href="'%20.%20tep_href_link(FILENAME_PRODUCT_INFO,%20'products_id='%20.%20$new_products['products_id'])%20.%20'">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td><td align="left" valign="middle"><a href="'%20.%20tep_href_link(FILENAME_PRODUCT_INFO,%20'products_id='%20.%20$new_products['products_id'])%20.%20'">' . $prod_name . '</a> <table border="0" height="110" align="left"><tbody></tbody></table></td></tr></tbody></table></td></tr></tbody></table></div>' ); $col ++; if ($col > 0) { $col = 0; $row ++; } } new contentBox($info_box_contents); ?> <!-- new_products_eof //-->

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...