Forums / All Other Contributions/Addons / Attribute image replaces main product image on select [Support Thread]

Attribute image replaces main product image on select [Support Thread]

Views: 44,653

Results 141 to 160 of 177
12 Apr 2018, 3:55 AM
#141
dvtalk avatar

dvtalk

New Zenner

Join Date:
Mar 2018
Location:
USA
Posts:
30
Plugin Contributions:
0

Attribute image replaces main product image on select [Support Thread]

Thank you. Looks like this is quite complicated to integrate, so for now, giving up on this. One other thing I was curious about. The theme I am using has a Quick View mode, where you can order from within a product list page, via modal div. I was able to get the image and attributes to load correctly, however, how do I load the observer script that'll answer to the getattribimage() function?

12 Apr 2018, 4:02 AM
#142
dvtalk avatar

dvtalk

New Zenner

Join Date:
Mar 2018
Location:
USA
Posts:
30
Plugin Contributions:
0

Re: Attribute image replaces main product image on select [Support Thread]

Oh, that was easy. I just copied jscript_ais.php and on_load_ais.js to the /includes/modules/pages/index/ based on the page location I was on:
index.php?main_page=index&cPath=xxx_yyy

24 Apr 2018, 11:46 AM
#143
jiji2018 avatar

jiji2018

Zen Follower

Join Date:
Apr 2018
Posts:
121
Plugin Contributions:
0

Re: Attribute image replaces main product image on select [Support Thread]

I used this plugin above 1.55, without any effect

24 Apr 2018, 12:36 PM
#144
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Attribute image replaces main product image on select [Support Thread]

jiji2018:

I used this plugin above 1.55, without any effect
Welcome to Zen Cart. Please understand that in order to provide assistance, if any is needed, that the existing condition needs to be described. This is generally facilitated by addressing the posting tips items.

Explaining what has been done, possibly including a link to the site, the result(s) of taking action, etc... should make it possible to reproduce the issue so that time can be spent resolving the issue rather than having to pull out the details. Ie. Using the plugin without any effect, doesn't explain very much. If it were installed correctly and attribute images applied correctly and the settings modified by this plugin were selected (which has an effect on the system) then there should be some observable effect in the html code even if the image(s) don't swap. Further, even if all of that html code appears correctly, there may be other javascript on the page that doesn't play nicely or the page could not validate and cause other issues besides just with this plugin.

There's a lot of possibilities, but with your assistance of defining the conditions, issues, and results, then a solution to the problem experienced can be found. Help others help you.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

16 May 2018, 2:22 PM
#145
swisswell avatar

swisswell

New Zenner

Join Date:
Nov 2016
Location:
CHina
Posts:
2
Plugin Contributions:
0

Re: Attribute image replaces main product image on select [Support Thread]

Hello,
I have finished installing the plugin,my version is 1.5.5,but it is not work when select color option
below is the step i installed
1.I upload all files with ftp,and recover all files with same filename
2. I run sql_run.txt,&sql_run_missing_dropdowns.txt,after checking my database ,they are correct running.
3.then i add 'color' in admin--catelog-option name manager,radio button,input attribute 6
4. go to attriabutes controller and add 2 colors black ,blue to one of my product with product_id 1492
and add 2 attriabute images match black and blue
5.when i return the product page Hello,
I have finished installing the plugin,my version is 1.5.5,but it is not work when select color option
below is the step i installed
1.I upload all files with ftp,and recover all files with same filename
2. I run sql_run.txt,&sql_run_missing_dropdowns.txt,after checking my database ,they are correct running.
3.then i add 'color' in admin--catelog-option name manager,radio button,input attribute 6
4. go to attriabutes controller and add 2 colors black ,blue to one of my product with product_id 1492
and add 2 attriabute images match black and blue
5.when i return the product page ,there is not any changed to main page when i click black or blue
6 i tried changed the attriabute to dropdown and checkbox,same issue as above radio button

Attachment 17842Attachment 17843Attachment 17844

16 May 2018, 2:24 PM
#146
swisswell avatar

swisswell

New Zenner

Join Date:
Nov 2016
Location:
CHina
Posts:
2
Plugin Contributions:
0

Re: Attribute image replaces main product image on select [Support Thread]

more attachment of my step
Attachment 17845Attachment 17846Attachment 17847Attachment 17848

16 May 2018, 3:20 PM
#147
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Attribute image replaces main product image on select [Support Thread]

Although my email response did not seem to leave my outbox, I had evaluated the condition with the following response (please ignore cases of hashtags (#), they were generated when pasting the content and were not part of the original message):
Now that I have been able to see the page and evaluate the configuration as presented to a browser, I am able to identify the many changes that have been made to the standard template ‎that are preventing operation of the plugin.

So, here are the things that I see.

  1. It appears that the includes/modules/YOUR_TEMPLATE/attributes.php file or the changes made to it as compared to the default version provided in ZC 1.5.5 have not been incorporated into includes/modules/yourstore/attributes.php. If the file has been uploaded/incorporated, then either the observer file has not been uploaded or there is something else installed that is preventing application of the onchange event to the associated attribute(s).
  2. The id for the main product image has been removed (should be mainProductImage). ##All that is present is:##<div class="back product-main-image__item main-img-zoom">.
  3. I am not able at the moment to review the javascript to see if there is or would be a conflict. The plugin is written to add actions to existing actions when selecting an attribute; however, existing code if loaded after Attribute Image Swap may be written to replace existing actions. The issues above would need to be addressed and tested to further identify the presence of that issue.

‎Respectfully,
mc12345678

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

17 Jun 2019, 11:45 AM
#148
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Attribute image replaces main product image on select [Support Thread]

Over the weekend, submitted version 1.5.10 to this plugin. A version 1.5.9 was independently maintained in github with the changes from that incorporated into this.

The posted description was:

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

This change has been posted for download at: https://www.zen-cart.com/downloads.php?do=file&id=699

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

21 Jan 2020, 12:17 PM
#149
mikebr avatar

mikebr

Zen Follower

Join Date:
May 2007
Posts:
124
Plugin Contributions:
0

Re: Attribute image replaces main product image on select [Support Thread]

Fresh install 1.5.6c
Installed AIS 1_5_10
Using 8 for Attribute style, image swapping working fine for radio button option values.
problem: 1 long vertical list of radio button option values is the result (30 values of Color Names).

Question: Would like to convert that one column to 3 or 4 columns with CSS .

Any help would be appreciated

21 Jan 2020, 4:58 PM
#150
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Attribute image replaces main product image on select [Support Thread]

mikebr:

Fresh install 1.5.6c
Installed AIS 1_5_10
Using 8 for Attribute style, image swapping working fine for radio button option values.
problem: 1 long vertical list of radio button option values is the result (30 values of Color Names).

Question: Would like to convert that one column to 3 or 4 columns with CSS .

Any help would be appreciated
Doing an internet search on the concept I found in stackoverflow some references to how the number of columns can be forced with CSS and supposedly provided multiple columns (assuming all else about the page supports the additional columns).

The following was what I used to force 2 columns when looking at the Zen Cart demo data product with products_id 132 (uses check boxes instead of radios, but similar markup is expected):

.wrapperAttribsOptions {
    column-count: 2;
}

where column-count was added to whatever else existed there. In my case it was found in the responsive_classic template's CSS folder for file stylesheet.css at or around line 374, though I don't claim that my css file is up-to-date as I have not ensured that it has remained up-to-date in my current testing environment.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

21 Jan 2020, 6:35 PM
#151
mikebr avatar

mikebr

Zen Follower

Join Date:
May 2007
Posts:
124
Plugin Contributions:
0

Re: Attribute image replaces main product image on select [Support Thread]

thanks
worked like a charm
Attachment 18813

26 Jan 2020, 6:17 PM
#152
mikebr avatar

mikebr

Zen Follower

Join Date:
May 2007
Posts:
124
Plugin Contributions:
0

Re: Attribute image replaces main product image on select [Support Thread]

ZenCart 1.5.6c
PHP 7.1
AIS 1.5.10

Great module.
AIS has introduced Image Style choices 6,7, and 8 within option_manager to be entered in the Attribute Styles field.
All these choices (6,8) operate on and replace the Main Product Foreground Image.

Question:
Can additional choices such as 9,10, and 11 be developed to operate on and replace the Main Product Background Image?
thanx
mike

18 Mar 2020, 9:17 AM
#153
ikirin avatar

ikirin

New Zenner

Join Date:
Apr 2019
Location:
shanghai
Posts:
27
Plugin Contributions:
0

Re: Attribute image replaces main product image on select [Support Thread]

Attachment 18901

The attribute picture can replace the main picture normally, but the main picture after replacement cannot be displayed normally.
not work at Image Handler 5 (Zen Cart 1.5.5+).
Enlarged picture cannot be displayed.

Uninstall Image Handler 5 (Zen Cart 1.5.5+) and it works:(

18 Mar 2020, 9:23 AM
#154
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Attribute image replaces main product image on select [Support Thread]

ikirin:

Attachment 18901

The attribute picture can replace the main picture normally, but the main picture after replacement cannot be displayed normally.
not work at Image Handler 5 (Zen Cart 1.5.5+).
Enlarged picture cannot be displayed.

Uninstall Image Handler 5 (Zen Cart 1.5.5+) and it works:(
I thought I remembered seeing an issue in the IH5 forum thread about issues with the suffix _LRG being added to filenames when that file did not exist. While this seems to occur when using this software, because it doesn't work with IH5 and does without, it would seem that there is an issue with the particular version of IH5 installed. When you go to that thread, after searching for the similar issue, if posting, please identify what specific version of IH5 is installed.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

19 Mar 2020, 2:14 AM
#155
ikirin avatar

ikirin

New Zenner

Join Date:
Apr 2019
Location:
shanghai
Posts:
27
Plugin Contributions:
0

Re: Attribute image replaces main product image on select [Support Thread]

Thanks for the response,I am looking for help on IH5 thread,IH5(V.5.1.8) does not seem to be able to compress attribute images.
Attachment 18903

26 Mar 2020, 2:21 PM
#156
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,116
Plugin Contributions:
56

Re: Attribute image replaces main product image on select [Support Thread]

ikirin:

Thanks for the response,I am looking for help on IH5 thread,IH5(V.5.1.8) does not seem to be able to compress attribute images.
Attachment 18903
See this IH-5 support-thread posting for the change needed to provide interoperation between IH-5 and this plugin.

15 Apr 2020, 2:16 AM
#157
ikirin avatar

ikirin

New Zenner

Join Date:
Apr 2019
Location:
shanghai
Posts:
27
Plugin Contributions:
0

Re: Attribute image replaces main product image on select [Support Thread]

Works perfectly, thank you very much for your response:cool:

15 Apr 2020, 2:17 AM
#158
ikirin avatar

ikirin

New Zenner

Join Date:
Apr 2019
Location:
shanghai
Posts:
27
Plugin Contributions:
0

Re: Attribute image replaces main product image on select [Support Thread]

lat9:

See this IH-5 support-thread posting for the change needed to provide interoperation between IH-5 and this plugin.

Works perfectly, thank you very much for your response:cool:

24 Aug 2020, 4:07 PM
#159
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: Attribute image replaces main product image on select [Support Thread]

ZC1.5.7
PHP7.4
AIS1.5.10
Dynamic Price Updater v3.2.1

on a testing server with many other mods..

The product page keeps refreshing with a alert popup "Status returned - parsererror" .. think it's similar to DPU before you updated it.

Some of the Console log:

Object  { cache: false, type: "POST", traditional: true, dataType: "json",  timeout: 30000, data: {…}, url:  "ajax.php?act=attrib_prod_info&method=swap_image&products_id=73"  }

onload@https://localhost/public_html/zen157/index.php?main_page=product_info&cPath=10_9&products_id=73:7:3

Object  { readyState: 4, getResponseHeader: getResponseHeader(e),  getAllResponseHeaders: getAllResponseHeaders(), setRequestHeader:  setRequestHeader(e, t), overrideMimeType: overrideMimeType(e),  statusCode: statusCode(e), abort: abort(e), state: state(), always:  always(), catch: catch(e), … }

SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
    jQuery 5
    deferred https://localhost/public_html/zen157/index.php?main_page=product_info&cPath=10_9&products_id=73:106
    Deferred jQuery
    ajax https://localhost/public_html/zen157/index.php?main_page=product_info&cPath=10_9&products_id=73:72
    getattribimage https://localhost/public_html/zen157/index.php?main_page=product_info&cPath=10_9&products_id=73:333
    onclick https://localhost/public_html/zen157/index.php?main_page=product_info&cPath=10_9&products_id=73:1
    ais_init https://localhost/public_html/zen157/index.php?main_page=product_info&cPath=10_9&products_id=73:397
    onload https://localhost/public_html/zen157/index.php?main_page=product_info&cPath=10_9&products_id=73:2

Dave
Always forward thinking... Lost my mind!

27 Oct 2024, 11:01 PM
#160
cath avatar

cath

New Zenner

Join Date:
Jun 2006
Posts:
21
Plugin Contributions:
0

Re: Attribute image replaces main product image on select [Support Thread]

Good morning!

I'm working locally.

I renamed the template and admin folders in 1_Main_Files and 2_ZC_Version.

I copied the contents of both folders to my ZC folder. I used ZC156 from the 2_ZC_Version folder.

When I checked Option Name Manager, there were no options (the page was blank).

I then ran the following (and it said it was successful):

SELECT @products_options_types_id := pot.products_options_types_id+1 FROM `products_options_types` pot order by pot.products_options_types_id desc limit 1;

When I ran the following, I received the message: WARNING: An Error occurred, please let us know! If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you entered valid data.

INSERT INTO `products_options_types` (products_options_types_id, products_options_types_name) VALUES (@products_options_types_id, 'Link');

INSERT INTO `configuration` (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('Link product option type', 'PRODUCTS_OPTIONS_TYPE_LINK', @products_options_types_id, 'Numeric value of the link product option type', 6, 0, now(), NULL, NULL);

and my Option Name Manager screen was still blank.

Backup to the rescue!

Can anyone tell me where I've gone wrong?

Thanks in advance.