Page 7 of 17 FirstFirst ... 56789 ... LastLast
Results 61 to 70 of 161
  1. #61
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Attribute image replaces main product image on selecting attribute

    Not without new custom coding. I don't think any existing mod covers that situation.

  2. #62
    Join Date
    Jul 2009
    Posts
    127
    Plugin Contributions
    0

    Default Re: Attribute image replaces main product image on selecting attribute

    Yeah I figured, how difficult do you think it would be. I'm alright with coding, but I've never written an app for my self outside of a few log in scripts.
    The other thing that I wanted to know is how to update the cart so that it shows the attribute image that was selected when it was added to the cart. this is really only noticeable for an attribute like color but currently it shows the image of the original.

  3. #63
    Join Date
    Aug 2011
    Posts
    6
    Plugin Contributions
    0

    Default Re: Attribute image replaces main product image on selecting attribute

    I'd like to add a note about this add-on.

    It works with Image Handler 3, as long as you EXPLICITLY specify both medium image width & medium image height. Also, this add-on is dependent upon your main product image img tag being wrapped in a div with ID="productImageMain" because the javascript replaces the elements within the container of that ID name.

    If you don't want to specify a width or height for image handler (in admin config>images) for whatever reason (I didn't want to specify medium heights because I only wanted the width defined for height to auto-size proportionally), just alter the attributes.php..

    find this line:
    PHP Code:
    $parameters=' onchange="getattribimage('.'\'id[' $products_options_names->fields['products_options_id'] . ']\''.','MEDIUM_IMAGE_WIDTH.', '.MEDIUM_IMAGE_HEIGHT.',' this.value,'.$_GET['products_id'].');"'; 
    change to:
    PHP Code:
    $parameters=' onchange="getattribimage('.'\'id[' $products_options_names->fields['products_options_id'] . ']\''.', height, width, this.value,'.$_GET['products_id'].');"'
    ...where height is the pixel height WITHOUT a "px" suffix and width in the same format. the point is that both width and height must be specified or else this won't work. and to reiterate, the image must be wrapped in a container with ID of productMainImage

    One more thing.. the image doesn't revert to the default main image once you select an attribute and it gets replaced. You must create a default attribute (for example, if the image base is white in color) and assign an image to the "default" attribute, regardless of if its the same as your main product image.
    Last edited by tranced; 31 Aug 2011 at 08:34 PM.

  4. #64
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    Default Re: Attribute image replaces main product image on selecting attribute

    Does anyone know how to get this working with Lightbox? The main image comes up in the lightbox, but once the images swap, the new images just come up in a regular popup box.
    Danielle

  5. #65
    Join Date
    Feb 2010
    Posts
    74
    Plugin Contributions
    0

    Default Re: Attribute image replaces main product image on selecting attribute

    I couldn't get past the SQL query...
    SQL query:


    INSERT INTO `products_options_types` VALUES (6, 'Link');
    MySQL said: Documentation

    #1062 - Duplicate entry '6' for key 'PRIMARY'

  6. #66
    Join Date
    Jul 2012
    Posts
    16,799
    Plugin Contributions
    17

    Default Re: Attribute image replaces main product image on selecting attribute

    Quote Originally Posted by lrfowler24 View Post
    I couldn't get past the SQL query...
    SQL query:


    INSERT INTO `products_options_types` VALUES (6, 'Link');
    MySQL said: Documentation

    #1062 - Duplicate entry '6' for key 'PRIMARY'
    Just came across this message. Yeah, the sql in the sql_run.txt file is not written with the concept of other products_options_types having been added or any other flexibility and it is provided with an existing table prefix which if applied within the tools->install sql patches window will more than likely cause errors.

    May I suggest the following sql for first time installation. If run a second time, it will attempt to add another products_options_types_id with the same name which would be a problem so if there is a problem with running this install script, I suggest following up with the uninstall script before attempting to install again. Oh wait, I just realized that there is not an uninstall script... I include that below as well.. :/

    Install script to be placed in admin->tools->install sql patches:
    Code:
    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;
    
    INSERT INTO `products_options_types` (products_options_types_id, products_options_types_name) VALUES (@products_options_type_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_type_id, 'Numeric value of the link product option type', 6, 0, now(), NULL, NULL);
    Removal sql also to be placed in admin->tools->install sql patches (if removal is desired or if attempting to rerun the above install sql):
    Code:
    DELETE FROM `products_options_types` WHERE products_options_types_name = 'Link';
    DELETE FROM `configuration` WHERE configuration_key = 'PRODUCTS_OPTIONS_TYPE_LINK';
    If run within phpmyadmin, the table(s) need to be prefaced with the DB_PREFIX value found in includes/configure.php and admin/includes/configure.php (should be the same in both). The table name is identified by the text immediately after FROM and the text immediately after INTO. The backquotes on the table names are unnecessary, but were maintained as the original author had used them.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #67
    Join Date
    Feb 2010
    Posts
    74
    Plugin Contributions
    0

    Default Re: Attribute image replaces main product image on selecting attribute

    Quote Originally Posted by mc12345678 View Post
    Just came across this message. Yeah, the sql in the sql_run.txt file is not written with the concept of other products_options_types having been added or any other flexibility and it is provided with an existing table prefix which if applied within the tools->install sql patches window will more than likely cause errors.

    May I suggest the following sql for first time installation. If run a second time, it will attempt to add another products_options_types_id with the same name which would be a problem so if there is a problem with running this install script, I suggest following up with the uninstall script before attempting to install again. Oh wait, I just realized that there is not an uninstall script... I include that below as well.. :/

    Install script to be placed in admin->tools->install sql patches:
    Code:
    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;
    
    INSERT INTO `products_options_types` (products_options_types_id, products_options_types_name) VALUES (@products_options_type_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_type_id, 'Numeric value of the link product option type', 6, 0, now(), NULL, NULL);
    Removal sql also to be placed in admin->tools->install sql patches (if removal is desired or if attempting to rerun the above install sql):
    Code:
    DELETE FROM `products_options_types` WHERE products_options_types_name = 'Link';
    DELETE FROM `configuration` WHERE configuration_key = 'PRODUCTS_OPTIONS_TYPE_LINK';
    If run within phpmyadmin, the table(s) need to be prefaced with the DB_PREFIX value found in includes/configure.php and admin/includes/configure.php (should be the same in both). The table name is identified by the text immediately after FROM and the text immediately after INTO. The backquotes on the table names are unnecessary, but were maintained as the original author had used them.
    ..........I wasn't able to run the first code......I got an error................. so then I ran the uninstall code............ and I ran the first code and still got an error. Can you do a teamviewer session?

  8. #68
    Join Date
    Feb 2010
    Posts
    74
    Plugin Contributions
    0

    Default Re: Attribute image replaces main product image on selecting attribute

    Quote Originally Posted by lrfowler24 View Post
    ..........I wasn't able to run the first code......I got an error................. so then I ran the uninstall code............ and I ran the first code and still got an error. Can you do a teamviewer session?
    the error - WARNING: An Error occurred, please refresh the page and try again.

  9. #69
    Join Date
    Feb 2010
    Posts
    74
    Plugin Contributions
    0

    Default Re: Attribute image replaces main product image on selecting attribute

    so.....first I tried doing this code in phpmyadmin (I forgot about admin - Tools)....
    INSERT INTO `zen_products_options_types` VALUES (6, 'Link');

    INSERT INTO `zen_configuration` VALUES ('','Link product option type', 'PRODUCTS_OPTIONS_TYPE_LINK', '6', 'Numeric value of the link product option type', 6, 0, NULL, '', NULL, NULL);
    .......but..........I noticed there was no `zen_products_options_types` ......so I changed it to INSERT INTO `products_options_types` VALUES (6, 'Link');

  10. #70
    Join Date
    Jul 2012
    Posts
    16,799
    Plugin Contributions
    17

    Default Re: Attribute image replaces main product image on selecting attribute

    Quote Originally Posted by lrfowler24 View Post
    the error - WARNING: An Error occurred, please refresh the page and try again.
    Sorry, there was a typo in the original query (@products_options_type_id should have been @products_options_types_id) :

    Code:
    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;
    
    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);
    I don't know why an error occurred with the removal as I just ran it (twice) to see if I would get an error...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 
Page 7 of 17 FirstFirst ... 56789 ... LastLast

Similar Threads

  1. Attribute image replaces main image but only pop up larger image
    By welchyboy in forum Setting Up Categories, Products, Attributes
    Replies: 15
    Last Post: 26 Nov 2010, 11:56 PM
  2. Replies: 0
    Last Post: 7 Oct 2009, 07:11 PM
  3. Replies: 0
    Last Post: 16 Jul 2009, 06:07 AM
  4. Replies: 1
    Last Post: 5 Oct 2008, 11:45 PM
  5. Attribute image replaces main product image on selecting attribute
    By pegog in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 19 Jun 2008, 07:29 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR