Re: Attribute image replaces main product image on selecting attribute
Quote:
Originally Posted by
Nick1973
Unless you want to have a go at installing it yourself? I'm happy to give you FTP access etc through a PM. I may have installed it incorrectly for all I know.
Same "timing" issue applies, but let me know as much detail as can about path or land me as close to the "root" of the store/catalog as possible. :)
Re: Attribute image replaces main product image on selecting attribute
Quote:
Originally Posted by
mc12345678
Same "timing" issue applies, but let me know as much detail as can about path or land me as close to the "root" of the store/catalog as possible. :)
Shall I PM you then?
Re: Attribute image replaces main product image on selecting attribute
Quote:
Originally Posted by
Nick1973
Shall I PM you then?
It's ok I have it working, I will PM you the URL for you to see it as it contains my server IP.
However will try to remember to put a link here when it goes live.
Re: Attribute image replaces main product image on selecting attribute
Quote:
Originally Posted by
Nick1973
It's ok I have it working, I will PM you the URL for you to see it as it contains my server IP.
However will try to remember to put a link here when it goes live.
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.
2 Attachment(s)
Re: Attribute image replaces main product image on selecting attribute
Quote:
Originally Posted by
mc12345678
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.
In all honesty I had just installed it incorrectly. I uploaded the files in the instructions but couldn't see any change admin side, however I missed the bit that says 'Attribute Style for Radio Buttons/Checkbox: set a value of 6' - this is in 'Catalog > Option Name Manager'
Attachment 17085
Find the Option Name you want to Edit, then Click 'Edit'
You will then arrive at this screen:
Attachment 17086
From here select: 6= Attribute Image Replaces Main Product Image
I have this working now and for anybody thats interested, if you don't want an attributes image to show next to your Attributes Select Menu, just add the code as described by mc12345678 thats highlighted in blue on the previous post.
I also went a step further, I did not want the 'Larger Image' link so I went and edited zcAttrib_prod_info.php
If you also want to do the same, look in the above file by doing a 'find' or 'search' in the above file for:
$image_return = '<a href="javascript:popupWindow(\'' . zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'products_image_large_additional=' . $products_image_large) . '\')">' . $image . '<br /><span class="imgLink">' . $larger_text . '</span></a>';
and change to:
$image_return = '' . $image . '';
} else { // mc12345678 Used to assign an indicate to return to the original image.
$image_return = "";
this will stop the image from linking to a larger image.
Re: Attribute image replaces main product image on selecting attribute
Is this module supposed to show the popup image when clicked? For me it's showing "no image".
Re: Attribute image replaces main product image on selecting attribute
Quote:
Originally Posted by
ideasgirl
Is this module supposed to show the popup image when clicked? For me it's showing "no image".
The file: includes/classes/ajax/zcAttrib_prod_info.php
attempts to load the template override version of the module file typically named: main_product_image.php (referenced by the constant FILENAME_MAIN_PRODUCT_IMAGE) and also provides a link for the file that is referenced/identified by the $products_image_large name. It was verified to work with even Image Handler 4. Now the latest version (under review) also supports the latest version of the ZC plugin called Zen color box and will offer the ability to see the swapped image as a popup as intended via color box.
Plugins that modify associated files may provide different results. Following the guidance of the posting tips when further attempting to address the discrepancy will help to narrow down the source of the issue.
Re: Attribute image replaces main product image on selecting attribute
Yes, but never worked. I gave up.
Re: Attribute image replaces main product image on selecting attribute
Quote:
Originally Posted by
ideasgirl
Yes, but never worked. I gave up.
Too bad... Haven't been able to get to a computer to possibly review the site, I remember looking at a page from my mobile, but can't remember what link I followed to get there. Also, without knowing anything about the setup, it is not possible to even suggest what may be going on or wrong. So, if there is/was a desire to make it work or identify why it wasn't working in the particular setup, but it worked in a vanilla install of ZC 1.5.5e, then more effort is needed.
Re: Attribute image replaces main product image on selecting attribute
Yes, don't worry. I was looking for an alternative to my "attributes image popup" since it stopped showing the thumbnails. But I updated the script and now I have it back (which I prefer because the images for attributes will display where they belong).
I really don't know why it didn't work because I don't think there's anything else that could be affecting it.
Keep up the good work! :smartalec: