Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

jozinecko

Archived
  • Posts

    34
  • Joined

  • Last visited

Profile Information

  • Real Name
    Jozef Ziak

jozinecko's Achievements

  1. Hello, please how I get on output in xml feed full category path? here is my xml_feed.php thank you <?php /* $Id: xml_vitalprix.php,v 1.00 2005/04/55 10:00:hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Modified for VitalPrix by Damien Laureaux - Timoa Contact : [email protected] This little contribution is based on the contribution xml_guide.php created by Toucouleur.fr:[email protected] Copyright (c) 2003 osCommerce Released under the GNU General Public License */ Header( 'Content-Type: text/xml; charset=windows-1250' ); define ('DISPLAY_PRICE_WITH_TAX', true); echo '<?xml version = "1.0" encoding = "windows-1250"?>'; require('includes/application_top.php'); echo '<products>'."\n"; $language_code = (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) ? $HTTP_GET_VARS['language'] : DEFAULT_LANGUAGE; $included_categories_query = tep_db_query("SELECT c.categories_id, c.parent_id, cd.categories_name FROM " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd WHERE c.categories_id = cd.categories_id AND cd.language_id = FLOOR($languages_id)"); $inc_cat = array(); // Texte tronqué -------------------------------------------------- function cut_text($text,$nbcar=0) { $text = strip_tags(str_replace(array('<BR>','<br>'), "</P>\n<P>",html_entity_decode($text))); if (strlen($text) > $nbcar && (0!=$nbcar)) { $tmp_tb = explode( ' ', $text ); $tmp_count = 0; $tmp_O = ''; while(list(,$v) = each($tmp_tb)) { if (strlen($tmp_O) >= $nbcar) break; $tmp_O .= $v.' '; } $tmp_O = substr( $tmp_O, 0, strlen($tmp_O)-1 ); if ( count($tmp_tb) > 1 ) $tmp_O .= '...'; } else $tmp_O = $text; return $tmp_O; } while ($included_categories = tep_db_fetch_array($included_categories_query)) { $inc_cat[] = array ( 'id' => $included_categories['categories_id'], 'parent' => $included_categories['parent_id'], 'name' => $included_categories['categories_name']); } $cat_info = array(); for ($i=0; $i<sizeof($inc_cat); $i++) $cat_info[$inc_cat[$i]['id']] = array ( 'parent'=> $inc_cat[$i]['parent'], 'name' => $inc_cat[$i]['name'], 'path' => $inc_cat[$i]['id'], 'link' => '' ); for ($i=0; $i<sizeof($inc_cat); $i++) { $cat_id = $inc_cat[$i]['id']; while ($cat_info[$cat_id]['parent'] != 0){ $cat_info[$inc_cat[$i]['id']]['path'] = $cat_info[$cat_id]['parent'] . '_' . $cat_info[$inc_cat[$i]['id']]['path']; $cat_id = $cat_info[$cat_id]['parent']; } $link_array = split('_', $cat_info[$inc_cat[$i]['id']] ['path']); for ($j=0; $j<sizeof($link_array); $j++) { $cat_info[$inc_cat[$i]['id']]['link'] .= ' <a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $cat_info[$link_array[$j]]['path']) . '"><nobr>' . $cat_info[$link_array[$j]]['name'] . '</nobr></a> » '; } } $products_query = tep_db_query("SELECT p.*, pd.products_name, pd.products_description, pc.categories_id FROM " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc WHERE p.products_id = pd.products_id AND p.products_id = pc.products_id AND p.products_status = 1 AND pd.language_id = FLOOR($languages_id) ORDER BY pc.categories_id, pd.products_name"); $product_num = 0; while($products = tep_db_fetch_array($products_query)) { if (intval($products['manufacturers_id']) > 0) { $manufacturers_query = tep_db_query("SELECT manufacturers_name FROM " . TABLE_MANUFACTURERS . " WHERE manufacturers_id = " . $products['manufacturers_id']); $manufacturers_result = tep_db_fetch_array($manufacturers_query); $products['manufacturers_name'] = $manufacturers_result['manufacturers_name']; } $special_query = tep_db_query("SELECT specials_new_products_price FROM " . TABLE_SPECIALS . " WHERE products_id = " . $products['products_id'] . " AND status = '1'"); if ($special_result = tep_db_fetch_array($special_query)) { $products['products_special'] = 1; $products['products_special_price'] = $special_result['specials_new_products_price']; } else { $products['products_special'] = 0; $products['products_special_price'] = 0; } $product_num++; echo '<product>'."\n"; echo '<id>'. $products['products_id'] .'</id>'."\n";; echo '<name>'. $products['products_name'] .'</name>'."\n";; echo '<description>'. $products['products_name'] .'</description>'."\n";; echo '<price>'. round(tep_add_tax($products['products_price'], tep_get_tax_rate($products['products_tax_class_id']))).'</price>'."\n"; echo '<category>'.$cat_info[$products['categories_id']]['name'] . '</category>'."\n";; echo '<manufacturer>'.$products['manufacturers_name'].'</manufacturer>'."\n";; echo '<url>'. HTTP_SERVER . DIR_WS_HTTP_CATALOG . FILENAME_PRODUCT_INFO . '?products_id=' . $products['products_id'] .'</url>'."\n";; echo '<picture>'. HTTP_SERVER . DIR_WS_HTTP_CATALOG . DIR_WS_IMAGES . $products['products_image'] .'</picture>'."\n";; echo '<part_number>'. $products['products_id'] .'</part_number>'."\n";; echo '<shipping>'. 'ZDARMA' .'</shipping>'."\n";; echo '<availability><![CDATA['. 'podla popisu' .']]></availability>'."\n";; echo '</product>'."\n";; } echo '</products>'; require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  2. Hello, please how I can modify category language? because all like name, description is from actual language whitin category name. Please help me. here is my modified code: <?php /* $Id: rss.php,v 2.0 2007/05/12 19:30:06 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ /* * Include the application_top.php script */ require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_RSS); $navigation->remove_current_page(); // If the language is not specified $lang_query = tep_db_query("select languages_id, code from " . TABLE_LANGUAGES . " where languages_id = '" . (int)$languages_id . "'"); // Recover the code (fr, en, etc) and the id (1, 2, etc) of the current language if (tep_db_num_rows($lang_query)) { $lang_a = tep_db_fetch_array($lang_query); $lang_code = $lang_a['code']; } define(RSS_STRIP_HTML_TAGS,false); // If the default of your catalog is not what you want in your RSS feed, then // please change this three constants: // Enter an appropriate title for your website define(RSS_TITLE, STORE_NAME); // Enter your main shopping cart link define(WEBLINK, HTTP_SERVER); // Enter a description of your shopping cart define(DESCRIPTION, TITLE); ///////////////////////////////////////////////////////////// //That's it. No More Editing (Unless you renamed DB tables or need to switch //to SEO links (Apache Rewrite URL) ///////////////////////////////////////////////////////////// $store_name = STORE_NAME; $rss_title = RSS_TITLE; $weblink = WEBLINK; $description = DESCRIPTION; $email_address = STORE_OWNER_EMAIL_ADDRESS; $subtitle = ''; function replace_problem_characters($text) { $formattags = array("&"); $replacevals = array("&"); $text = str_replace($formattags, $replacevals, $text); //$in[] = '@&(amp|#038);@i'; $out[] = '&'; $in[] = '@&(#036);@i'; $out[] = '$'; $in[] = '@&(quot);@i'; $out[] = '"'; $in[] = '@&(#039);@i'; $out[] = '\''; $in[] = '@&(nbsp|#160);@i'; $out[] = ' '; $in[] = '@&(hellip|#8230);@i'; $out[] = '...'; $in[] = '@&(copy|#169);@i'; $out[] = '(c)'; $in[] = '@&(trade|#129);@i'; $out[] = '(tm)'; $in[] = '@&(lt|#60);@i'; $out[] = '<'; $in[] = '@&(gt|#62);@i'; $out[] = '>'; $in[] = '@&(laquo);@i'; $out[] = '«'; $in[] = '@&(raquo);@i'; $out[] = '»'; $in[] = '@&(deg);@i'; $out[] = '°'; $in[] = '@&(mdash);@i'; $out[] = '—'; $in[] = '@&(reg);@i'; $out[] = '®'; $in[] = '@&(–);@i'; $out[] = '-'; $text = preg_replace($in, $out, $text); return $text; } function strip_html_tags($str) { // $document should contain an HTML document. // This will remove HTML tags, javascript sections // and white space. It will also convert some // common HTML entities to their text equivalent. $search = array ("'<script[^>]*?>.*?</script>'si", // Strip out javascript "'<[/!]*?[^<>]*?>'si", // Strip out HTML tags //"'([rn])[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)"); return preg_replace($search, $replace, $str); } if(!function_exists('eval_rss_urls')) { function eval_rss_urls($string) { // rewrite all local urls to absolute urls return preg_replace_callback("/(href|src|action)=[\"']{0,1}(\.{0,2}[\\|\/]{1})(.*?)[\"']{0,1}( .*?){0,1}>/is","rewrite_rss_local_urls",$string); //"/(href|src|action)=[\"']{0,1}(\.{2}[\\|\/]{1})(.*?)[\"']{0,1}( .*?){0,1}>/is" } } function rewrite_rss_local_urls($string) { $repl_text = $string[0]; $repl_by = HTTP_SERVER.'\\'; $repl_len = 0; $index_pos = strpos ( $repl_text , '..'); if ($index_pos > -1) { $repl_len = 2; } else { $index_pos = strpos ( $repl_text , '\"\\'); if ($index_pos > -1) { $repl_len = 0; $index_pos+=1; } } if ($index_pos > -1) { substr_replace($repl_text, $repl_by, $index_pos,2 ); } ob_start(); echo $repl_text; $return = ob_get_contents(); ob_end_clean(); return $return; } // to strip html or not to strip html tags if (isset($HTTP_GET_VARS['html'])) { if ($HTTP_GET_VARS['html']=='false') { $strip_html_tags = true; } else { $strip_html_tags = false; } } else { $strip_html_tags = RSS_STRIP_HTML_TAGS; } // show the products of a specified manufacturer if (isset($HTTP_GET_VARS['manufacturers_id'])) { if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) { // We are asked to show only a specific category $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_model, p.products_price, p.products_image, p.products_date_added, pd.products_name, pd.products_description, m.manufacturers_name, cd.categories_name, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON p2c.categories_id = cd.categories_id where p.products_status = '1' and p.products_to_rss='1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' GROUP BY p.products_id ORDER BY p.products_id DESC LIMIT ". (int)MAX_RSS_ARTICLES.""; } else { // We show them all $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_model, p.products_price, p.products_image, p.products_date_added, pd.products_name, pd.products_description, m.manufacturers_name, cd.categories_name, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON p2c.categories_id = cd.categories_id where p.products_status = '1' and p.products_to_rss='1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' GROUP BY p.products_id ORDER BY p.products_id DESC LIMIT ". (int)MAX_RSS_ARTICLES.""; } $subtitle = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"); $subtitle = tep_db_fetch_array($subtitle); $subtitle = $subtitle['manufacturers_name']; $rss_title = BOX_INFORMATION_RSS_MANUFACTURER; } else if (tep_not_null($current_category_id)) { // show the products in a given categorie if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) { // We are asked to show only specific catgeory $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_model, p.products_price, p.products_image, p.products_date_added, pd.products_name, pd.products_description, m.manufacturers_name, cd.categories_name, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON p2c.categories_id = cd.categories_id where p.products_status = '1' and p.products_to_rss='1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "' GROUP BY p.products_id ORDER BY p.products_id DESC LIMIT ". (int)MAX_RSS_ARTICLES.""; } else { // We show them all $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_model, p.products_price, p.products_image, p.products_date_added, pd.products_name, pd.products_description, m.manufacturers_name, cd.categories_name, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON p2c.categories_id = cd.categories_id where p.products_status = '1' and p.products_to_rss='1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "' GROUP BY p.products_id ORDER BY p.products_id DESC LIMIT ". (int)MAX_RSS_ARTICLES.""; } $subtitle= tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'"); $subtitle = tep_db_fetch_array($subtitle); $subtitle = $subtitle['categories_name']; $rss_title = BOX_INFORMATION_RSS_CATEGORY; } else { // show realy al products $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_model, p.products_price, p.products_image, p.products_date_added, pd.products_name, pd.products_description, m.manufacturers_name, cd.categories_name, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON p2c.categories_id = cd.categories_id where p.products_status = '1' and p.products_to_rss='1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' GROUP BY p.products_id ORDER BY p.products_id DESC LIMIT ". (int)MAX_RSS_ARTICLES.""; $rss_title = BOX_INFORMATION_RSS; } // echo $listing_sql; // Execute SQL query and get result $query = tep_db_query($listing_sql); /* * If there are returned rows... * Basic sanity check */ if ( tep_db_num_rows($query) > 0 ){ if ($subtitle != '') $rss_title .= ' - '.$subtitle; // Encoding to UTF-8 //$store_name = utf8_encode (replace_problem_characters($store_name)); //$rss_title = utf8_encode (replace_problem_characters($rss_title)); //$weblink = utf8_encode ($weblink); //$description = utf8_encode (replace_problem_characters($description)); //$email_address = utf8_encode ($email_address); // SQL header(Last-Modified) $last_modified = ''; $sql = "SELECT MAX(products_date_added) as mPla, MAX(products_last_modified) as mPlm FROM products WHERE products_to_rss = '1' ORDER BY products_id DESC LIMIT 1"; $sql_result = tep_db_query($sql); $row = tep_db_fetch_array($sql_result); if ($row['mPlm'] != '') { $last_modified = $row['mPlm']; } else { $last_modified = $row['mpla']; } if(!function_exists('getallheaders')){ function getallheaders(){ settype($headers,'array'); foreach($_SERVER as $h => $v){ if(ereg('HTTP_(.+)',$h,$hp)){ $headers[$hp[1]] = $v; } } return $headers; } } $headers = getallheaders(); $refresh = 1; // refresca por defecto $etag = md5($last_modified); if(isset($headers["If-Modified-Since"])) { // Verificamos fecha enviada por el lector RSS $since = strtotime($headers["If-Modified-Since"]); if($since >= strtotime($last_modified)) { $refresh = 0; } } if(isset($headers["If-None-Match"])) { // Verificamos el ETag if(strcmp($headers["If-None-Match"], $etag) == 0) { $refresh = 0; } else { $refresh = 1; } } if($refresh == 0) { header("HTTP/1.1 304 Not changed"); // La primera línea de los headers debe ser el status // sino el Netcrap se lía y da "No Data" ob_end_clean(); // Descartamos los contenidos del búfer de salida en cola y lo deshabilitamos } // Begin sending of the data header('Content-Type: application/rss+xml; charset=windows-1250'); //header("Last-Modified: " . tep_date_raw($last_modified)); header('Last-Modified: ' .gmdate("D, d M Y G:i:s", strtotime($last_modified)). ' GMT'); //header('Last-Modified: ' .gmdate("D, d M Y G:i:s T",strtotime($last_modified)) . ' GMT'); header("ETag: " . md5($etag)); echo "<?xml version='1.0' encoding='windows-1250' ?>" . "\n"; ?> <CATALOG> <LOGO><?php echo $weblink . DIR_WS_CATALOG.'images/store_logo.png';?></LOGO> <?php // Format results by row while( $row = tep_db_fetch_array($query) ){ $id = $row['products_id']; // RSS Links for Ultimate SEO (Gareth Houston 10 May 2005) $link = tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $id, 'NONSSL', false); $model = $row['products_model']; $image = $row['products_image']; $added = date(r,strtotime($row['products_date_added'])); // Setting and cleaning the data $name = $row['products_name']; $desc = eval_rss_urls($row['products_description']); // Encoding to UTF-8 if ($strip_html_tags ==true) { $name = strip_html_tags($name); $desc = strip_html_tags($desc); } // $name = utf8_encode(replace_problem_characters($name)); // $desc = utf8_encode(replace_problem_characters($desc)); // $link = utf8_encode($link); $manufacturer = $row['manufacturers_name']; //$manufacturer = utf8_encode ($manufacturer); // $price = tep_add_tax($row['products_price'], tep_get_tax_rate($row['products_tax_class_id'])); if (tep_not_null($row['specials_new_products_price'])) { $price = tep_add_tax($row['specials_new_products_price'], tep_get_tax_rate($row['products_tax_class_id'])); } else { $price = tep_add_tax($row['products_price'], tep_get_tax_rate($row['products_tax_class_id'])); } if( $discount = tep_get_products_special_price($id) ) { $offer = tep_add_tax($discount, tep_get_tax_rate($row['products_tax_class_id'])); } else { $offer = ''; } //add price limit decimals to 2 $price = sprintf("%01.2f", $price); $cat_name = $row['categories_name']; // Encoding to UTF-8 // $cat_name = utf8_encode (replace_problem_characters(strip_html_tags($cat_name))); // Setting the URLs to the images and buttons $relative_image_url = tep_image(DIR_WS_IMAGES . $image, $name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'style="float: left; margin: 0px 8px 8px 0px;"'); $relative_image_url = str_replace('">', '', $relative_image_url); $relative_image_url = str_replace('<img src="', '', $relative_image_url); $image_url = HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $image; $relative_buy_url = tep_image_button('button_shopping_cart.gif', IMAGE_BUTTON_IN_CART, 'style="margin: 0px;"'); $relative_buy_url = str_replace('">', '', $relative_buy_url); $relative_buy_url = str_replace('<img src="', '', $relative_buy_url); $buy_url = HTTP_SERVER . DIR_WS_CATALOG . $relative_buy_url; $relative_button_url = tep_image_button('button_more_info.gif', IMAGE_BUTTON_MORE_INFO, 'style="margin: 0px;"'); $relative_button_url = str_replace('">', '', $relative_button_url); $relative_button_url = str_replace('<img src="', '', $relative_button_url); $button_url = HTTP_SERVER . DIR_WS_CATALOG . $relative_button_url; // http://www.w3.org/TR/REC-xml/#dt-chardata // The ampersand character (&) and the left angle bracket (<) MUST NOT appear in their literal form $name = str_replace('&','&',$name); $desc = str_replace('&','&',$desc); $link = str_replace('&','&',$link); //$cat_name = str_replace('&','&',$cat_name); $name = str_replace('<','<',$name); $desc = str_replace('<','<',$desc); $link = str_replace('<','<',$link); $cat_name = str_replace('<','<',$cat_name); $name = str_replace('>','>',$name); $desc = str_replace('>','>',$desc); $link = str_replace('>','>',$link); $cat_name = str_replace('>','>',$cat_name); $buy_link = tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $id); // Encoding to UTF-8 // $buy_link = utf8_encode ($buy_link); $buy_link = str_replace('&','&',$buy_link); $buy_link = str_replace('<','<',$buy_link); $buy_link = str_replace('>','>',$buy_link); // Writing the output echo '<ITEM>' . "\n"; echo ' <ID>' . $id . '</ID>' . "\n"; echo ' <TITLE>' . $name . '</TITLE>' . "\n"; echo ' <DESCRIPTION>' . $name . '</DESCRIPTION>' . "\n"; echo ' <PRICE>' . $price . '</PRICE>' . "\n"; echo ' <CATEGORY>' . $cat_name . '</CATEGORY>' . "\n"; echo ' <URL>' . $link . '</URL>' . "\n"; echo ' <IMAGE>' . $image_url . '</IMAGE>' . "\n"; echo ' <MANUFACTURER>' . $manufacturer . '</MANUFACTURER>' . "\n"; echo ' <DUES>' . 'ZADARMO V CELEJ SR' . '</DUES>' . "\n"; echo '</ITEM>' . "\n"; } } echo '</CATALOG>' . "\n"; /* * Include the application_bottom.php script */ include_once('includes/application_bottom.php'); ?>
  3. Hello, sorry if I dont chatch right topic, please is some addon which allow me in adding new product, chose some icon(pictograms) like HOT, NEW, ON STOCK, etc and this small icons will show after name in product listing. sorry for my grammar. Thank you for help. Jozef
  4. its all products on category pages, also in box but there is another issue because in box I have mod cycling product.
  5. I try overwrite with included files (index, aplication top, product info) and nothing work.
  6. hello, please where I can include there code, in index or aplication top?
  7. Hello, please have some done install this contrib with SPPC and price break installed? I try it, take care off all codes but is still dont work, when I log in like customer who have eg 30% sale and when he put it in shopping cart, the cost is like for retail and is need also put offer cost without TAX. And also we I false direct accept offers from admin panel I and click at "make an offer" at product info It show cost in email is about 226 times increas like is retail. Please can you some one help? I think all problems is in my shopping_cart.php and product_info.php Here is my modified shopping_cart.php <?php /* $Id: shopping_cart.php 1739 2007-12-20 00:52:16Z hpdl $ adapted for Separate Pricing Per Customer v4.2 2008/03/07, Hide products and categories from groups 2008/08/03, QPBPP for SPPC v2.0 2008/11/08 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ class shoppingCart { var $contents, $total, $weight, $cartID, $content_type; function shoppingCart() { $this->reset(); } function restore_contents() { global $customer_id, $languages_id; // languages_id needed for PriceFormatter - QPBPP if (!tep_session_is_registered('customer_id')) return false; // insert current cart contents in database if (is_array($this->contents)) { reset($this->contents); // BOF SPPC attribute hide/invalid check: loop through the shopping cart and check the attributes if they // are hidden for the now logged-in customer $this->cg_id = $this->get_customer_group_id(); while (list($products_id, ) = each($this->contents)) { // only check attributes if they are set for the product in the cart if (isset($this->contents[$products_id]['attributes'])) { $check_attributes_query = tep_db_query("select options_id, options_values_id, IF(find_in_set('" . $this->cg_id . "', attributes_hide_from_groups) = 0, '0', '1') as hide_attr_status from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . tep_get_prid($products_id) . "'"); while ($_check_attributes = tep_db_fetch_array($check_attributes_query)) { $check_attributes[] = $_check_attributes; } // end while ($_check_attributes = tep_db_fetch_array($check_attributes_query)) $no_of_check_attributes = count($check_attributes); $change_products_id = '0'; foreach($this->contents[$products_id]['attributes'] as $attr_option => $attr_option_value) { $valid_option = '0'; for ($x = 0; $x < $no_of_check_attributes ; $x++) { if ($attr_option == $check_attributes[$x]['options_id'] && $attr_option_value == $check_attributes[$x]['options_values_id']) { $valid_option = '1'; if ($check_attributes[$x]['hide_attr_status'] == '1') { // delete hidden attributes from array attributes, change products_id accordingly later $change_products_id = '1'; unset($this->contents[$products_id]['attributes'][$attr_option]); } } // end if ($attr_option == $check_attributes[$x]['options_id'].... } // end for ($x = 0; $x < $no_of_check_attributes ; $x++) if ($valid_option == '0') { // after having gone through the options for this product and not having found a matching one // we can conclude that apparently this is not a valid option for this product so remove it unset($this->contents[$products_id]['attributes'][$attr_option]); // change products_id accordingly later $change_products_id = '1'; } } // end foreach($this->contents[$products_id]['attributes'] as $attr_option => $attr_option_value) if ($change_products_id == '1') { $original_products_id = $products_id; $products_id = tep_get_prid($original_products_id); $products_id = tep_get_uprid($products_id, $this->contents[$original_products_id]['attributes']); // add the product without the hidden attributes to the cart $this->contents[$products_id] = $this->contents[$original_products_id]; // delete the originally added product with the hidden attributes unset($this->contents[$original_products_id]); } } // end if (isset($this->contents[$products_id]['attributes'])) } // end while (list($products_id, ) = each($this->contents)) reset($this->contents); // reset the array otherwise the cart will be emptied // EOF SPPC attribute hide/invalid check while (list($products_id, ) = each($this->contents)) { $qty = $this->contents[$products_id]['qty']; // BOF QPBPP for SPPC adjust quantity blocks and min_order_qty for this customer group // warnings about this are raised in PriceFormatter $pf = new PriceFormatter; $pf->loadProduct(tep_get_prid($products_id), $languages_id); $qty = $pf->adjustQty($qty); // EOF QPBPP for SPPC $product_query = tep_db_query("select products_id from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'"); if (!tep_db_num_rows($product_query)) { tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . tep_db_input($qty) . "', '" . date('Ymd') . "')"); if (isset($this->contents[$products_id]['attributes'])) { reset($this->contents[$products_id]['attributes']); while (list($option, $value) = each($this->contents[$products_id]['attributes'])) { tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$value . "')"); } } } else { tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . tep_db_input($qty) . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'"); } } } // reset per-session cart contents, but not the database contents $this->reset(false); // BOF QPBPP for SPPC $products_query = tep_db_query("select cb.products_id, ptdc.discount_categories_id, customers_basket_quantity from " . TABLE_CUSTOMERS_BASKET . " cb left join (select products_id, discount_categories_id from " . TABLE_PRODUCTS_TO_DISCOUNT_CATEGORIES . " where customers_group_id = '" . $this->cg_id . "') as ptdc on cb.products_id = ptdc.products_id where customers_id = '" . (int)$customer_id . "'"); // BOF SPPC Hide products and categories from groups $no_of_products_in_basket = 0; //ak by neslo vymenit while ($products = tep_db_fetch_array($products_query)) { while ($_products = tep_db_fetch_array($products_query)) { $temp_post_get_array[] = $_products['products_id']; $products[] = $_products; $no_of_products_in_basket += 1; } if ($no_of_products_in_basket > 0) { $hide_status_products = array(); $hide_status_products = tep_get_hide_status($hide_status_products, $this->cg_id, $temp_post_get_array); for ($i=0 ; $i < $no_of_products_in_basket; $i++) { foreach($hide_status_products as $key => $subarray) { if ($subarray['products_id'] == tep_get_prid($products[$i]['products_id']) && $subarray['hidden'] == '0') { // not hidden for this customer, can be added to the object shoppingCart $this->contents[$products[$i]['products_id']] = array('qty' => $products['customers_basket_quantity'], 'discount_categories_id' => $products['discount_categories_id']); //ak by neslo odkomentovat a vymenit - original hiden for SPPC $this->contents[$products['products_id']] = array('qty' => $products['customers_basket_quantity'], 'discount_categories_id' => $products['discount_categories_id']); // EOF QPBPP for SPPC // attributes $attributes_query = tep_db_query("select products_options_id, products_options_value_id from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products[$i]['products_id']) . "'"); while ($attributes = tep_db_fetch_array($attributes_query)) { $this->contents[$products[$i]['products_id']]['attributes'][$attributes['products_options_id']] = $attributes['products_options_value_id']; } } elseif ($subarray['products_id'] == tep_get_prid($products[$i]['products_id']) && $subarray['hidden'] == '1') { // product is hidden for the customer, don't add to object shoppingCart, delete from db next $products_to_delete_from_cb[] = $products[$i]['products_id']; } // end if/elseif }// end foreach ($hide_status_products as $key => $subarray) } // end for ($i=0 ; $i < $no_of_products_in_basket; $i++) // delete from the database those products that are hidden from this customer if (tep_not_null($products_to_delete_from_cb)) { $no_of_iterations = count($products_to_delete_from_cb); // since the products_id in the table customer_basket and customer_basket_attributes can contain // attributes like 1{4}2{3}6 we need to delete them one by one for the two tables for ($y = 0; $y < $no_of_iterations; $y++) { tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and (products_id = '" . (int)$products_to_delete_from_cb[$y] . "' or products_id REGEXP '^" . (int)$products_to_delete_from_cb[$y] . "{');"); tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and (products_id = '" . (int)$products_to_delete_from_cb[$y] . "' or products_id REGEXP '^" . (int)$products_to_delete_from_cb[$y] . "{');"); } // end for ($y = 0; $y < $no_of_iterations; $y++) } // end if (tep_not_null($products_to_delete_from_cb)) } // end if ($no_of_products_in_basket > 0) // EOF SPPC Hide products and categories from groups $this->cleanup(); } function reset($reset_database = false) { global $customer_id; $this->contents = array(); $this->total = 0; $this->weight = 0; $this->content_type = false; if (tep_session_is_registered('customer_id') && ($reset_database == true)) { tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "'"); tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "'"); // BOF MAO addition: remove the complete session for accepted offers if (MAO_ACCEPT_OFFER_DIRECTLY == 'true') { if (tep_session_is_registered('mao_accepted_offer')) { tep_session_unregister('mao_accepted_offer'); } } // EOF MAO addition: remove the complete session for accepted offers } unset($this->cartID); if (tep_session_is_registered('cartID')) tep_session_unregister('cartID'); } function add_cart($products_id, $qty = '1', $attributes = '', $notify = true) { global $new_products_id_in_cart, $customer_id; // BOF Separate Pricing Per Customer $this->cg_id = $this->get_customer_group_id(); // EOF Separate Pricing Per Customer $products_id_string = tep_get_uprid($products_id, $attributes); $products_id = tep_get_prid($products_id_string); if (defined('MAX_QTY_IN_CART') && (MAX_QTY_IN_CART > 0) && ((int)$qty > MAX_QTY_IN_CART)) { $qty = MAX_QTY_IN_CART; } // BOF QPBPP for SPPC $pf = new PriceFormatter; $pf->loadProduct($products_id); $qty = $pf->adjustQty($qty); $discount_category = $pf->get_discount_category(); // EOF QPBPP for SPPC $attributes_pass_check = true; if (is_array($attributes)) { reset($attributes); while (list($option, $value) = each($attributes)) { if (!is_numeric($option) || !is_numeric($value)) { $attributes_pass_check = false; break; } } } if (is_numeric($products_id) && is_numeric($qty) && ($attributes_pass_check == true)) { // BOF SPPC attribute hide check, original query expanded to include attributes $check_product_query = tep_db_query("select p.products_status, options_id, options_values_id, IF(find_in_set('" . $this->cg_id . "', attributes_hide_from_groups) = 0, '0', '1') as hide_attr_status, p.products_lead_time from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_ATTRIBUTES . " using(products_id) where p.products_id = '" . (int)$products_id . "'"); while ($_check_product = tep_db_fetch_array($check_product_query)) { $check_product[] = $_check_product; } // end while ($_check_product = tep_db_fetch_array($check_product_query)) $no_of_check_product = count($check_product); if (is_array($attributes)) { foreach($attributes as $attr_option => $attr_option_value) { $valid_option = '0'; for ($x = 0; $x < $no_of_check_product ; $x++) { if ($attr_option == $check_product[$x]['options_id'] && $attr_option_value == $check_product[$x]['options_values_id']) { $valid_option = '1'; if ($check_product[$x]['hide_attr_status'] == '1') { // delete hidden attributes from array attributes unset($attributes[$attr_option]); } } // end if ($attr_option == $check_product[$x]['options_id'].... } // end for ($x = 0; $x < $no_of_check_product ; $x++) if ($valid_option == '0') { // after having gone through the options for this product and not having found a matching one // we can conclude that apparently this is not a valid option for this product so remove it unset($attributes[$attr_option]); } } // end foreach($attributes as $attr_option => $attr_option_value) } // end if (is_array($attributes)) // now attributes have been checked and hidden and invalid ones deleted make the $products_id_string again $products_id_string = tep_get_uprid($products_id, $attributes); if ((isset($check_product) && tep_not_null($check_product)) && ($check_product[0]['products_status'] == '1')) { // EOF SPPC attribute hide check if ($notify == true) { $new_products_id_in_cart = $products_id; tep_session_register('new_products_id_in_cart'); } // BOF QPBPP for SPPC if ($this->in_cart($products_id_string)) { $this->update_quantity($products_id_string, $qty, $attributes, $discount_category); } else { $this->contents[$products_id_string] = array('qty' => (int)$qty, 'discount_categories_id' => $discount_category); // EOF QPBPP for SPPC // insert into database if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id_string) . "', '" . (int)$qty . "', '" . date('Ymd') . "')"); if (is_array($attributes)) { reset($attributes); while (list($option, $value) = each($attributes)) { $this->contents[$products_id_string]['attributes'][$option] = $value; // insert into database if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id_string) . "', '" . (int)$option . "', '" . (int)$value . "')"); } } } $this->cleanup(); // assign a temporary unique ID to the order contents to prevent hack attempts during the checkout procedure $this->cartID = $this->generate_cart_id(); } } } // BOF QPBPP for SPPC function update_quantity($products_id, $quantity = '', $attributes = '', $discount_categories_id = NULL) { // EOF QPBPP for SPPC global $customer_id; $products_id_string = tep_get_uprid($products_id, $attributes); $products_id = tep_get_prid($products_id_string); if (defined('MAX_QTY_IN_CART') && (MAX_QTY_IN_CART > 0) && ((int)$quantity > MAX_QTY_IN_CART)) { $quantity = MAX_QTY_IN_CART; } $attributes_pass_check = true; if (is_array($attributes)) { reset($attributes); while (list($option, $value) = each($attributes)) { if (!is_numeric($option) || !is_numeric($value)) { $attributes_pass_check = false; break; } } } if (is_numeric($products_id) && isset($this->contents[$products_id_string]) && is_numeric($quantity) && ($attributes_pass_check == true)) { // BOF QPBPP for SPPC $this->contents[$products_id_string] = array('qty' => (int)$quantity, 'discount_categories_id' => $discount_categories_id); // EOF QPBPP for SPPC // update database if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . (int)$quantity . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id_string) . "'"); if (is_array($attributes)) { reset($attributes); while (list($option, $value) = each($attributes)) { $this->contents[$products_id_string]['attributes'][$option] = $value; // update database if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " set products_options_value_id = '" . (int)$value . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id_string) . "' and products_options_id = '" . (int)$option . "'"); } } } } function cleanup() { global $customer_id; reset($this->contents); while (list($key,) = each($this->contents)) { if ($this->contents[$key]['qty'] < 1) { unset($this->contents[$key]); // remove from database if (tep_session_is_registered('customer_id')) { tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($key) . "'"); tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($key) . "'"); } } } } function count_contents() { // get total number of items in cart $total_items = 0; if (is_array($this->contents)) { reset($this->contents); while (list($products_id, ) = each($this->contents)) { $total_items += $this->get_quantity($products_id); } } return $total_items; } function get_quantity($products_id) { if (isset($this->contents[$products_id])) { return $this->contents[$products_id]['qty']; } else { return 0; } } function in_cart($products_id) { if (isset($this->contents[$products_id])) { return true; } else { return false; } } function remove($products_id) { global $customer_id; // BOF MAO addition: remove the selected product only from the mao session if (MAO_ACCEPT_OFFER_DIRECTLY == 'true') { if (tep_session_is_registered('mao_accepted_offer')) { $mao_temp_accepted = array(); for ($k=0, $l=sizeof($_SESSION['mao_accepted_offer']); $k<$l; $k++) { $pos = strpos($products_id,"{"); if ($pos === false) { if ($_SESSION['mao_accepted_offer'][$k]['productid'] == $products_id) { // do nothing, skip the product which should be deleted } else { // add again to the array the product(s) which stay in the shopping cart $mao_accepted = array('productid' => $_SESSION['mao_accepted_offer'][$k]['productid'],'newprice' => $_SESSION['mao_accepted_offer'][$k]['newprice'],'initialvaluta' => $_SESSION['mao_accepted_offer'][$k]['initialvaluta']); array_push($mao_temp_accepted, $mao_accepted); } } else { if ($_SESSION['mao_accepted_offer'][$k]['productid'] == substr($products_id,0,$pos)) { // do nothing, skip the product which should be deleted } else { // add again to the array the product(s) which stay in the shopping cart $mao_accepted = array('productid' => $_SESSION['mao_accepted_offer'][$k]['productid'],'newprice' => $_SESSION['mao_accepted_offer'][$k]['newprice'],'initialvaluta' => $_SESSION['mao_accepted_offer'][$k]['initialvaluta']); array_push($mao_temp_accepted, $mao_accepted); } } } // Update the MAO session with the remaining shopping cart products $_SESSION['mao_accepted_offer'] = $mao_temp_accepted; } } // EOF Make an offer unset($this->contents[$products_id]); // remove from database if (tep_session_is_registered('customer_id')) { tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'"); tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'"); } // assign a temporary unique ID to the order contents to prevent hack attempts during the checkout procedure $this->cartID = $this->generate_cart_id(); } function remove_all() { $this->reset(); // BOF Make an offer // MAO addition: remove the complete session for accepted offers if (MAO_ACCEPT_OFFER_DIRECTLY == 'true') { if (tep_session_is_registered('mao_accepted_offer')) { tep_session_unregister('mao_accepted_offer'); } } // EOF Make an offer } function get_product_id_list() { $product_id_list = ''; if (is_array($this->contents)) { reset($this->contents); while (list($products_id, ) = each($this->contents)) { $product_id_list .= ', ' . $products_id; } } return substr($product_id_list, 2); } function calculate() { global $currencies, $languages_id, $pfs, $currency; // for QPBPP added: $languages_id, $pfs $this->total = 0; $this->weight = 0; if (!is_array($this->contents)) return 0; // BOF Separate Pricing Per Customer // global variable (session) $sppc_customer_group_id -> class variable cg_id $this->cg_id = $this->get_customer_group_id(); // EOF Separate Pricing Per Customer // BOF QPBPP for SPPC $discount_category_quantity = array(); // calculates no of items per discount category in shopping basket foreach ($this->contents as $products_id => $contents_array) { if(tep_not_null($contents_array['discount_categories_id'])) { if (!isset($discount_category_quantity[$contents_array['discount_categories_id']])) { $discount_category_quantity[$contents_array['discount_categories_id']] = $contents_array['qty']; } else { $discount_category_quantity[$contents_array['discount_categories_id']] += $contents_array['qty']; } } } // end foreach $pf = new PriceFormatter; // EOF QPBPP for SPPC reset($this->contents); while (list($products_id, ) = each($this->contents)) { $qty = $this->contents[$products_id]['qty']; // BOF QPBPP for SPPC if (tep_not_null($this->contents[$products_id]['discount_categories_id'])) { $nof_items_in_cart_same_cat = $discount_category_quantity[$this->contents[$products_id]['discount_categories_id']]; $nof_other_items_in_cart_same_cat = $nof_items_in_cart_same_cat - $qty; } else { $nof_other_items_in_cart_same_cat = 0; } // EOF QPBPP for SPPC // products price // BOF QPBPP for SPPC $pf->loadProduct($products_id, $languages_id); if ($product = $pfs->getPriceFormatterData($products_id)) { $prid = $product['products_id']; $products_tax = tep_get_tax_rate($product['products_tax_class_id']); $products_price = $pf->computePrice($qty, $nof_other_items_in_cart_same_cat); // EOF QPBPP for SPPC $products_weight = $product['products_weight']; // BOF Separate Pricing Per Customer /* $specials_price = tep_get_products_special_price((int)$prid); if (tep_not_null($specials_price)) { $products_price = $specials_price; } elseif ($this->cg_id != 0){ $customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$prid . "' and customers_group_id = '" . $this->cg_id . "'"); if ($customer_group_price = tep_db_fetch_array($customer_group_price_query)) { $products_price = $customer_group_price['customers_group_price']; } } */ // EOF Separate Pricing Per Customer // BOF Addition for Make An Offer if (MAO_ACCEPT_OFFER_DIRECTLY == 'true') { if (tep_session_is_registered('mao_accepted_offer')) { for ($k=0, $l=sizeof($_SESSION['mao_accepted_offer']); $k<$l; $k++) { $pos = strpos($prid,"{"); if ($pos === false) { if ($prid == $_SESSION['mao_accepted_offer'][$k]['productid']) { // Check for valuta change after an offer already has been made if (strcasecmp($_SESSION['mao_accepted_offer'][$k]['initialvaluta'],$currency) == 0) { // Valuta is the original valuta for the offer // We have to calculate back first as the currency class will // alwasy do a rate multiply. This is neccessary in case an offer // has been made in a non-default currency $rate = $currencies->currencies[$currency]['value']; $products_price = mao_priceoffer($_SESSION['mao_accepted_offer'][$k]['newprice'])/$rate; } else { // Neccessary to keep the correct amount if a customer // switches between different valuta $products_price = mao_priceoffer($_SESSION['mao_accepted_offer'][$k]['newprice'])*(1/$currencies->currencies[$_SESSION['mao_accepted_offer'][$k]['initialvaluta']]['value']); } break; } } else { if (substr($prid,0,$pos) == $_SESSION['mao_accepted_offer'][$k]['productid']) { // Check for valuta change after an offer already has been made if (strcasecmp($_SESSION['mao_accepted_offer'][$k]['initialvaluta'],$currency) == 0) { // Valuta is the original valuta for the offer // We have to calculate back first as the currency class will // alwasy do a rate multiply. This is neccessary in case an offer // has been made in a non-default currency $rate = $currencies->currencies[$currency]['value']; $products_price = mao_priceoffer($_SESSION['mao_accepted_offer'][$k]['newprice'])/$rate + $cart->attributes_price($prid); } else { // Neccessary to keep the correct amount if a customer // switches between different valuta $products_price = mao_priceoffer($_SESSION['mao_accepted_offer'][$k]['newprice'])*(1/$currencies->currencies[$_SESSION['mao_accepted_offer'][$k]['initialvaluta']]['value']) + $cart->attributes_price($prid); } break; } } } } } // EOF Make an offer $this->total += $currencies->calculate_price($products_price, $products_tax, $qty); $this->weight += ($qty * $products_weight); } // attributes price // BOF SPPC attributes mod if (isset($this->contents[$products_id]['attributes'])) { reset($this->contents[$products_id]['attributes']); $where = " AND (("; while (list($option, $value) = each($this->contents[$products_id]['attributes'])) { $where .= "options_id = '" . (int)$option . "' AND options_values_id = '" . (int)$value . "') OR ("; } $where=substr($where, 0, -5) . ')'; $attribute_price_query = tep_db_query("SELECT products_attributes_id, options_values_price, price_prefix FROM " . TABLE_PRODUCTS_ATTRIBUTES . " WHERE products_id = '" . (int)$products_id . "'" . $where .""); if (tep_db_num_rows($attribute_price_query)) { $list_of_prdcts_attributes_id = ''; // empty array $attribute_price $attribute_price = array(); while ($attributes_price_array = tep_db_fetch_array($attribute_price_query)) { $attribute_price[] = $attributes_price_array; $list_of_prdcts_attributes_id .= $attributes_price_array['products_attributes_id'].","; } if (tep_not_null($list_of_prdcts_attributes_id) && $this->cg_id != '0') { $select_list_of_prdcts_attributes_ids = "(" . substr($list_of_prdcts_attributes_id, 0 , -1) . ")"; $pag_query = tep_db_query("select products_attributes_id, options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES_GROUPS . " where products_attributes_id IN " . $select_list_of_prdcts_attributes_ids . " AND customers_group_id = '" . $this->cg_id . "'"); while ($pag_array = tep_db_fetch_array($pag_query)) { $cg_attr_prices[] = $pag_array; } // substitute options_values_price and prefix for those for the customer group (if available) if ($customer_group_id != '0' && tep_not_null($cg_attr_prices)) { for ($n = 0 ; $n < count($attribute_price); $n++) { for ($i = 0; $i < count($cg_attr_prices) ; $i++) { if ($cg_attr_prices[$i]['products_attributes_id'] == $attribute_price[$n]['products_attributes_id']) { $attribute_price[$n]['price_prefix'] = $cg_attr_prices[$i]['price_prefix']; $attribute_price[$n]['options_values_price'] = $cg_attr_prices[$i]['options_values_price']; } } // end for ($i = 0; $i < count($cg_att_prices) ; $i++) } } // end if ($customer_group_id != '0' && (tep_not_null($cg_attr_prices)) } // end if (tep_not_null($list_of_prdcts_attributes_id) && $customer_group_id != '0') // now loop through array $attribute_price to add up/substract attribute prices for ($n = 0 ; $n < count($attribute_price); $n++) { if ($attribute_price[$n]['price_prefix'] == '+') { $this->total += $currencies->calculate_price($attribute_price[$n]['options_values_price'], $products_tax, $qty); } else { $this->total -= $currencies->calculate_price($attribute_price[$n]['options_values_price'], $products_tax, $qty); } } // end for ($n = 0 ; $n < count($attribute_price); $n++) } // end if (tep_db_num_rows($attribute_price_query)) } // end if (isset($this->contents[$products_id]['attributes'])) } } // EOF SPPC attributes mod // function attributes_price changed partially according to FalseDawn's post // http://www.oscommerce.com/forums/index.php?showtopic=139587 // changed completely for Separate Pricing Per Customer, attributes mod function attributes_price($products_id) { // global variable (session) $sppc_customer_group_id -> class variable cg_id $this->cg_id = $this->get_customer_group_id(); if (isset($this->contents[$products_id]['attributes'])) { reset($this->contents[$products_id]['attributes']); $where = " AND (("; while (list($option, $value) = each($this->contents[$products_id]['attributes'])) { $where .= "options_id = '" . (int)$option . "' AND options_values_id = '" . (int)$value . "') OR ("; } $where=substr($where, 0, -5) . ')'; $attribute_price_query = tep_db_query("SELECT products_attributes_id, options_values_price, price_prefix FROM " . TABLE_PRODUCTS_ATTRIBUTES . " WHERE products_id = '" . (int)$products_id . "'" . $where .""); if (tep_db_num_rows($attribute_price_query)) { $list_of_prdcts_attributes_id = ''; while ($attributes_price_array = tep_db_fetch_array($attribute_price_query)) { $attribute_price[] = $attributes_price_array; $list_of_prdcts_attributes_id .= $attributes_price_array['products_attributes_id'].","; } if (tep_not_null($list_of_prdcts_attributes_id) && $this->cg_id != '0') { $select_list_of_prdcts_attributes_ids = "(" . substr($list_of_prdcts_attributes_id, 0 , -1) . ")"; $pag_query = tep_db_query("select products_attributes_id, options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES_GROUPS . " where products_attributes_id IN " . $select_list_of_prdcts_attributes_ids . " AND customers_group_id = '" . $this->cg_id . "'"); while ($pag_array = tep_db_fetch_array($pag_query)) { $cg_attr_prices[] = $pag_array; } // substitute options_values_price and prefix for those for the customer group (if available) if ($customer_group_id != '0' && tep_not_null($cg_attr_prices)) { for ($n = 0 ; $n < count($attribute_price); $n++) { for ($i = 0; $i < count($cg_attr_prices) ; $i++) { if ($cg_attr_prices[$i]['products_attributes_id'] == $attribute_price[$n]['products_attributes_id']) { $attribute_price[$n]['price_prefix'] = $cg_attr_prices[$i]['price_prefix']; $attribute_price[$n]['options_values_price'] = $cg_attr_prices[$i]['options_values_price']; } } // end for ($i = 0; $i < count($cg_att_prices) ; $i++) } } // end if ($customer_group_id != '0' && (tep_not_null($cg_attr_prices)) } // end if (tep_not_null($list_of_prdcts_attributes_id) && $customer_group_id != '0') // now loop through array $attribute_price to add up/substract attribute prices for ($n = 0 ; $n < count($attribute_price); $n++) { if ($attribute_price[$n]['price_prefix'] == '+') { $attributes_price += $attribute_price[$n]['options_values_price']; } else { $attributes_price -= $attribute_price[$n]['options_values_price']; } } // end for ($n = 0 ; $n < count($attribute_price); $n++) return $attributes_price; } else { // end if (tep_db_num_rows($attribute_price_query)) return 0; } } else { // end if (isset($this->contents[$products_id]['attributes'])) return 0; } } // end of function attributes_price, modified for SPPC with attributes function get_products() { global $languages_id, $pfs, $currency, $currencies; // PriceFormatterStore added and Make an offer added $currency, $currencies // BOF Separate Pricing Per Customer $this->cg_id = $this->get_customer_group_id(); // EOF Separate Pricing Per Customer if (!is_array($this->contents)) return false; // BOF QPBPP for SPPC $discount_category_quantity = array(); foreach ($this->contents as $products_id => $contents_array) { if(tep_not_null($contents_array['discount_categories_id'])) { if (!isset($discount_category_quantity[$contents_array['discount_categories_id']])) { $discount_category_quantity[$contents_array['discount_categories_id']] = $contents_array['qty']; } else { $discount_category_quantity[$contents_array['discount_categories_id']] += $contents_array['qty']; } } } // end foreach $pf = new PriceFormatter; // EOF QPBPP for SPPC $products_array = array(); reset($this->contents); while (list($products_id, ) = each($this->contents)) { // BOF QPBPP for SPPC $pf->loadProduct($products_id, $languages_id); // does query if necessary and adds to // PriceFormatterStore or gets info from it next if ($products = $pfs->getPriceFormatterData($products_id)) { if (tep_not_null($this->contents[$products_id]['discount_categories_id'])) { $nof_items_in_cart_same_cat = $discount_category_quantity[$this->contents[$products_id]['discount_categories_id']]; $nof_other_items_in_cart_same_cat = $nof_items_in_cart_same_cat - $this->contents[$products_id]['qty']; } else { $nof_other_items_in_cart_same_cat = 0; } $products_price = $pf->computePrice($this->contents[$products_id]['qty'], $nof_other_items_in_cart_same_cat); // EOF QPBPP for SPPC // BOF Addition for Make An Offer if (MAO_ACCEPT_OFFER_DIRECTLY == 'true') { if (tep_session_is_registered('mao_accepted_offer')) { for ($k=0, $l=sizeof($_SESSION['mao_accepted_offer']); $k<$l; $k++) { $pos = strpos($prid,"{"); if ($pos === false) { if ($prid == $_SESSION['mao_accepted_offer'][$k]['productid']) { // Check for valuta change after an offer already has been made if (strcasecmp($_SESSION['mao_accepted_offer'][$k]['initialvaluta'],$currency) == 0) { // Valuta is the original valuta for the offer // We have to calculate back first as the currency class will // alwasy do a rate multiply. This is neccessary in case an offer // has been made in a non-default currency $rate = $currencies->currencies[$currency]['value']; $products_price = mao_priceoffer($_SESSION['mao_accepted_offer'][$k]['newprice'])/$rate; } else { // Neccessary to keep the correct amount if a customer // switches between different valuta $products_price = mao_priceoffer($_SESSION['mao_accepted_offer'][$k]['newprice'])*(1/$currencies->currencies[$_SESSION['mao_accepted_offer'][$k]['initialvaluta']]['value']); } break; } } else { if (substr($prid,0,$pos) == $_SESSION['mao_accepted_offer'][$k]['productid']) { // Check for valuta change after an offer already has been made if (strcasecmp($_SESSION['mao_accepted_offer'][$k]['initialvaluta'],$currency) == 0) { // Valuta is the original valuta for the offer // We have to calculate back first as the currency class will // alwasy do a rate multiply. This is neccessary in case an offer // has been made in a non-default currency $rate = $currencies->currencies[$currency]['value']; $products_price = mao_priceoffer($_SESSION['mao_accepted_offer'][$k]['newprice'])/$rate + $cart->attributes_price($prid); } else { // Neccessary to keep the correct amount if a customer // switches between different valuta $products_price = mao_priceoffer($_SESSION['mao_accepted_offer'][$k]['newprice'])*(1/$currencies->currencies[$_SESSION['mao_accepted_offer'][$k]['initialvaluta']]['value']) + $cart->attributes_price($prid); } break; } } } } } // EOF make an offer $products_array[] = array('id' => $products_id, 'name' => $products['products_name'], 'model' => $products['products_model'], 'image' => $products['products_image'], // BOF QPBPP for SPPC 'discount_categories_id' => $this->contents[$products_id]['discount_categories_id'], // EOF QPBPP for SPPC 'price' => $products_price, 'quantity' => $this->contents[$products_id]['qty'], 'weight' => $products['products_weight'], 'final_price' => ($products_price + $this->attributes_price($products_id)), 'tax_class_id' => $products['products_tax_class_id'], 'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''), 'lead_time' => $products['products_lead_time']); } } return $products_array; } function show_total() { $this->calculate(); return $this->total; } function show_weight() { $this->calculate(); return $this->weight; } function generate_cart_id($length = 5) { return tep_create_random_value($length, 'digits'); } function get_content_type() { $this->content_type = false; if ( (DOWNLOAD_ENABLED == 'true') && ($this->count_contents() > 0) ) { reset($this->contents); while (list($products_id, ) = each($this->contents)) { if (isset($this->contents[$products_id]['attributes'])) { reset($this->contents[$products_id]['attributes']); while (list(, $value) = each($this->contents[$products_id]['attributes'])) { $virtual_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad where pa.products_id = '" . (int)$products_id . "' and pa.options_values_id = '" . (int)$value . "' and pa.products_attributes_id = pad.products_attributes_id"); $virtual_check = tep_db_fetch_array($virtual_check_query); if ($virtual_check['total'] > 0) { switch ($this->content_type) { case 'physical': $this->content_type = 'mixed'; return $this->content_type; break; default: $this->content_type = 'virtual'; break; } } else { switch ($this->content_type) { case 'virtual': $this->content_type = 'mixed'; return $this->content_type; break; default: $this->content_type = 'physical'; break; } } } } else { switch ($this->content_type) { case 'virtual': $this->content_type = 'mixed'; return $this->content_type; break; default: $this->content_type = 'physical'; break; } } } } else { $this->content_type = 'physical'; } return $this->content_type; } function unserialize($broken) { for(reset($broken);$kv=each($broken);) { $key=$kv['key']; if (gettype($this->$key)!="user function") $this->$key=$kv['value']; } } // added for Separate Pricing Per Customer, returns customer_group_id function get_customer_group_id() { if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') { $_cg_id = $_SESSION['sppc_customer_group_id']; } else { $_cg_id = 0; } return $_cg_id; } } ?> and here is my moddified product_info.php <?php /* $Id: product_info.php 1739 2007-12-20 00:52:16Z hpdl $ adapted for Separate Pricing Per Customer v4.2 2007/06/23, Hide products and categories from groups 2008/08/05, adapted for QPBPP for SPPC v2.0 2008/11/0 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO); // BOF Added for Make An Offer require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_MAKE_AN_OFFER); // EOF Added for Make An Offer // BOF Separate Pricing Per Customer, Hide products and categories from groups if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') { $customer_group_id = $_SESSION['sppc_customer_group_id']; } else { $customer_group_id = '0'; } $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0"); $product_check = tep_db_fetch_array($product_check_query); // EOF Separate Pricing Per Customer, Hide products and categories from groups ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <link rel="stylesheet" href="lightbox/prettyPhoto.css" type="text/css" title="prettyPhoto main stylesheet" charset="utf-8" /> <script src="lightbox/jquery-1.2.3.pack.js" type="text/javascript" charset="utf-8"></script> <script src="lightbox/prettyPhoto.js" type="text/javascript" charset="utf-8"></script> <?php if (!isset($lng) || (isset($lng) && !is_object($lng))) { include_once(DIR_WS_CLASSES . 'language.php'); $lng = new language; } reset($lng->catalog_languages); while (list($key, $value) = each($lng->catalog_languages)) { ?> <link rel="alternate" type="application/rss+xml" title="<?php echo STORE_NAME . ' - ' . BOX_INFORMATION_RSS; ?>" href="<?php echo FILENAME_RSS, '?language=' . $key.((isset($_GET['cPath']))?'&cPath='.$_GET['cPath']:'').((isset($_GET['manufacturers_id']))?'&manufacturers_id='.$_GET['manufacturers_id']:''); ?>"> <?php } ?> <!-- BOF SUHY - multiple image --> <script> // Script Source: CodeLifter.com // Copyright 2003 // Do not remove this notice. // SETUPS: // =============================== // Set the horizontal and vertical position for the popup PositionX = 100; PositionY = 100; // Set these value approximately 20 pixels greater than the // size of the largest image to be used (needed for Netscape) defaultWidth = 750; defaultHeight = 750; // Set autoclose true to have the window close automatically // Set autoclose false to allow multiple popup windows var AutoClose = true; // Do not edit below this line... // ================================ if (parseInt(navigator.appVersion.charAt(0))>=4){ var isNN=(navigator.appName=="Netscape")?1:0; var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;} var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY; var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY; function popImage(imageURL,imageTitle){ if (isNN){imgWin=window.open('about:blank','',optNN);} if (isIE){imgWin=window.open('about:blank','',optIE);} with (imgWin.document){ writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>'); writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){'); writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}'); writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(300,300);'); writeln('width=300-(document.body.clientWidth-document.images[0].width);'); writeln('height=300-(document.body.clientHeight-document.images[0].height);'); writeln('window.resizeTo(width,height);}');writeln('if (isNN){'); writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}'); writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>'); if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">') else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">'); writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>'); close(); }} </script> <link rel="stylesheet" href="thumbnailviewer2.css" type="text/css"> <!-- EOF SUHY - multiple image --> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <div id="wrapper"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0"> <?php if ($product_check['total'] < 1) { // BOF Separate Pricing Per Customer, Hide products and categories from groups $hide_product = true; // needed for column_right // EOF Separate Pricing Per Customer, Hide products and categories from groups ?> <tr> <td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <?php } else { // suhy - multiple image addedp.product_image_2, p.product_image_3, p.product_image_4, p.product_image_5, p.product_image_6, $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_make_an_offer, p.products_quantity, p.products_image, p.product_image_2, p.product_image_3, p.product_image_4, p.product_image_5, p.product_image_6, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, p.products_lead_time from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_info = tep_db_fetch_array($product_info_query); tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'"); // BOF QPBPP for SPPC $pf->loadProduct((int)$_GET['products_id'], (int)$languages_id); $products_price = $pf->getPriceString(); // EOF QPBPP for SPPC if (tep_not_null($product_info['products_model'])) { $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>'; } else { $products_name = $product_info['products_name']; } // BOF QPBPP for SPPC $min_order_qty = $pf->getMinOrderQty(); if ($min_order_qty > 1) { $products_name .= '<br><span class="smallText">' . MINIMUM_ORDER_TEXT . $min_order_qty . '</span>'; } // EOF QPBPP for SPPC ?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading" valign="top"><?php echo $products_name; ?></td> <td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="main"> <?php if (tep_not_null($product_info['products_image'])) { ?> <table border="0" cellspacing="0" cellpadding="2" align="right"> <tr> <td align="center" class="smallText"> <!-- BOF SUHY - multiple image --> <?php $PicCount = 0; echo '<td>'; echo '<div style="text-align:center;">'; echo '<a class="thumbnail1" href=" '. tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) .' ">'.'<span><img src="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" /><br>' . TEXT_IMAGE_MOUSOVER .'</span>' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; echo '<br>'; ?> <a href="javascript:popImage('<?php echo tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) ;?>','<?php echo TEXT_IMAGE_POPUP ?>')"><?php echo TEXT_CLICK_TO_ENLARGE ?></a> <?php echo '</div></td>'; $PicCount = $PicCount + 1; if ($product_info['product_image_2'] != "") { echo '<td>'; echo '<div style="text-align:center;">'; echo '<a class="thumbnail2" href=" '. tep_href_link(DIR_WS_IMAGES . $product_info['product_image_2']) .' ">'.'<span><img src="' . tep_href_link(DIR_WS_IMAGES . $product_info['product_image_2']) . '" /><br>' . TEXT_IMAGE_MOUSOVER .'</span>' . tep_image(DIR_WS_IMAGES . $product_info['product_image_2'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; echo '<br>'; ?> <a href="javascript:popImage('<?php echo tep_href_link(DIR_WS_IMAGES . $product_info['product_image_2']) ;?>','<?php echo TEXT_IMAGE_POPUP ?>')"><?php echo TEXT_CLICK_TO_ENLARGE ?></a> <?php echo '</div><td>'; $PicCount = $PicCount + 1; } if ($product_info['product_image_3'] != "") { echo '<td>'; echo '<div style="text-align:center;">'; echo '<a class="thumbnail3" href=" '. tep_href_link(DIR_WS_IMAGES . $product_info['product_image_3']) .' ">'.'<span><img src="' . tep_href_link(DIR_WS_IMAGES . $product_info['product_image_3']) . '" /><br>' . TEXT_IMAGE_MOUSOVER .'</span>' . tep_image(DIR_WS_IMAGES . $product_info['product_image_3'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; echo '<br>'; ?> <a href="javascript:popImage('<?php echo tep_href_link(DIR_WS_IMAGES . $product_info['product_image_3']) ;?>','<?php echo TEXT_IMAGE_POPUP ?>')"><?php echo TEXT_CLICK_TO_ENLARGE ?></a> <?php echo "</div></td>"; $PicCount = $PicCount + 1; } if ($product_info['product_image_4'] != "") { echo '<td>'; echo '<div style="text-align:center;">'; echo '<a class="thumbnail4" href=" '. tep_href_link(DIR_WS_IMAGES . $product_info['product_image_4']) .' ">'.'<span><img src="' . tep_href_link(DIR_WS_IMAGES . $product_info['product_image_4']) . '" /><br>' . TEXT_IMAGE_MOUSOVER .'</span>' . tep_image(DIR_WS_IMAGES . $product_info['product_image_4'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>'; echo '<br>'; ?> <a href="javascript:popImage('<?php echo tep_href_link(DIR_WS_IMAGES . $product_info['product_image_4']) ;?>','<?php echo TEXT_IMAGE_POPUP ?>')"><?php echo TEXT_CLICK_TO_ENLARGE ?></a> <?php echo "</div></td>"; $PicCount = $PicCount + 1; } ?> <!-- EOF SUHY - multiple image --> <!-- this is a support for showing 4 images in a row as I needed for my page. If you need more images just continue the code or make your own table and use the appropriate links in table cells .. Just replace product_image_4 to 5 and 6 accordingly in all instances --> </td> </tr> </table> <?php } ?> <p><?php echo stripslashes($product_info['products_description']); ?></p> <!-- BOF Make an offer --> <div ALIGN="center"><table border="0" width="75%" cellspacing="0" cellpadding="2"> <?php if ((MAO_ACCEPT_OFFER_DIRECTLY == 'true') && ($product_info['products_make_an_offer'] == true)) { ?> <tr><td align="center" class="maooffer"><?php echo ENTRY_NEW_PRICE; ?><br> <input name='newpriceoffer' type='text' value='<?php echo tep_round($newpriceoffer,$currencies->currencies[$currency]['decimal_places']); ?>' MAXLENGTH='15' SIZE='10'><br><?php echo ' ' . $currency; ?></td></tr> <?php } if (tep_session_is_registered('mao_low_offer')) { echo '<tr><td class="maolowoffer">' . ENTRY_LOW_OFFER_CHECK_ERROR . '</td></tr>'; tep_session_unregister('mao_low_offer'); } ?> </table></div><br> <!-- EOF Make an offer --> <?php // BOF SPPC Hide attributes from customer groups $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0 "); $products_attributes = tep_db_fetch_array($products_attributes_query); if ($products_attributes['total'] > 0) { ?> <table border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td> </tr> <?php $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0 order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $products_options_array = array(); $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix, pa.products_attributes_id from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', attributes_hide_from_groups) = 0"); $list_of_prdcts_attributes_id = ''; $products_options = array(); // makes sure this array is empty again while ($_products_options = tep_db_fetch_array($products_options_query)) { $products_options[] = $_products_options; $list_of_prdcts_attributes_id .= $_products_options['products_attributes_id'].","; } if (tep_not_null($list_of_prdcts_attributes_id) && $customer_group_id != '0') { $select_list_of_prdcts_attributes_ids = "(" . substr($list_of_prdcts_attributes_id, 0 , -1) . ")"; $pag_query = tep_db_query("select products_attributes_id, options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES_GROUPS . " where products_attributes_id IN " . $select_list_of_prdcts_attributes_ids . " AND customers_group_id = '" . $customer_group_id . "'"); while ($pag_array = tep_db_fetch_array($pag_query)) { $cg_attr_prices[] = $pag_array; } // substitute options_values_price and prefix for those for the customer group (if available) if ($customer_group_id != '0' && tep_not_null($cg_attr_prices)) { for ($n = 0 ; $n < count($products_options); $n++) { for ($i = 0; $i < count($cg_attr_prices) ; $i++) { if ($cg_attr_prices[$i]['products_attributes_id'] == $products_options[$n]['products_attributes_id']) { $products_options[$n]['price_prefix'] = $cg_attr_prices[$i]['price_prefix']; $products_options[$n]['options_values_price'] = $cg_attr_prices[$i]['options_values_price']; } } // end for ($i = 0; $i < count($cg_att_prices) ; $i++) } } // end if ($customer_group_id != '0' && (tep_not_null($cg_attr_prices)) } // end if (tep_not_null($list_of_prdcts_attributes_id) && $customer_group_id != '0') for ($n = 0 ; $n < count($products_options); $n++) { $products_options_array[] = array('id' => $products_options[$n]['products_options_values_id'], 'text' => $products_options[$n]['products_options_values_name']); if ($products_options[$n]['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options[$n]['price_prefix'] . $currencies->display_price($products_options[$n]['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } // EOF SPPC attributes mod if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]; } else { $selected_attribute = false; } ?> <tr> <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td> <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td> </tr> <?php } ?> </table> <?php } ?> </td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); $reviews = tep_db_fetch_array($reviews_query); if ($reviews['count'] > 0) { ?> <tr> <td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if (tep_not_null($product_info['products_url'])) { ?> <tr> <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } //Products Lead Time Contrib if ($product_info['products_lead_time']>0) { ?> <tr> <td align="center" class="myNote">Tento produkt momentálne nie je na sklade alebo je v medzisklade, čas doručenia od objednania je: <?php echo ' ' . $product_info['products_lead_time'] . ' '; ?>pracovných dní</td> </tr> <?php } //EOF if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) { ?> <tr> <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td> </tr> <?php } else { ?> <tr> <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td> </tr> <?php } ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <!-- BOF Make an offer --> <?php if ($product_info['products_make_an_offer'] == true) { ?> <td class="main" align="right"> <?php if (MAO_ACCEPT_OFFER_DIRECTLY == 'false') { ?> <?php echo '<a href="' . tep_href_link(FILENAME_MAKE_AN_OFFER, tep_get_all_get_params()) . '">' . tep_image_button('button_make_an_offer.gif', IMAGE_BUTTON_MAKE_AN_OFFER) . '</a>'; ?> <?php } ?> </td> <?php } ?> <!-- EOF Make an offer --> <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td> <?php // BOF QPBPP for SPPC ?> <td class="main" align="right"> <table border="0" align="right"> <tr><td class="main" align="center"> <?php echo TEXT_ENTER_QUANTITY . ":" . tep_draw_input_field('cart_quantity', $pf->adjustQty(1), 'size="6"'); ?> </td></tr> <tr><td align="center"> <?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?> </td></tr> </table> </td> <?php // EOF QPBPP for SPPC ?> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td> <?php if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_also_purchased(3600); } else { include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS); } } ?> </td> </tr> </table></form></td> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </div> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> PLEASE HELP ME
  8. Hello, please I have one problem, when I login as wholesale customer, in category product listing I see price for retail, only after open product is show right price. Please can you help me? or just told me in which file I have wrong? Thank you in advance Jozef
  9. Hello PLEASE HELP ME I need to include this Hide products from customer for SPPC code catalog/includes/boxes/whats_new.php $customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $random_product['products_id'] . "' and customers_group_id = '" . $customer_group_id . "' and customers_group_price != null"); To my cycling products catalog/includes/boxes/whats_new.php code $new_products_qry = tep_db_query("SELECT 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, NULL) AS specials_new_products_price FROM " . TABLE_PRODUCTS . " p LEFT OUTER JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON (p.products_id=pd.products_id) LEFT OUTER JOIN " . TABLE_SPECIALS . " s ON (p.products_id=s.products_id) WHERE (products_status = '1') AND (pd.language_id = '" . (int)$languages_id . "') ORDER BY products_date_added DESC LIMIT " . $cycleImages); And also for specials I need to include this SPPC code catalog/includes/boxes/whats_new.php // BOF Separate Pricing Per Customer // global variable (session): $sppc_customers_group_id -> local variable $customer_group_id if (isset($_SESSION['sppc_customer_group_id']) && $_SESSION['sppc_customer_group_id'] != '0') { $customer_group_id = $_SESSION['sppc_customer_group_id']; } else { $customer_group_id = '0'; } if ($customer_group_id == '0') { $random_product = tep_random_select("select 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, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' and s.customers_group_id = '0' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS); } else { // $sppc_customer_group_id is in the session variables, so must be set $random_product = tep_random_select("select p.products_id, pd.products_name, IF(pg.customers_group_price IS NOT NULL,pg.customers_group_price, p.products_price) as products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s LEFT JOIN " . TABLE_PRODUCTS_GROUPS . " pg using (products_id, customers_group_id) where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' and s.customers_group_id= '".$customer_group_id."' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS); } if (tep_not_null($random_product)) { // EOF Separate Pricing Per Customer To my cycling products catalog/includes/boxes/whats_new.php code $specials_qry = tep_db_query("SELECT p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price FROM " . TABLE_SPECIALS . " s LEFT OUTER JOIN " . TABLE_PRODUCTS . " p ON (s.products_id=p.products_id) LEFT OUTER JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON (s.products_id=pd.products_id) WHERE (p.products_status = '1') AND (pd.language_id = '" . (int)$languages_id . "') AND (s.status = '1') ORDER BY s.specials_date_added DESC LIMIT " . $cycleImages); while($specials_res = tep_db_fetch_array($specials_qry)) { $specials_array[] = $specials_res; } if(isset($specials_array)) { shuffle($specials_array); $maxRecs = sizeof($specials_array);
  10. Hello guys, please can you help me? I have cycling products contribution but I am crazy of it because I can´t find solution how I can join there codes. Here is cycling code <?php /* $Id: specials.php 1739 2007-12-20 00:52:16Z hpdl $ adapted for Separate Pricing Per Customer v4 2007/06/22 http://www.digitalsun.nl Copyright (c) 2009 DigitalSun.nl / Jan Dreef / zrxRaver Released under the GNU General Public License */ $cycleImages = 10; // MAX_RANDOM_SELECT_SPECIALS; $imageDivHeight = 220; $offsetLeft = 5; $effect = 'fade'; $params = ', speed: 200, pause: 5 '; $specials_qry = tep_db_query("SELECT p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price FROM " . TABLE_SPECIALS . " s LEFT OUTER JOIN " . TABLE_PRODUCTS . " p ON (s.products_id=p.products_id) LEFT OUTER JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON (s.products_id=pd.products_id) WHERE (p.products_status = '1') AND (pd.language_id = '" . (int)$languages_id . "') AND (s.status = '1') ORDER BY s.specials_date_added DESC LIMIT " . $cycleImages); while($specials_res = tep_db_fetch_array($specials_qry)) { $specials_array[] = $specials_res; } if(isset($specials_array)) { shuffle($specials_array); $maxRecs = sizeof($specials_array); ?> <!-- specials //--> <tr> <td> <?php $content = ' <div id="special123" style="position: relative; left:'.$offsetLeft.'px; height:'.$imageDivHeight.';">'."\n"; for($i = 0; $i < $maxRecs; $i++ ) { $content .= ' <div><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials_array[$i]["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $specials_array[$i]['products_image'], $specials_array[$i]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials_array[$i]['products_id']) . '"><center>' . $specials_array[$i]['products_name'] . '</center></a><center><br><s>' . $currencies->display_price($specials_array[$i]['products_price'], tep_get_tax_rate($specials_array[$i]['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($specials_array[$i]['specials_new_products_price'], tep_get_tax_rate($specials_array[$i]['products_tax_class_id'])) . '</span></center></div>'."\n"; } $content .= ' </div>'."\n"; ob_start(); $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_SPECIALS); new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SPECIALS)); $info_box_contents = array(); $info_box_contents[] = array('params' => 'width="100%"', 'text' => 'myAnchor'); new infoBox($info_box_contents); $temp_box = ob_get_contents(); ob_end_clean(); echo str_replace('myAnchor', $content, $temp_box); echo '<script language="javascript">' . " $('#special123').cycle({ fx: '".$effect."'".$params."}); " . '</script>' . "\n"; ?> </td> </tr> <!-- specials_eof //--> <?php } ?> and here is whats next code: <?php /* $Id: whats_new.php 1739 2007-12-20 00:52:16Z hpdl $ adapted for Separate Pricing Per Customer v4.2 2007/08/10 http://www.digitalsun.nl Copyright (c) 2009 DigitalSun.nl / Jan Dreef / zrxRaver Released under the GNU General Public License */ $cycleImages = 10; // MAX_RANDOM_SELECT_NEW; $imageDivHeight = 165; $offsetLeft = 5; $effect = 'fade'; $params = ', speed: 200, pause: 5 '; $new_products_qry = tep_db_query("SELECT 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, NULL) AS specials_new_products_price FROM " . TABLE_PRODUCTS . " p LEFT OUTER JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON (p.products_id=pd.products_id) LEFT OUTER JOIN " . TABLE_SPECIALS . " s ON (p.products_id=s.products_id) WHERE (products_status = '1') AND (pd.language_id = '" . (int)$languages_id . "') ORDER BY products_date_added DESC LIMIT " . $cycleImages); while($new_products_res = tep_db_fetch_array($new_products_qry)) { $new_products_array[] = $new_products_res; } if(isset($new_products_array)) { shuffle($new_products_array); $maxRecs = sizeof($new_products_array); ?> <!-- whats_new //--> <tr> <td> <?php $content = ' <div id="newproducts321" style="position: relative; left:'.$offsetLeft.'px; height:'.$imageDivHeight.'">'."\n"; for($i = 0; $i < $maxRecs; $i++) { if (tep_not_null($new_products_array[$i]['specials_new_products_price'])) { $whats_new_price = '<s>' . $currencies->display_price($new_products_array[$i]['products_price'], tep_get_tax_rate($new_products_array[$i]['products_tax_class_id'])) . '</s><br>'; $whats_new_price .= '<span class="productSpecialPrice">' . $currencies->display_price($new_products_array[$i]['specials_new_products_price'], tep_get_tax_rate($new_products_array[$i]['products_tax_class_id'])) . '</span>'; } else { $whats_new_price = $currencies->display_price($new_products_array[$i]['products_price'], tep_get_tax_rate($new_products_array[$i]['products_tax_class_id'])); } $content .= ' <div><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products_array[$i]['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products_array[$i]['products_image'], $new_products_array[$i]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><center><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products_array[$i]['products_id']) . '">' . $new_products_array[$i]['products_name'] . '</a><br>' . $whats_new_price . '</center></div>' . "\n"; } $content .= '</div>' . "\n"; ob_start(); $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_WHATS_NEW); new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_PRODUCTS_NEW)); $info_box_contents = array(); $info_box_contents[] = array('params' => 'width="100%"', 'text' => 'myAnchor'); new infoBox($info_box_contents); $temp_box = ob_get_contents(); ob_end_clean(); echo str_replace('myAnchor', $content, $temp_box); echo '<script language="javascript">' . " $('#newproducts321').cycle({ fx: '".$effect."'".$params."}); " . '</script>' . "\n"; ?> </td> </tr> <!-- whats_new_eof //--> <?php } ?> PLEASE HELP ME, PLEASE
  11. Hi, I am sorry if I repeat someone but I dont find it. sometimes when I click on some item or categore it wrote me this: Warning: mb_strpos() [function.mb-strpos]: Empty delimiter. in /www_root/includes/classes/seo.class.php on line 1180 but I dont have catalog dir that I delete this code in includes/classes/seo.class.php if (strpos($origUrl, $catalog) !== FALSE) $origUrl = substr($origUrl, strlen($catalog)); //remove the catalog from the url string now is working perfect, hope to someone help too:)
×
×
  • Create New...