Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Compare Products side by side for osc 2.3.1


  • You cannot reply to this topic
9 replies to this topic

#1 29gk

  • Community Member
  • 38 posts
  • Real Name:GEORGE
  • Gender:Male
  • Location:Greece

Posted 02 March 2011, 11:34

I am using this addon, (Compare Products side by side)which can be found here
http://addons.oscommerce.com/info/2192

on my version 2.2rca shop and its working well. But i cannot make it work on my new shop which is based on the new version 2.3.1. I ve tried to alter the code, mainly the one into the product_listing.php file, but no luck. Have already shearched the forum and googled for an alternative solution, but couldnt find anything simple and easy, mainly from the customers point of view.

Thank you in advance :)

#2 29gk

  • Community Member
  • 38 posts
  • Real Name:GEORGE
  • Gender:Male
  • Location:Greece

Posted 04 March 2011, 09:15

I think that this contribution is dead, as if it concerns the version 2.3 and 3.0.

Does anybody knows, if there is any similar way to compare 2 or more products ? With an add to compare button perhaps, in every products page or in product listing ? I have a running site in which i sell power tools, and this capability is really very useful.

Thanks again :)

#3 bruyndoncx

  • Community Member
  • 2,382 posts
  • Real Name:Carine Bruyndoncx
  • Gender:Female
  • Location:Belgium/ Antwerp/ Turnhout/ Arendonk

Posted 06 June 2011, 19:13

yeah, it's been pretty dead for some time now, I haven't used it myself since a long time,
I'll see if I can make it fit in my upgraded 2.3.1 store (in the works).
Hava a nice day !
Carine Bruyndoncx

KEUKENLUST, Everything but the kitchensink !

#4 bruyndoncx

  • Community Member
  • 2,382 posts
  • Real Name:Carine Bruyndoncx
  • Gender:Female
  • Location:Belgium/ Antwerp/ Turnhout/ Arendonk

Posted 06 June 2011, 19:14

P.S. I do have customer service working, if you still need help with that ?
Hava a nice day !
Carine Bruyndoncx

KEUKENLUST, Everything but the kitchensink !

#5 29gk

  • Community Member
  • 38 posts
  • Real Name:GEORGE
  • Gender:Male
  • Location:Greece

Posted 20 July 2011, 11:19

View Postbruyndoncx, on 06 June 2011, 19:14, said:

P.S. I do have customer service working, if you still need help with that ?

Thanks bruyndoncx for your interest but finally i ve made your customer service addon to work, after a small change in the sql file.

But i am still trying to make the compare contribution to work on 2.3.1, but with no luck. The main problem is on the product listing changes i think. Have you made any progress ? Has anyone still needs this very usefull feature ?

#6 radhavallabh

  • Community Member
  • 13 posts
  • Real Name:sunil jain
  • Gender:Male
  • Location:New Delhi India

Posted 03 November 2011, 12:23

Hi I was adding this contribution to my store oscommerce 2.2rca but the product_listing.php showed on your package are way too different from mines which I have modded too;
the product_listing code is below cud u help me to where the code has to be added as it completely differs in few places which I will mention below after pasting it;
Please help me I would be very elated to use this addon to my website http://www.krishnastores.com

My orignal product_listing.php that i use -
<?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 .= ' &gt; '. $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'] .= '&nbsp' . 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 I was able to edit it-

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 cannot be done as the code parts to be changed cannot be found in my document I pasted above
Please help me where I can paste the below codes:-

 
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, 03 November 2011, 12:28.


#7 kranthi

  • Community Member
  • 6 posts
  • Real Name:kranthi

Posted 30 January 2012, 12:28

Any addon for products comparison in OSC 2.3.1 ?

#8 kymation

  • Community Sponsor
  • 5,662 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 30 January 2012, 19:02

The Products Specifications Addon has a comparison option, and there is a 2.3.1 version.

Regards
Jim
My Addons

Banners Box 2.3.1 Support
Categories Accordion Box 2.3.1 Support
Categories Images Box 2.2x 2.3.1 Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box 2.3.1 Support
Get 1 Free 2.2x Support
Include HTML and Text Boxes 2.2x
jQuery Banner Rotator 2.2x 2.3.1 Support
Modular Front Page 2.3.1 Support
Modular SEO Header Tags 2.3.1 Support
More Pics 2.2x Support
MVS 2.2x Support
osC Catalog 2.2x Support
PDF Datasheet 2.3.1 Support
Price Updater 2.2x
Products Specifications 2.2x 2.3.1 Development Version Support Bugs/Suggestions
Request a Review 2.2x - 2.3.1 Support
Similar Products Box 2.2x
Theme Switcher 2.3.1 Support

#9 bruyndoncx

  • Community Member
  • 2,382 posts
  • Real Name:Carine Bruyndoncx
  • Gender:Female
  • Location:Belgium/ Antwerp/ Turnhout/ Arendonk

Posted 30 January 2012, 21:39

I believe this one works with 2.3.1
http://addons.oscommerce.com/info/8114
Hava a nice day !
Carine Bruyndoncx

KEUKENLUST, Everything but the kitchensink !

#10 ilyadgonbad

  • Community Member
  • 2 posts
  • Real Name:Emin

Posted 14 March 2012, 16:48

I installed this addon for compare products but I do not see any change in web site without any error for this addon.
I access only to page compare.php that this page have empty page.