Jump to content
lildog

Options as images

Recommended Posts

Hey everyone,

 

ive installed the option as images contr., but i cannot see the uploaded image in product info.

I see only the Radio Button an the name ive given.

 

I hope you understand me, my english is terrible :D

 

 

greets,

Patrick

Share this post


Link to post
Share on other sites

does it work with rc2a?.... because i have too many errors warnings etc.... i used the version from andes1 1.5 and worked so good but it was for ms2...

 

 

I had no issues installing this on RC2a by merging in the Options as Images code manually.thumbsup.gif


Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Share this post


Link to post
Share on other sites

V2.0 failed to work. Perhaps it's because I did not amend a file:

Instructions say:

 

"5. Now you need to edit some existing files:

 

A. /catalog/product_info.php.

B. /admin/includes/languages/english.php

C. /admin/includes/boxes/catalog.php

D. /admin/includes/filenames.php

E. /catalog/includes/filenames.php

F. /catalog/includes/languages/product_info.php

G. catalog/stylesheet.css"

 

but there is no update data for item F. /catalog/includes/languages/product_info.php

 

I get the message:

 

Warning: require(includes/languages/english/options_images.php) [function.require]: failed to open stream: No such file or directory in C:\xampp\htdocs\laine\options_images.php on line 13

 

Fatal error: require() [function.require]: Failed opening required 'includes/languages/english/options_images.php' (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\laine\options_images.php on line 13

 

Now, Line 13 is:

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_OPTIONS_IMAGES);

 

so I think this indicates there is an options_images file missing - files with that name in catalog/ and admin/.../languages/ but not catalog/.../languages/ (?)

 

Can't see any sign of one from earlier versions, either, so is this why so many other people had trouble?

 

I really would like this to work since it is just what I need but it's getting too time consuming and irritating. Any pointers in the right direction much appreciated.

 

Mike

Share this post


Link to post
Share on other sites

Have any of you wanted to have the sort order actually work. well here is the fix. one stipulation this script is for options as images along with attribute sets contrib installed together. so if you have both installed this should work for you. Make sure you back up so you can go back if this don't work for you.

 

Replace in catalog/options_images.php

 

-----find------

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pov.products_options_values_thumbnail, pa.options_values_price, pa.price_prefix 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 . "' order by pov.products_options_values_name asc");

 

-----Replace with------

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pov.products_options_values_thumbnail, pa.options_values_price, pa.price_prefix, pase.sort_order from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_ATTRIBUTES_SETS_ELEMENTS . " pase 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 pase.options_values_id = pa.options_values_id order by pase.sort_order asc");

 

Hope this helps a lot. Donations would be great when I get that sort of things up and running

Share this post


Link to post
Share on other sites

Congrats! The time is come and it is come. :D

New addon allow Options As Images contribution work together with QTPro.

 

Features:

* Class pad_base is now automatically supports OaI contrib

* Unlimited number of options as images on one product at a time

* Allow to mix options as images with normal options on one product at a time

* Allow to track stock of options as images

* Allow to track stock of normal options

* Allow to mix tracked and nontracked options on one product at a time

Well, its allow to mix all above in every combination. Seems to me that's all work fine.

 

Addon is based on Options As Images 1.7.1, including fix by trikinuke

 

Not many time to test, seems work fine. See later wat's happened. I'm not a PHP or javascript programmer, so it it a good field for optimization and bla-bla-bla. But I completely haven't time to do this. Same for help to anybody. So, if you need help email me or PM. I may not looking for your request on the forum. By the way, if you don't need help, its great! :-"

Edited by RusNN

Share this post


Link to post
Share on other sites

Hi folks,

no errors but unfortunately no function because the drop down list to select a category is empty!!!

(And yes there are categories to select!)

 

THX for help in advance

Thorsten

Share this post


Link to post
Share on other sites

in options_images.php at line:

$options_query = tep_db_query("select * from " . TABLE_PRODUCTS_OPTIONS . " where language_id='" . $language_id . "'");

 

$language_id hold wrong id!!!

put in manualy the correct id...

 

now it works perfect - THX!

Share this post


Link to post
Share on other sites

in options_images.php at line:

$options_query = tep_db_query("select * from " . TABLE_PRODUCTS_OPTIONS . " where language_id='" . $language_id . "'");

 

$language_id hold wrong id!!!

put in manualy the correct id...

 

now it works perfect - THX!

 

hi i have the same problem can u plz help

 

how i can change the correct id

i try it this but not working

 

$options_query = tep_db_query("select * from " . TABLE_PRODUCTS_OPTIONS . " where language_id='" . $language_id . "1"); :(

thx

Share this post


Link to post
Share on other sites

What version of OaI do you using?

 

In all cases the $language_id is wrong, because it must be $languages_id (-s letter were forgotten).

So, try query

 

$options_query = tep_db_query("select * from " . TABLE_PRODUCTS_OPTIONS . " where language_id='" . $languages_id . "'");

Share this post


Link to post
Share on other sites

What version of OaI do you using?

 

In all cases the $language_id is wrong, because it must be $languages_id (-s letter were forgotten).

So, try query

 

$options_query = tep_db_query("select * from " . TABLE_PRODUCTS_OPTIONS . " where language_id='" . $languages_id . "'");

 

thanks alot

i have the last version and i change all

$language_id

to

$languages_id

i think it's 3 or 4 to change and it's working thx alot

 

cheer

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

I am looking for assistance with this contrib "Options as Images"......if there is anyone still alive on this 6 year old thread I am keeping my eyes on it.....

 

thanks....

Share this post


Link to post
Share on other sites

I have just uploaded a package that allows this addon to be used with the bootstrap gold version.

 

To make it simpler to do I did have to remove a few features such as the number of images per row as that is now controlled by bootstrap on different devices, and also the pop up image as I never used it or saw the point of it. This greatly reduced the number of available tables that had to be changes thus simplifying the code.

 

The admin side has been left alone apart from the removal of the un-needed sql code for the two options that were removed.

 

The instructions have also been updated and are hopefully correct, as very little needed to be changed.

 

What needs to be done next is to modularise the whole package and make it into a module once the base code has been updated for the product info page.


REMEMBER BACKUP, BACKUP AND BACKUP

Get the latest Responsive osCommerce CE (community edition) here

It's very easy to over complicate what are simple things in life

Share this post


Link to post
Share on other sites

It looks pretty much like it did before.

 

The way it is set up it has a maximum of 6 images across the screen on larger screens and goes down to two across screens on small screens.

 

Screenshot below

 

 

post-53958-0-66015400-1491723776_thumb.png


REMEMBER BACKUP, BACKUP AND BACKUP

Get the latest Responsive osCommerce CE (community edition) here

It's very easy to over complicate what are simple things in life

Share this post


Link to post
Share on other sites

@@Tsimi

 

I will take a look, but by the looks of it, it uses a drop down menu which is what I was trying to avoid. My customers are not the brightest and when I had just a drop down menu I had so many complaints that they received the wrong items. Having to click below an image stopped the complaints.

 

Still I may give it a go again.


REMEMBER BACKUP, BACKUP AND BACKUP

Get the latest Responsive osCommerce CE (community edition) here

It's very easy to over complicate what are simple things in life

Share this post


Link to post
Share on other sites

@14steve14

Hi Steve

I had another look at this Options as Images and I was able to improve the install process. Now it can be installed without core code changes at all.
I also changed the looks of it to more modern style as shown in many shop demos. Just color tiles without any text or radio buttons. Now you can click on the image to select it.
It might not be what everyone likes or needs but it wouldn't be all too hard to change it back as it was or change the style to a more individual matching layout.

Here the package: Options_as_Images BS v2.2.zip

I might upload it to the apps section but it would need more testing to make sure all corners are covered so to speak.
I don't have 54234234 images to see how it brakes to a new row so if you or anyone out there wants to give this a go and report back I'd appreciate it.

Share this post


Link to post
Share on other sites

@Tsimi

I am getting a latest version store ready, so will give it a go when I get time and test it for you. Thanks for having a lok at this.


REMEMBER BACKUP, BACKUP AND BACKUP

Get the latest Responsive osCommerce CE (community edition) here

It's very easy to over complicate what are simple things in life

Share this post


Link to post
Share on other sites

Hi, @Tsimi

the languages bug solved.

catalog/admin/options_images.php fixed:

  1. (int)$languages_id instead of $language_id (lines 87, 122, 194)
  2. Deleted temporary line 12:  $language_id = '1';

options_images.php

Share this post


Link to post
Share on other sites

@Tsimi

some changes and improvements (Options_as_Images BS v2.2a)

 

1) Defined new constants (languages)

Defined constants TEXT_SELECT_CATEGORY and TEXT_ENABLED_CATEGORIES

catalog/admin/options_images.php    changed lines 73-75, 194
catalog/admin/includes/languages/options_images.php
added:
define ('TEXT_SELECT_CATEGORY', 'Select an option category to edit: ');
define ('TEXT_ENABLED_CATEGORIES', 'You currently have Options as Images enabled for the following options categories: ');


2) The full width thumbnails area (col-sm-12)

This change makes the page shorter if there is a lot of thumbnails.

catalog/includes/modules/content/product_info/  cm_pi_options_images.php    (line 82)
find:

$options_images_output .=   '<div class="col-sm-9">';

replace with:

$options_images_output .=   '<div class="col-sm-12">';


3) CSS - separation of content and design

Inline styles removed. Added to the installation instruction.

catalog/includes/modules/content/product_info/templates/tpl_cm_pi_options_images.php

 

4) <h4> caption hidden if not used

catalog/includes/modules/content/product_info/templates/tpl_cm_pi_options_images.php
find:

  <h4 class="h3"><?php echo MODULE_CONTENT_PI_OI_HEADING_TITLE; ?></h4>

  <?php echo $options_images_output; ?>

replace with:

<?php
if(defined(MODULE_CONTENT_PI_OI_HEADING_TITLE)) {
  echo'  <h4 class="h3">' . MODULE_CONTENT_PI_OI_HEADING_TITLE .'</h4>'. PHP_EOL;
  }

echo $options_images_output; ?>

 

5) Zoom

Just CSS, other files are not affected.

/* Options as images BOF */

/* Remove input from document flow */
label > input{
  position: absolute;
}

/* IMAGE STYLES */
label > input + img {
  cursor: pointer;
  border: 2px solid transparent;
}
label > input + img:hover {
  -webkit-box-shadow: 1px 1px 5px 3px rgba(0,0,0,0.75);
  -moz-box-shadow: 1px 1px 5px 3px rgba(0,0,0,0.75);
  box-shadow: 1px 1px 5px 3px rgba(0,0,0,0.75);
  border: none;
}

/* (RADIO CHECKED) IMAGE STYLES */
label > input:checked + img {
  border: 2px solid #00d502;
}

/* ZOOM */
.cm-pi-options-images label:not(.control-label) {
  padding: 0px;
  transition: transform .33s;
  margin: 0 auto;
  max-width: 50vw;
}
.cm-pi-options-images label:not(.control-label):hover {
  z-index: 9;
  transform: scale(2.5);
  max-width: 100%;
  /* (Note: if the zoom is too large, it will go outside of the viewport) */
  /* Maximum zoom scale should by 2.5 to be able to click the next thumbnail */
  }
 
/* Options as images block */  
.cm-pi-options-images {
  margin-top: 0rem;
  margin-bottom: 5rem;
      
  }
/* Options as images caption */  
.cm-pi-options-images h4,  
.cm-pi-options-images h4.h3 { /* .h3 is not need but because of compatibility with older versions */
  font-size: 110%;
  }  
/* Options labels */
.cm-pi-options-images .control-label {
  margin-top: 1rem;      
  }
/* Options as images EOF */

 

ToDo

1. Full width thumbnails without zoom for mobile devices
2. Bootstrap 4 form class="was-validated" to mark labels (products_options_name) of empty options which are required. May need to change the file catalog/product_info.php - add class to the form on line 46 (BS Frozen)

Options_as_Images_BS_v2.2a.zip

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

×