Contributions
Options as Images
This contribution will allow you to assign an image to each of your products options values.
The options available for each product are then shown as a "grid" of images from which the customer
can select via radio buttons.
The admin side of this contribution provides a facility for uploading images for each product option
and also some configuration options to control the behaviour of the options as images function :-
1. Enable/Disable Options as Images - when disabled, standard functionality is returned, i.e., dropdown list.
2. Number of images per row - number of images in each row of the grid presented to the customer
3. Image Height
4. Image Width
5. Enable/Disable "Click to Enlarge" function - when set, allows the customer to click the images for a larger view
Expand All / Collapse All
This 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.
ADDON ONLY, instructions included
Now image has link when clicking.
+ Improve: URL Hyperlink when clicking an image. It's very interesting to have got an extra feature, that is the availability of having a link when clicking the image, which it obvioulsy would point to the related product URL link of the image.
Sometimes is better to keep everything as simple as possible, and avoid lots of bells and wishles. This is the working version for v2.2 Release Candidate 2a vanilla install, and is supposed to work on earlier versions due to de catalog/product-info.php is almost the same from oscommerce-2.2ms2-060817.
The operational module and framework was made by andes1 and the compilation of working fixes used here were made by rusNN, some of this working fixes were made for a lot o people among them lildog.
Here you can find the instructions (I did not correct those), but always, and for your good sake, is better use Wincompare or another software in order to compare and modify files.
Note:
I did not make any change in order to get the first option selected or something like that, this let us some space to maneuver in order to install sort attributes or a similar module.
Options as images v1.7.2
Fixed: only ONE group of attibutes was checked, the rest (if exists) had not any option checked, and one (and only one of them) must be checked. See screenshot "error.jpg" for a better understanding.
Several spanish language files fixed or included in package, there were not included or were incomplete in v1.7.1.
* Suggestion: options_images.php should be in catalog/includes/modules like product_listing.php and the rest of the typical modules.
FULL PACKAGE.
-----------------------------------------------------------------------------------------
Soon I will upload a new version: Options as HYPERLINKED images v2.0 - Now image has link when clicking
-----------------------------------------------------------------------------------------
I've noticed that when you go to product page from the shopping cart clicking on the product, options as images doesn't selects properly. To fix this find code in catalogoptions_images.php
if ($iec=='1') { $checkedd=''; } else { $checkedd='checked'; }
and replace it with the code
if ($selected_attribute != $opti_array['id']) {
if ($iec=='1') { $checkedd=''; } else { $checkedd='checked'; }
} else {
$checkedd='checked';
}
Seems to me that's correct.
FULL PACKAGE, including fix for 1.7 by me + Update Guides
Fix: forgot closing operator bracket in new code.
Should be
if ($option_value_image = new upload('value_image_input', DIR_FS_CATALOG_IMAGES.'options/')) {
if (tep_not_null($option_value_image->filename)){
tep_db_query("update " . TABLE_PRODUCTS_OPTIONS_VALUES . " set products_options_values_thumbnail = '" . tep_db_input($filename) . "' where products_options_values_id = '" . tep_db_input($cID) . "'");
}
}
FULL PACKAGE. Fixed options_images.php and update guide for v1.7
+ replace some code with more osc friendly/familiar code
- deleted useless code
Full Package + Update Guides
There was a bug when trying to edit options images. If you had only one option with images you could not edit the option as the form was submitted when you selected a different option than the default. I added a button instead.
FULL PACKAGE + update guides
Included RusNN's fix into a complete package to try to keep it neat.
Full Package + update guide
Great contrib! That's all I need for my shop. Thanks!
But I've discovered, that text "Available Options:" is appered for every products even if a product has no options. It happens only when setting OPTIONS_AS_IMAGES_ENABLED is enabled.
To correct this goto options_images.php, find around line 15
echo '<b><span class="optionsAvailable">' . TEXT_PRODUCT_OPTIONS. '</span></b>';
and move it a bit lower under the line
if ($products_attributes['total'] > 0) {
So you should have
if ($products_attributes['total'] > 0) {
echo '<b><span class="optionsAvailable">' . TEXT_PRODUCT_OPTIONS. '</span></b>';
That's all. No files attached.
Sorry my bad english :)
+ added spacing between options to keep them separate and unjumbled, this is most noticable with options with names longer than the width of the picture.
+ fixed the formatting on product info page, it was jumbled when more than 1 set of options was added
+ deleted an unused line from the language file
+ corrected a spelling mistake in admin- thanks to Chuck Siemons
Full Package + Update Guide
- I accidentally left some custom debug code in admin/options_images.php
Full Package + update guide
+ fixed some logic in admin/options_images.php
Full Package+update guides
+ fixed the upload function. options images now upload correctly
+ formatted some code.
+ fixed the delete image function
+ added support thread: http://forums.oscommerce.com/index.php?showtopic=317064
+ added the sql file back in
+ added enable/diable category compatibility notes
+ added attributes sets plus compatibility notes
+ deleted extra files in directory structure
+ there was a line commented in catalog/options_images.php that is necessary to make the correct table structure.
+ works with osc RC2a
EASY update.
Complete Package + update instructions in install doc
This is a complete updated package with Swedish language files. This package do not include the modifications by beddo and kit (se below). Installation should be a breeze. Honors to previous authors.
Sara
A. Put texts where they belong, in the language files.
B. if options as images is on but a product has options without images, don't display 'Please select your desired option using the buttons provided' OR Click the images to enlarge.
This will make the first image in the loop checked.
See live example at: http://www.nerdesigngroup.com/standard-ecommerce-website.htm
Sorry forgot to add one line to the file. . . use this file for instructions.
support thread http://forums.oscommerce.com/index.php?showtopic=55760&st=60&gopid=1139545&#entry1139545
OK. . .so I got all of my attributes up for a product with images. . all working very nicely, but then when I looked at the store, all of the attributes were automatically checked and I could not uncheck them. . so here is the fix.
Single txt document with instructions. . very simple, one line change.
Thanks,
Kyla
Rangeline Design
www.rangelinedesign.com
support thread http://forums.oscommerce.com/index.php?showtopic=55760&st=60&gopid=1139545&#entry1139545
OK. . .so I got all of my attributes up for a product with images. . all working very nicely, but then when I looked at the store, all of the attributes were automatically checked and I could not uncheck them. . so here is the fix.
Single txt document with instructions. . very simple, one line change.
Thanks,
Kyla
Rangeline Design
www.rangelinedesign.com
This allows you to delete the option category image. And when you delete an image from a category clears it from your catalog/images/options directory
in catalog/admin/options_images.php
***FIND:
case 'delete':
tep_db_query("update " . TABLE_PRODUCTS_OPTIONS_VALUES . " set products_options_values_thumbnail = '' where products_options_values_id = '" . tep_db_input($vID) . "'");
tep_redirect(tep_href_link(FILENAME_OPTIONS_IMAGES, tep_get_all_get_params(array('action'))));
break;
ADD AFTER:
case 'delete_option_image':
****actually delete the image here from server
tep_db_query("update " . TABLE_PRODUCTS_OPTIONS . " set products_options_thumbnail = '' where products_options_id = '" . (int)$oID . "'");
tep_redirect(tep_href_link(FILENAME_OPTIONS_IMAGES, tep_get_all_get_params(array('action'))));
break;
***FIND:
echo ' '.tep_draw_form('option_image', FILENAME_OPTIONS_IMAGES,tep_get_all_get_params(array('action')).'action=save_option_image', 'post', 'enctype="multipart/form-data"');
echo TITLE_OPTION_IMAGE.' '.tep_draw_file_field('option_image').' '.tep_image_submit('button_upload.gif',IMAGE_UPLOAD, 'align="absbottom"');
REPLACE WITH:
echo ' '.tep_draw_form('option_image', FILENAME_OPTIONS_IMAGES,tep_get_all_get_params(array('action')).'action=save_option_image', 'post', 'enctype="multipart/form-data"');
echo TITLE_OPTION_IMAGE.' '.tep_draw_file_field('option_image').' '.tep_image_submit('button_upload.gif',IMAGE_UPLOAD, 'align="absbottom"').' <a href="' . tep_href_link(FILENAME_OPTIONS_IMAGES, 'action=delete_option_image&oID=' . $options_id ).'">' . tep_image_button('button_delete.gif', IMAGE_DELETE,'ALIGN=absbottom');
***FIND:
case 'delete':
tep_db_query("update " . TABLE_PRODUCTS_OPTIONS_VALUES . " set products_options_values_thumbnail = '' where products_options_values_id = '" . tep_db_input($vID) . "'");
tep_redirect(tep_href_link(FILENAME_OPTIONS_IMAGES, tep_get_all_get_params(array('action'))));
break;
case 'delete_option_image':
tep_db_query("update " . TABLE_PRODUCTS_OPTIONS . " set products_options_thumbnail = '' where products_options_id = '" . (int)$oID . "'");
tep_redirect(tep_href_link(FILENAME_OPTIONS_IMAGES, tep_get_all_get_params(array('action'))));
break;
***REPLACE WITH:
case 'delete':
$options_query = tep_db_query("select products_options_values_thumbnail from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . tep_db_input($vID) . "'");
$options_id = tep_db_fetch_array($options_query);
@unlink(DIR_FS_CATALOG_IMAGES.'options/'.$options_id['products_options_values_thumbnail']);
tep_db_query("update " . TABLE_PRODUCTS_OPTIONS_VALUES . " set products_options_values_thumbnail = '' where products_options_values_id = '" . tep_db_input($vID) . "'");
tep_redirect(tep_href_link(FILENAME_OPTIONS_IMAGES, tep_get_all_get_params(array('action'))));
break;
case 'delete_option_image':
$options_query = tep_db_query("select products_options_thumbnail from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$oID . "'");
$options_id = tep_db_fetch_array($options_query);
@unlink(DIR_FS_CATALOG_IMAGES.'options/'.$options_id['products_options_thumbnail']);
tep_db_query("update " . TABLE_PRODUCTS_OPTIONS . " set products_options_thumbnail = '' where products_options_id = '" . (int)$oID . "'");
tep_redirect(tep_href_link(FILENAME_OPTIONS_IMAGES, tep_get_all_get_params(array('action'))));
break;
not a complete package
Options as Images for MS2 1.5
Some changes, and revisions, to ensure easy and smoot installation,plus funtionality.
complete package not included beddo and kit modifications. see secreens shots.
is very helpfull if you are offering additional products to your pricipal product.
eje: Add wireles mouse to your laptop.Soda to your pizza.Diamons to your gold ring.Etc.
For some reason my previous post is resulting in an incorrect file being downloaded (that of the previous post).
I have several versions of the file knocking around now so hopefully this is the right one!
This package contains updated admin file - fully reworked, cleaned code, optimized, changed for OSC standart classes usage. Added option image feature (image for option itself, not values), but without customers part support. So you'll have to dervelop user part support by yourself.
Options as Images for MS2 v1.2 adapted to work with Product Attributes - Option Type and Attribute Sets Plus
I needed the functionality provided by this mod, however encountered a problem in that installing it and turning it on made it get really confused with Option Types.
So I fixed it :)
This version of the mod will allow you to have all the different types of options allowed by the original mod. However it is important to note that if you want the options to appear as images, they MUST but a standard "select" drop down box.
You should download the full Options for Images contribution as released by Mark Stephens on 25 Aug 2003 and install this - but read the next few lines as there are some bits of that install which you MUST NOT do.
It also includes the update provided by Mikael Nyberg on 25 Jun 2004 and does not affect the subsequent updates to catalog/admin/options_images.php which must still be applied as if you were just installing Options as Images normally.
**********************************
catalog/admin/options_images.php fix
**********************************
The previous fix does not work fine for me (problem on options_images admin page and did not solve the foreach() problem.
So I apply the fix who seems to be difficult (not really) and you can find in this package a fixed admin options_images.php file.
I also modify it to display correct size of the options images : not width 50,height 50, but the dimension you put in the configuration page.
Hope it helps someone, and sorry for my poor english :)
Long life to the community !
Nmouns
the last fix was a bit hard to understand for some, so here is the fixed file, use the code or just replace the relevent file.
catalog/admin/options_images.php
credit still goes to ken yong as it his code
Issue: The delete button is not working in this contribution.
Fix:
After case 'update_enabled', add this:
case 'delete':
tep_db_query("update " . TABLE_PRODUCTS_OPTIONS_VALUES . " set products_options_values_thumbnail = '' where products_options_values_id = '" . tep_db_input($cID) . "'");
break;
}
}
Issue: As for the foreach() error,
After:
case 'update_enabled':
tep_db_query("update " . TABLE_PRODUCTS_OPTIONS . " set products_options_images_enabled = 'false'");
Add:
if ( !empty($HTTP_POST_VARS ['option_select']) ) {
After the upcoming:
break;
Add:
}
That's it! The file attached contains the same info.
This fixes a problem in 'Options as Images for MS2 v1.2' : When viewing a product, all the checkboxes for an option are marked as 'checked', which (in my browser anyway) always shows the last option as selected. This fix changes this so that
- If the product is browsed from a cart item, the radio button corresponding to the chosen option is checked.
- If the product is browsed from elsewhere, the radio button corresponding to the first option is checked.
This update introduces the ability to set either Options as Images or traditional dropdown selectors for each option
type. For instance, you could have Options as Images for Color, a dropdown for Size, and so on.
Instructions are included for both new install and update from previous version.
Now includes the missing line in the .sql file that add the thumbnail field to the products_options_values table.
This contribution will allow you to assign an image to each of your products options values.
The options available for each product are then shown as a "grid" of images from which the customer
can select via radio buttons.
The admin side of this contribution provides a facility for uploading images for each product option
and also some configuration options to control the behaviour of the options as images function :-
1. Enable/Disable Options as Images - when disabled, standard functionality is returned, i.e., dropdown list.
2. Number of images per row - number of images in each row of the grid presented to the customer
3. Image Height
4. Image Width
5. Enable/Disable "Click to Enlarge" function - when set, allows the customer to click the images for a larger view
Note: Contributions are used at own risk.