Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sign in to follow this  
bruyndoncx

[Contribution] Compare Products Side-By-Side

Recommended Posts

I�ve tried it on your Page, but when I selected no products there is an error:

 

Warning: implode(): Bad arguments. in /home/bruyndo/public_html/catalog/compare.php on line 104

 

Warning: implode(): Bad arguments. in /home/bruyndo/public_html/catalog/compare.php on line 116

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ') and pd.language_id = '1' order by p.products_id asc' at line

 

select p.products_quantity, p.products_image, pd.products_description, pd.products_name, m.manufacturers_name, p.products_model, p.products_id, p.manufacturers_id, p.products_price, 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 products_description pd join products p using (products_id) left join manufacturers m using (manufacturers_id) left join specials s on p.products_id = s.products_id where p.products_id in () and pd.language_id = '1' order by p.products_id asc

 

[TEP STOP]

 

 

 

 

 

 

 

 

 

Did any one find solution to this post? I am having the same problem? I am new to this. Please help would be very helpful. I followed the readme instruction and when i got the error i tried to go through the forum and couldn't find anything. I even tried to change the value related to

$offset = ($max_rows_per_page * ($current_page_number - 1));

//newer version of mysql can not handle neg number in limit, temp fix

if ($offset < '0' ){

$offset = '0';

}

$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

 

still no luck. anyone

 

thank you,

Share this post


Link to post
Share on other sites

I am getting this warning when i try to view http://mycctvcams.com/compare.php or when i select products and click compare i get the below error message.

 

columns Array ( ) 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') and pd.language_id = '1' order by p.products_id asc' at line 4

 

select p.products_quantity, p.products_image, pd.products_description, pd.products_name, m.manufacturers_name, p.products_model, p.products_id, p.manufacturers_id, p.products_price, 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 products_description pd join products p using (products_id) left join manufacturers m using (manufacturers_id) left join specials s on p.products_id = s.products_id where p.products_id in () and pd.language_id = '1' order by p.products_id asc

 

[TEP STOP]

 

 

 

Did any one find solution to this post? I am having the same problem? I am new to this. Please help would be very helpful. I followed the readme instruction and when i got the error i tried to go through the forum and couldn't find anything. I even tried to change the value related to

$offset = ($max_rows_per_page * ($current_page_number - 1));

//newer version of mysql can not handle neg number in limit, temp fix

if ($offset < '0' ){

$offset = '0';

}

$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

 

still no luck. anyone

 

Thank you,

 

David

Share this post


Link to post
Share on other sites

I can't say that I have the solution, but I suspect the problem relates to the different names for special prices. In the database, in the specials table, the name is specials_new_products_price and so in the most recent version (i) we have the name v_specials_new_products_price used about 16 times. We also have another name v_products_specials_price which is used about 15 times. When making an export from the data base, out comes the v_products_specials_price not v_specials_new_products_price as one would expect.

 

This difference in the names for the new special price feature came to light today after an upload of 100 or so new products. I had intentionally first done a download to be sure I had the correct headers, but I can assure you that the v_products_specials_price did not update the database field specials_new_products_price.

 

PS: There was a similar problem relating to "Taxable Goods". Changing the header from v_tax_class_id to v_tax_class_title allows this field to work for me.


Joseph E. "Joe" Stephenson
jestep@alphanautical.com

Share this post


Link to post
Share on other sites

i am getting this error when i added this contribute... please anyone help....

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') and pd.language_id = '1' order by p.products_id asc' at line 4

 

select p.products_quantity, p.products_image, pd.products_description, pd.products_name, m.manufacturers_name, p.products_model, p.products_id, p.manufacturers_id, p.products_price, 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 products_description pd join products p using (products_id) left join manufacturers m using (manufacturers_id) left join specials s on p.products_id = s.products_id where p.products_id in () and pd.language_id = '1' order by p.products_id asc

Share this post


Link to post
Share on other sites

Hello.

 

I am having a problem with getting the checkbox to show up on my product_listing.php page

 

Can someone please help me with this?

 

Here is my product_listing.php page:

 

<?php

/*

 $Id: product_listing.php 1739 2007-12-20 00:52:16Z hpdl $



 osCommerce, Open Source E-Commerce Solutions

 http://www.oscommerce.com



 Copyright (c) 2003 osCommerce



 Released under the GNU General Public License

*/

?>

<?php echo tep_draw_title_top();?>



			<?php echo $breadcrumb->trail(' » ')?>



<?php echo tep_draw_title_bottom();?>	



<?php echo tep_draw3_top();?>



<?php

 $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');



 if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {

?>



<?php echo tep_draw_result1_top(); ?>



	<table border="0" cellspacing="0" cellpadding="0" class="result result_top_padd">

         <tr>

           <td><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>

           <td class="result_right" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>

         </tr>

       </table>



<?php echo tep_draw_result1_bottom();  ?> 



<?php

 }



$info_box_contents = array();

 /* BoF Compare Products side-by-side */
 echo tep_draw_form('compare', tep_href_link(basename('compare.php'), tep_get_all_get_params(array('action')) ));?> 
<?php
 /* EoF Compare Products side-by-side */

 $list_box_contents = array();

$my_row = 0;

$my_col = 0;

 $col_items = 2;

 $col_width = (int)(100 / ($col_items + 1)).'%';

for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {

   switch ($column_list[$col]) {

     case 'PRODUCT_LIST_MODEL':

       $lc_text = TABLE_HEADING_MODEL;

       $lc_align = '';

       break;

     case 'PRODUCT_LIST_NAME':

       $lc_text = TABLE_HEADING_PRODUCTS;

       $lc_align = '';

       break;

     case 'PRODUCT_LIST_MANUFACTURER':

       $lc_text = TABLE_HEADING_MANUFACTURER;

       $lc_align = '';

       break;

     case 'PRODUCT_LIST_PRICE':

       $lc_text = TABLE_HEADING_PRICE;

       $lc_align = 'right';

       break;

     case 'PRODUCT_LIST_QUANTITY':

       $lc_text = TABLE_HEADING_QUANTITY;

       $lc_align = 'right';

       break;

     case 'PRODUCT_LIST_WEIGHT':

       $lc_text = TABLE_HEADING_WEIGHT;

       $lc_align = 'right';

       break;

     case 'PRODUCT_LIST_IMAGE':

       $lc_text = TABLE_HEADING_IMAGE;

       $lc_align = 'center';

       break;

     case 'PRODUCT_LIST_BUY_NOW':

       $lc_text = TABLE_HEADING_BUY_NOW;

       $lc_align = 'center';

       break;
   }



   if ( ($column_list[$col] != 'PRODUCT_LIST_BUY_NOW') && ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) {

     $lc_text = tep_create_sort_heading($HTTP_GET_VARS['sort'], $col+1, $lc_text);

   }



   $list_box_contents[0][] = array('align' => $lc_align,

                                   'params' => 'class="productListing-heading"',

                                   'text' => ' ' . $lc_text . ' ');

 }



 if ($listing_split->number_of_rows > 0) {

   $rows = 0;

        /* BoF Compare Products side-by-side
                  Generate hidden fields to submit with each checkbox */
       $hidden_get_variables = '';
       reset($HTTP_GET_VARS);
       while (list($key, $value) = each($HTTP_GET_VARS)) {
               if ((substr($key,0,8) != 'columns_') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y')) {
                       $hidden_get_variables .= tep_draw_hidden_field($key, $value);
               } 
       } 
        /* EoF Compare Products side-by-side */

   $listing_query = tep_db_query($listing_split->sql_query);

   while ($listing = tep_db_fetch_array($listing_query)) {

     $rows++;

         /* BoF Compare Products side-by-side
                        Hide all columns selected except for this product, which will be generated by the checkbox form is needed */
         $hidden_get_columns = '';
         reset($HTTP_GET_VARS);
         while (list($key, $value) = each($HTTP_GET_VARS)) {
                 if ((substr($key,0,8) == 'columns_') && ($key != 'columns_'.$listing['products_id']) ) {
                         $hidden_get_columns .= tep_draw_hidden_field($key, $value);
                 } 
         } 
        /* EoF Compare Products side-by-side */

     if (($rows/2) == floor($rows/2)) {

       $list_box_contents[] = array('params' => 'class="productListing-even"');

     } else {

       $list_box_contents[] = array('params' => 'class="productListing-odd"');

     }

     $cur_row = sizeof($list_box_contents) - 1;

  				 /* BoF Compare Products side-by-side
                        Add checkbox to compare products */						
         $lc_align = 'center';
//        $lc_text = tep_draw_form('compare', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=compare&columns_cnt='.$columns_cnt), 'get');
         $lc_text = tep_draw_form('compare', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) ), 'get');
         $lc_text .= tep_draw_checkbox_field('columns_'.$listing['products_id'],$listing['products_id'],false,'onclick="this.form.submit();"');
         $lc_text .= $hidden_get_variables;
         $lc_text .= $hidden_get_columns;
         $lc_text .= tep_hide_session_id();
         $lc_text .= '</form>';

         $list_box_contents[$cur_row][] = array('align' => $lc_align,
                                                                                          'params' => 'class="productListing-data"',
                                                                                          'text'  => $lc_text);																						   
         /* EoF Compare Products side-by-side */

     for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {

       $lc_align = '';



       switch ($column_list[$col]) {

         case 'PRODUCT_LIST_MODEL':

           $lc_align = '';



           $p_model = '<tr>

						<td><b><font>'.TABLE_HEADING_MODEL.' :</font></b></td>

						<td align="right"><font>' . $listing['products_model'] . '</font></td>

					</tr>';

           break;

         case 'PRODUCT_LIST_NAME':

           $lc_align = '';

           if (isset($HTTP_GET_VARS['manufacturers_id'])) {

           $p_name = $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>';

           } else {

           $p_name = $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>';

           }

           break;

         case 'PRODUCT_LIST_MANUFACTURER':

           $lc_align = '';

           $p_manufact = '<tr>

						<td><b><font>'.TABLE_HEADING_MANUFACTURER.' :</font></b></td>

						<td align="right"><font><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing['manufacturers_id']) . '">' . $listing['manufacturers_name'] . '</a></font></td>

					</tr>';

           break;

         case 'PRODUCT_LIST_PRICE':

           $lc_align = 'right';

           if (tep_not_null($listing['specials_new_products_price'])) {

          $p_price = $lc_text = '<s>' .  $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>   <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>';

           } else {

          $p_price = $lc_text = '<span class="productSpecialPrice">' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>';

           }

           break;

         case 'PRODUCT_LIST_QUANTITY':

           $lc_align = 'right';

           $p_qty = '<tr>

						<td><b><font>'.TABLE_HEADING_QUANTITY.' :</font></b></td>

						<td align="right"><font>' . $listing['products_quantity'] . '</font></td>

					</tr>';

           break;

         case 'PRODUCT_LIST_WEIGHT':

           $lc_align = 'right';

           $p_weight = '<tr>

						<td><b><font>'.TABLE_HEADING_WEIGHT.' :</font></b></td>

						<td align="right"><font>' . $listing['products_weight'] . '</font></td>

					</tr>';

           break;

         case 'PRODUCT_LIST_IMAGE':

           $lc_align = 'center';

           if (isset($HTTP_GET_VARS['manufacturers_id'])) {

             $p_pic = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';

           } else {

             $p_pic = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';

           }

           break;

         case 'PRODUCT_LIST_BUY_NOW':

           $lc_align = 'center';

           $p_button =  $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now1.gif', IMAGE_BUTTON_BUY_NOW) . '</a>';

           break;

       }


$product_query = tep_db_query("select products_description, products_id from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$listing['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

     $product = tep_db_fetch_array($product_query);

      	$p_desc = substr(strip_tags($product['products_description']), 0, MAX_DESCR_1).'...<br>';



  if (PRODUCT_LIST_MODEL != 0 || PRODUCT_LIST_MANUFACTURER != 0 || PRODUCT_LIST_QUANTITY != 0 || PRODUCT_LIST_WEIGHT != 0) {

	$p_listing = '<table cellpadding="0" cellspacing="0" border="0" class="listing">'.$p_model.''.$p_manufact.'' . ''.$p_qty.'' . ''.$p_weight.'</table>';

	}

       $p_id = $product['products_id'];



/*		$list_box_contents[$cur_row][] = array('align' => $lc_align,

                                              'params' => '',

                                              'text'  => $lc_text); */
}


 $p_details = '<a href="' . tep_href_link('product_info.php?products_id='.$p_id) . '">'.tep_image_button('button_details.gif', '', ' class="btn1"').'</a>';

 $p_buy_now = '<a href="'.tep_href_link("products_new.php","action=buy_now&products_id=".$p_id).'">'.tep_image_button('button_add_to_cart1.gif', '', ' class="btn1"').'</a>';

$info_box_contents[$my_row][$my_col] = array('align' => 'center',

                                          'params' => ' style="width:'.$col_width.'"',

                                          'text' => ''.tep_draw_prod2_top().'

<table cellpadding="0" cellspacing="0" border="0" class="wrapper_box">

	<tr><td class="name name2_padd">'.$p_name.'</td></tr>

	<tr><td class="pic2_padd">'.tep_draw_prod_pic_top().''.$p_pic.''.tep_draw_prod_pic_bottom().'</td></tr>	

	<tr><td class="desc desc2_padd">'.$p_desc.'</td></tr>

	<tr><td class="listing2_padd">'.$p_listing.'</td></tr>

	<tr><td class="price2_padd">'.$p_price.'</td></tr>

	<tr><td class="button2__padd">

		<table cellpadding="0" cellspacing="0" border="0">

			<tr><td class="button2_padd"  id="bg_button2" onMouseOut="this.id=\'bg_button2\';" onMouseOver="this.id=\'bg_button2-act\';"><a href="'.tep_href_link("products_new.php","action=buy_now&products_id=".$p_id).'">'.ADD_TO_CART .'</a></td></tr>

			</tr>

		</table>

	</td></tr>

</table>									   

'.tep_draw_prod2_bottom().'');

   $my_col ++;

   if ($my_col > $col_items) {

     $my_col = 0;

	$my_row ++;

     }

   }
   /* BoF Compare Products side-by-side
          Add last row with form to compare products */
   if ($my_col > 0) $my_row ++;
   $info_box_contents[$my_row][0] = array('align' => "right",
                                      'params' => 'class="productListing-heading" colspan="'.$col_width.'"',
                                        'text' => tep_draw_form('compare', tep_href_link("compare.php", tep_get_all_get_params(array('action')))) 
                                                  . TABLE_HEADING_COMPARE . tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</form>');
   /* EoF Compare Products side-by-side */

new contentBox($info_box_contents); 

//    new productListingBox($list_box_contents);

} else {  ?>

<?php echo tep_draw1_top(); ?>

			<table cellpadding="0" cellspacing="0" class="main">

				<tr><td style="padding:25px 20px 20px 20px;"><?php echo TEXT_NO_PRODUCTS ?></td></tr>
			</table>

<?php echo tep_draw1_bottom();?>                

<?php			

}
?>
<?php
 if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {
?>
<?php echo tep_draw_result2_top(); ?>      
	<table border="0" cellspacing="0" cellpadding="0" class="result result_bottom_padd">
         <tr>
           <td><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
           <td class="result_right" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
         </tr>
       </table>
<?php echo tep_draw_result2_bottom(); ?> 
<?php
 }
?>
<?php echo tep_draw3_bottom();?>

 

I would be very grateful for some help...

Share this post


Link to post
Share on other sites

Hi I was adding this contribution but the product_listing.php showed on your package are way too different from mines which I have modded too;

the ptoduct_listing code is below cud u help me to where the code has to be added as it differs in few places which I will mention below after pasting it

 

<?php
/*
 $Id: product_listing.php 1739 2007-12-20 00:52:16Z hpdl $
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Copyright (c) 2003 osCommerce
 Released under the GNU General Public License
*/
 // added for New Product Icon contribution
 $today_time = time();
 // end addition
 if (!defined('PRODUCT_LIST_COLUMNS')) {
tep_db_query(
  "insert into configuration
  (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added)
  VALUES ('Number of products per row', 'PRODUCT_LIST_COLUMNS', '5', 'Set the number of products per row to display?', '8', '11', now());"
);
define('PRODUCT_LIST_COLUMNS', '5');
 }

 $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');

 if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr>
<td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
<td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
 </tr>
</table>
<?php
 }

 if (tep_not_null($_GET['manufacturers_id'])) {
$manufacturer_query = tep_db_query(
  "select manufacturers_name
  from " . TABLE_MANUFACTURERS . "
  where manufacturers_id = '" . tep_db_input($_GET['manufacturers_id']) . "';"
);
$manufacturer = tep_db_fetch_array($manufacturer_query);
$info_box_header = $manufacturer['manufacturers_name'];
if (tep_not_null($_GET['filter_id'])) {
  $category_query = tep_db_query(
	"select cd.categories_name
	from
	  " . TABLE_CATEGORIES . " c,
	  " . TABLE_CATEGORIES_DESCRIPTION . " cd
	where c.categories_id = '" . tep_db_input($_GET['filter_id']) . "'
	and cd.categories_id = '" . tep_db_input($_GET['filter_id']) . "'
	and cd.language_id = '" . (int)$languages_id . "'"
  );
  $category = tep_db_fetch_array($category_query);
  $info_box_header .= ' > '. $category['categories_name'];
}
 }

 if (tep_not_null($current_category_id)) {
$category_query = tep_db_query(
  "select cd.categories_name
  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 . "'"
);
$category = tep_db_fetch_array($category_query);
$info_box_header = $category['categories_name'];
 }

 $info_box_contents = array();
 $info_box_contents[] = array('text' => $info_box_header);
 new contentBoxHeading($info_box_contents);
 $row = 0;
 $col = 0;
 $list_box_contents = array();
 if ($listing_split->number_of_rows > 0) {
$listing_query = tep_db_query($listing_split->sql_query);
while ($listing = tep_db_fetch_array($listing_query)) {

  $lc_align = 'center';
  $lc_text = '<table cellpadding="2" cellspacing="0" border="0" style="font:Times New Roman; font-size:12px;">' . "\r\n";

  foreach ($column_list as $column) {
	switch($column) {

	// Row: Products model
	  case 'PRODUCT_LIST_MODEL':
		$lc_text .= '  <tr>' . "\r\n"
				  . '	<td align="center">'. $listing['products_model'] . '</td>' . "\r\n"
				  . '  </tr>' . "\r\n";
		break;
	// Row: Product's image
	  case 'PRODUCT_LIST_IMAGE':
		$lc_text .= '  <tr>' . "\r\n"
				  . '	<td align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, (isset($_GET['manufacturers_id']) ? 'manufacturers_id=' . $_GET['manufacturers_id'] : ($cPath ? 'cPath=' . $cPath : '')) . '&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>' . "\r\n"
				  . '  </tr>' . "\r\n";
		break;

	// Row: Product's name
	  case 'PRODUCT_LIST_NAME':
// added for New Product Icon contribution
//  2592000 = 30 days in the unix timestamp format
	if ( ($today_time - strtotime($listing['products_date_added'])) < 2592000) {
	$listing['products_name'] .= ' ' . tep_image_button('icon_newarrival.gif', TEXT_ICON_NEW_PRODUCT. ' : ' . $listing['products_name'], 'align="middle"');
	}
// end addition
		$lc_text .= '  <tr>' . "\r\n"
				  . '	<td align="center">Item- <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, (isset($_GET['manufacturers_id']) ? 'manufacturers_id=' . $_GET['manufacturers_id'] : ($cPath ? 'cPath=' . $cPath : '')) . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a></td>' . "\r\n"
				  . '  </tr>' . "\r\n";
		break;

	// Row: Manufacturer's name
	  case 'PRODUCT_LIST_MANUFACTURER':
		$lc_text .= '  <tr>' . "\r\n"
				  . '	<td align="center"><span style="color: #666666;">'. $listing['manufacturers_name'] . '</span></td>' . "\r\n"
				  . '  </tr>' . "\r\n";
		break;

	// Row: Price
	  case 'PRODUCT_LIST_PRICE':
		if (tep_not_null($listing['specials_new_products_price'])) {
		  $lc_text .= '  <tr>' . "\r\n"
					. '	<td align="center">Price- <s>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) .'</s><br><span class="productSpecialPrice">'. $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span></td>' . "\r\n"
					. '  </tr>' . "\r\n";
		} else {
		  $lc_text .= '  <tr>' . "\r\n"
					. '	<td align="center">Price- ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</td>' . "\r\n"
					. '  </tr>' . "\r\n";
		}
		break;

	// Row: Product's quantity
	  case 'PRODUCT_LIST_QUANTITY':
		$lc_text .= '  <tr>' . "\r\n"
				  . '	<td align="center">Item Quantity- '. TABLE_HEADING_QUANTITY .': '. $listing['products_quantity'] . '</td>' . "\r\n"
				  . '  </tr>' . "\r\n";
		break;

	// Row: Product's weight
	  case 'PRODUCT_LIST_WEIGHT':
		$lc_text .= '  <tr>' . "\r\n"
				  . '	<td align="center">'. TABLE_HEADING_WEIGHT .': '. $listing['products_weight'] . '</td>' . "\r\n"
				  . '  </tr>' . "\r\n";
		break;
	// Row: Buy now button
	  case 'PRODUCT_LIST_BUY_NOW':
		$lc_text .= '  <tr>' . "\r\n"
				  . '	<td align="center">Purchase Item- <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a></td>' . "\r\n"
				  . '  </tr>' . "\r\n";
		break;
  break;
	}
  }

  $lc_text .= '</table>' . "\r\n";

  $list_box_contents[$row][$col] = array(
	'align' => $lc_align,
	'params' => 'width="'. round(100/PRODUCT_LIST_COLUMNS) .'%" class="productListing-data"',
	'text'  => $lc_text
  );

  $col ++;
  if ($col > (PRODUCT_LIST_COLUMNS-1)) {
	$col = 0;
	$row ++;
  }
}

while ($col != 0 && sizeof($list_box_contents[$row]) < PRODUCT_LIST_COLUMNS) {
  $list_box_contents[$row][$col] = array(
	'align' => 'center',
	'params' => 'width="'. round(100/PRODUCT_LIST_COLUMNS) .'%"',
	'text'  => ' '
  );

  $col ++;
}

new productListingBox($list_box_contents);
 } else {
$list_box_contents = array();
$list_box_contents[0] = array('params' => 'class="productListing-odd"');
$list_box_contents[0][] = array('params' => 'class="productListing-data"',
								'text' => TEXT_NO_PRODUCTS);
new productListingBox($list_box_contents);
 }
 if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr>
<td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
<td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
 </tr>
</table>
<?php
 }
?>

 

 

 

This below step was easily located above and can be done-

 

 

3.1 Find (~line 22)
</table>
<?php
 }

	 Replace With
</table>
<?php
 }
 /* BoF Compare Products side-by-side */
 echo tep_draw_form('compare', tep_href_link("compare.php", tep_get_all_get_params(array('action')))); ?> </td>
<?php
 /* EoF Compare Products side-by-side */

 

 

Now all below steps do not show in my document

This is where my problems are:-

 

 


3.2 Find (~line 26)
 $list_box_contents = array();

	 Replace With
 $list_box_contents = array();
 /* BoF Compare Products side-by-side
	 Insert first column to add checkbox to compare products */
 $list_box_contents[0][] = array('align' => "center",
							 'params' => 'class="productListing-heading"',
							   'text' => TABLE_HEADING_COMPARE . '<br>' . tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</form>');
 /* EoF Compare Products side-by-side */

 3.3 Find
 if ($listing_split->number_of_rows > 0) {
$rows = 0;

	 Replace with
 if ($listing_split->number_of_rows > 0) {
$rows = 0;
/* BoF Compare Products side-by-side
	   Generate hidden fields to submit with each checkbox */
$hidden_get_variables = '';
reset($HTTP_GET_VARS);
while (list($key, $value) = each($HTTP_GET_VARS)) {
	if ((substr($key,0,8) != 'columns_') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y')) {
		$hidden_get_variables .= tep_draw_hidden_field($key, $value);
	}
}
 /* EoF Compare Products side-by-side */
 3.4 Find
while ($listing = tep_db_fetch_array($listing_query)) {
  $rows++;
	 Replace with
while ($listing = tep_db_fetch_array($listing_query)) {
  $rows++;
  /* BoF Compare Products side-by-side
		 Hide all columns selected except for this product, which will be generated by the checkbox form is needed */
  $hidden_get_columns = '';
  reset($HTTP_GET_VARS);
  while (list($key, $value) = each($HTTP_GET_VARS)) {
	  if ((substr($key,0,8) == 'columns_') && ($key != 'columns_'.$listing['products_id']) ) {
		  $hidden_get_columns .= tep_draw_hidden_field($key, $value);
	  }
  }
 /* EoF Compare Products side-by-side */

 3.5 Find (~line 85)
  $cur_row = sizeof($list_box_contents) - 1;

	 Replace with
  $cur_row = sizeof($list_box_contents) - 1;
  /* BoF Compare Products side-by-side
		 Add checkbox to compare products */
  $lc_align = 'center';
  $lc_text = tep_draw_checkbox_field('columns[]',$listing['products_id']);
  $list_box_contents[$cur_row][] = array('align' => $lc_align,
										   'params' => 'class="productListing-data"',
										   'text'  => $lc_text);
  /* EoF Compare Products side-by-side */

 

 

Please help me I would be very elated to use this addon to my website http://www.krishnastores.com

Edited by radhavallabh

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×