Community Add-Ons
Options as Images for MS2
for osCommerce Online Merchant v2.2
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
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
