Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Options as images


63 replies to this topic

#61 lgayle

  • Community Member
  • 127 posts
  • Real Name:Michelle
  • Gender:Female

Posted 25 March 2010, 18:36

Can someone please help me I am having problem with this error Warning: Division by zero in shop/catalog/options_images.php on line 66 and that line reads

if ($count%OPTIONS_IMAGES_NUMBER_PER_ROW == 0) {

Edited by lgayle, 25 March 2010, 18:48.


#62 mvigil514

  • Community Member
  • 44 posts
  • Real Name:Michael
  • Location:Georgia

Posted 23 April 2010, 15:43

Hello All,

I am using Options as Images v1.2. I have looked through the forums and have not been able to make this work. I am trying to change the sort order in the admin section to sort by products_options_values_name. Currently, we have many (500+) option values for one option and they are sorted by options_values_id. I have tried adding "order by products_options_values_name" at the end of $query2, but it does not seem to work. Maybe someone with more PHP/MySQL knowledge can figure this out. Below is the relevant section of code. I can post the entire file if needed.

            <td valign="top" width="75%"><table border="0" width="100%" cellspacing="0" cellpadding="2">
              <tr class="dataTableHeadingRow">
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_NAME; ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_ID; ?></td>
                <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_IMAGE; ?></td>
				<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_IMAGE_NAME; ?></td>
				<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_DIMENSIONS; ?></td>
              </tr>
<?php
  	
  $query1 = tep_db_query("select * from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " where products_options_id = '" . $options_id . "'" );
	//First find all the products options values that belong to the selected product option
  while ($result1 = tep_db_fetch_array($query1)) {
	  $products_options_values_id = $result1['products_options_values_id'];


		//Now pull their details from the database
   $query2 = tep_db_query ("select * from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . $products_options_values_id . "' and language_id = '" .$language_id . "'");
		while ($result2 = tep_db_fetch_array($query2)) {
		  $products_options_values_name = $result2 ['products_options_values_name'];
			$products_options_values_id = $result2 ['products_options_values_id']; 
		  $products_options_values_thumbnail = $result2['products_options_values_thumbnail'];
		  $products_options_values_dimensions = $result2['products_options_values_dimensions'];
		   
	
	  if ($HTTP_GET_VARS['cID'] == $products_options_values_id){
	  $selected_value['name'] = $products_options_values_name;
		$selected_value['id'] = $products_options_values_id;
	  $selected_value['image'] = $products_options_values_thumbnail;
	  $selected_value['dimensions'] = $products_options_values_dimensions;
	  $selected_value['id'] = $products_options_values_id;
	  } 
	
	if ( (isset($selected_value['id'])) && ($products_options_values_id == $selected_value['id']) ) {
      echo '                  <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_OPTIONS_IMAGES, '&cID=' . $products_options_values_id . '&box_id=' . $options_id . '&action=edit') . '\'">' . "\n";
    } else {
      echo '                  <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_OPTIONS_IMAGES, '&cID=' . $products_options_values_id . '&box_id=' . $options_id ) . '\'">' . "\n";
    }

?>
                <td class="dataTableContent"><?php echo $products_options_values_name ?></td>
                <td class="dataTableContent"><?php echo $products_options_values_id ?></td>
                <td class="dataTableContent" align="center"><?php echo tep_image(DIR_WS_CATALOG_IMAGES . 'options/' . $products_options_values_thumbnail, $products_options_values_name, OPTIONS_IMAGES_WIDTH, OPTIONS_IMAGES_HEIGHT) ?></td>
                <td class="dataTableContent"><?php echo $products_options_values_thumbnail ?></td>
				<td class="dataTableContent"><?php echo $products_options_values_dimensions ?></td>
          </tr>
<?php
    }
  }

?>

Thanks in advance for any consideration.

Michael

#63 pilotdave

  • Community Member
  • 12 posts
  • Real Name:David Jones

Posted 19 June 2010, 06:10

Hello all,

Great contribution! I have an oscommerce site in which a customer needs to be able to select an image for a few different options, and each image option will have many images to choose from (example: choosing an emblem for the product, selecting a font style for the product - shown as an image, etc.). I was wondering if there is a way to have the image options to select from on a pop-up page, instead of showing all of the image options on the product info page? That way a customer can click on an attribute and a pop-up page will appear with all of the image attributes with radio buttons - this will keep the product info page cleaner.

Any advice is appreciated. Thanks!

#64 powerdrive

  • Community Member
  • 75 posts
  • Real Name:Power Drive Services
  • Location:Greater Manchester, UK

Posted 09 November 2010, 14:18

Great contribution.
Is there a way to let customers select more than one option? In a way that they would go into the cart as multiple items, one for each option they selected?
I'd very much appreciate any help, even if it's just to say it can't be done.
Kind regards,
Power Drive