Attribute image replaces main product image on sel
This module provides the functionality to get the attribute image in place of main product image when user selects the particular attribute. This functionality has a full control through admin. It can made on and off using admin. It is very easy to integrate with zen cart. To use this functionality , copy this module and run the sql query using admin sql patches. To ON this functionality select the option name in option name manager and put the value 6 in Attribute Style for Radio Buttons/Checkbox:text box. It also works for check box and has additional option type Link. It can be made off by putting value 7 . Thanks. Will appreciate responce. |
![]() |
v1.5.3, v1.5.4, v1.5.5, v1.5.6 |
![]() |
vishalmelmatti |
![]() |
mc12345678 - 16 Jun 2019 |
![]() |
5,269 |
Version History
Attribute image replaces main product image on sel - Version: v1.5.10 | |||||||||||||
This update incorporates the changes made to support version 1.5.9 and 1.5.10. Updated 06/16/19, V1.5.10: (mc12345678) - Primarily updated what is now considered 1_Main_Files. - Moved files into sub-folders to improve clarity of installation and to identify Zen Cart version specific files. - Moved admin language defines out of the core language file for options_name_manager.php and placed in a separate file. - Updated ajax.php file to the Zen Cart V1.5.6b version. - Addressed a few minor PHP 7.3 related issues. - Improved incorporation with Zen Colorbox. - Added display of images for option type 6 when applied to radio buttons and checkboxes as if the image type had been set to 0. - Added scope declaration for methods in the observer class. - Updated install and remove SQL, including comments for understanding. Updated 04/07/18, V1.5.9: (mc12345678) - Added try/catch javascript style code to support return from shopping cart where attributes do not have an assigned action. - Added observer to modify the shopping_cart image based on selections made when adding the product to the cart. - Corrected an encoding issue with the ajax file (Changed from UTF-8 with BOM to ANSI) - Added the $zco_notifier to the ajax file to support changes made in the module main_product_images to offer the use of observers. - Reworked the ajax file to offer up-front processing. - Added a function (get_attrib_image) to the observer class to reduce code redundancy and to offer a consistent image retrieval method. Github location: https://github.com/mc12345678/Attribute_image_Swap |
|||||||||||||
|
|||||||||||||
Attribute image replaces main product image on sel - Version: 1.5.8 | |||||||||||||
Updated 07/16/17, V1.5.8: (mc12345678) 1. Incorporated an option to swap the attribute image but not to show the attribute image adjacent to the attributes. 2. Added some code commenting in areas to highlight code changes needed for installation. 3. Incorporate additional data type casting to ensure data is provided in a known format. 4. Reduce the file checking if PRODUCTS_IMAGE_LARGER_TEXT_FILE_IMAGE is defined and set to off. 5. Incorporate the code applicable to zen colorbox (https://www.zen-cart.com/downloads.php?do=file&id=1322) to support the swapped image being used within the colorbox in version 2.1.0 of that plugin or higher. 6. Further refined the display/transmission of the additional javascript handling image swap if the setting(s) support displaying the image (ie. a status of 6 or 8 at this time as a status of 7 disables the display of attribute images. 7. Corrected initial load (reload upon return from shopping cart with product in the cart) functionality to properly handle checkbox and radio selections, also to not try to take image action while updating the quantity of product. |
|||||||||||||
|
|||||||||||||
Attribute image replaces main product image on sel - Version: v1.5.7 | |||||||||||||
- Added "Removal" of most of the javascript code if the admin option to not display attribute images is set to true. This is expected to have a positive impact on load speed for such conditions. - Modified the approach to the image swap, but left behind the previous code with it commented out. The reason is that now instead of returning a newly formatted image (which requires more device communication), the original image is "restored" if there is no attribute image assigned. - Added some console logging of debug information if the attempt to execute the initialization code fails. |
|||||||||||||
|
|||||||||||||
Attribute image replaces main product image on sel - Version: v1.5.6 | |||||||||||||
- Modified approach to display the swapped attribute image to use ZC's ajax method instead of an additional file from this plugin. - Updated the install SQL to account for other products_options_types having been added. - Used POST related transfer of data rather than the URL to improve on security. - Added that if an attribute selected does not have an image associated with it that the default/main product's image would be displayed. - Added javascript to load the attribute image if the product information page is displayed with the attribute(s) already selected. - Incorporated the module main_product_image.php code to support Image Handler operation on the attribute file. - Moved added attributes related code into an observer file with minor modifications made to the provided attributes.php file associated with ZC 1.5.5's version of the file. Additional effort would be needed to completely remove all modifications and instead use more of a javascript insertion/modification. - Modified/expanded the readme instructions. - Added a SQL query to be run if determined necessary because of not updating to ZC 1.5.5 and missing database records. - Modified code to use ZC standard defined variables/constants rather than hard-coded (i.e. DIR_WS_IMAGES instead of 'images/') - Made use of an image such as bigger_picture.jpg optional where the standard 'larger image' (TEXT_CLICK_TO_ENLARGE) text will be shown if the file does not exist. - Resequenced the javascript so that expected variables/data would be in scope, minimizing the processing needed to display/correct the javascript code. - Reduced the amount of code that needed to be merged versus added by pulling the javascript code added by this module out of jscript_main.php and putting it into its own jscript_ file. - Moved an extra function demonstrated to be called only by this plugin into the observer class, although the code that calls the zen_link function doesn't provide all of the data necessary to use the function to its maximum extent. The code remains intact, but does not appear to provide the intended operation/capability. - As compared to the previous version, the additional attribute images will be displayed if the attribute image style is selected to be 6, but will be removed if set as 7. In both conditions 6 and 7, the attribute image will be swapped with the main product image upon selection. |
|||||||||||||
|
|||||||||||||
Attribute image replaces main product image on sel - Version: 1.5.5 | |||||||||||||
Merged with latest 1.5.5 version of Zen Cart. | |||||||||||||
|
|||||||||||||
Attribute image replaces main product image on sel - Version: 1.3.7.1 | |||||||||||||
In this improved verson, the main image remains same for the attribute which do not have attribute images. This module provides the functionality to get the attribute image in place of main product image when user selects the particular attribute. Attribute images can be opened in new popup window. This functionality has a full control through admin. It can made on and off using admin. It is very easy to integrate with zen cart. To use this functionality , copy this module and run the sql query using admin sql patches. To ON this functionality select the option name in option name manager and put the value 6 in Attribute Style for Radio Buttons/Checkbox:text box. It also works for check box and has additional option type Link. It can be made off by putting value 7 . Will appreciate responce. Please let me know your valuable comments which are very important for me to further upgrade this module. Thanks. |
|||||||||||||
|
|||||||||||||
Attribute image replaces main product image on sel - Version: 1.3.7.0 | |||||||||||||
|
|||||||||||||