Could you elaborate for the other readers about either the issue or what had to be done to "make it work"?
The answer to the other previous question would have been yes. :) But would still be glad to take a look.
On my sample site, I also have the same "issue" that with dropdowns, the possible attribute image(s) remain below the select (dropdown) option. There are ways to make that either more of a feature or to at least have it removed automatically if so desired.
In includes/classes/observers/auto.attrib_image_swap.php if you find this section:
Code:
// NOTIFY_ATTRIBUTES_MODULE_OPTION_BUILT
function updateNotifyAttributesModuleOptionBuilt(&$callingClass, $notifier, $products_options_names_fields, &$options_name, &$options_menu, &$options_comment, &$options_comment_position, &$options_html_id, &$options_attributes_image)
{
global $products_options;
if ($products_options->RecordCount() == 1 && $products_options_names_fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_LINK) {
array_pop($options_name);
array_pop($options_menu);
array_pop($options_comment);
array_pop($options_comment_position);
array_pop($options_html_id);
//array_pop($options_attributes_image); // This may need to be commented out because the $options_attributes_image variable is not addressed in the below called function and if it should remain associated with this attribute assignment as part of displaying the information.
// With testing, (grid product having a single option value for each of a single option name, one single option value and one multiple option values and in conjunction with another non-grid attribute that displayed a picture.) it didn't seem to matter one way or the other.
// Flow pushes the attribute image to the $options_attributes_image array before coming to this notifier and does so for all attribute types.
// That said, it would seem that if the single option value option type were called upon and that images are in other ways addressed by the below code, then this array item should be popped off the set as well.
// This could maybe be commented out for 2 reasons: 1) images are not addressed in the below called function, and 2) if they need to be cleared they will below.
$this->updateNotifyAttributesModuleDefaultSwitch($callingClass, $notifier, $products_options_names_fields, $options_name, $options_menu, $options_comment, $options_comment_position, $options_html_id);
}
if ($products_options_names_fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_SELECT) {
array_pop($options_attributes_image); // This may need to be commented out because the $options_attributes_image variable is not addressed in the below called function and if it should remain associated with this attribute assignment as part of displaying the information.
// With testing, (grid product having a single option value for each of a single option name, one single option value and one multiple option values and in conjunction with another non-grid attribute that displayed a picture.) it didn't seem to matter one way or the other.
// Flow pushes the attribute image to the $options_attributes_image array before coming to this notifier and does so for all attribute types.
// That said, it would seem that if the single option value option type were called upon and that images are in other ways addressed by the below code, then this array item should be popped off the set as well.
// This could maybe be commented out for 2 reasons: 1) images are not addressed in the below called function, and 2) if they need to be cleared they will below.
}
}
Adding the code in blue above will remove the options_attributes_image "row" from all select lists... Ideally there might be a "switch" added to the configuration window (or another option name selection) that would make that possible or I guess the code could be modified to treat option 7 as allowing image swap in all cases, but not to show the attribute image adjacent to the attribute which would require a little bit of a rewrite to the code besides just modifying the above. (Basically I think it would be to remove all existing cases of '7' from within the observer and in the above check to see if 7 is set and if so, then remove the attribute image from the above selections such that each attribute would know what image to present, but only an image swap would occur..) Maybe that was the original point of those settings... It certainly wasn't clear (to me) before and didn't seem to work in a way that made sense.
Bookmarks