Forums / All Other Contributions/Addons / AJAX Image Swapper - Patch to swap between standard and AIS image display

AJAX Image Swapper - Patch to swap between standard and AIS image display

Locked

Views: 5,189

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
8 Jan 2008, 5:15 AM
#1
jaycode avatar

jaycode

Zen Follower

Join Date:
Jun 2007
Location:
Australia - Melbourne
Posts:
306
Plugin Contributions:
1

AJAX Image Swapper - Patch to swap between standard and AIS image display

This is how to make your product info page able to switch between AIS and normal Zen-Cart view. I didn't include this as an update since this method would make installation steps a bit harder, which I really don't want to do. Well unless if you found this patch is needed in core files, let me know.

Here it goes:

  1. Go to your includes/templates/YOUR_TEMPLATE/templates/tpl_modules_ajax_image_viewer.php file, cut this line of code from there:
<?php include(DIR_WS_MODULES . 'AJAX_image_swapper.php'); ?>
2. Then go to tpl_product_info_display.php file, and paste that code block on top of the page
3. find: 	
 	```
require($template->get_template_dir('/tpl_modules_ajax_image_viewer.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_ajax_image_viewer.php');?> 

replace it with:
```
if ($opt_id_used == null)
require($template->get_template_dir('/tpl_modules_main_product_image.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_main_product_image.php');
else
require($template->get_template_dir('/tpl_modules_ajax_image_viewer.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_ajax_image_viewer.php');?>

4. find: 	
 	  ```
require($template->get_template_dir('/tpl_modules_ajax_image_swapper_attr.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_ajax_image_swapper_attr.php'); ?> 

replace it with:
```
if ($opt_id_used == null)
require($template->get_template_dir('/tpl_modules_attributes.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_attributes.php');
else
require($template->get_template_dir('/tpl_modules_ajax_image_swapper_attr.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_ajax_image_swapper_attr.php'); ?>


Jay

The greatest pleasure in life is doing what people say you cannot do.

Check on www.WebExtremeCustomiser.com for my modules (free contribution):
AJAX Image Swapper
AJAX Banner Swapper
Fixed Navigation

8 Jan 2008, 5:20 AM
#2
kiddo avatar

kiddo

Totally Zenned

Join Date:
Jul 2006
Location:
SF Bay Area
Posts:
837
Plugin Contributions:
1

Re: AJAX Image Swapper - Patch to swap between standard and AIS image display

Thank you! Very nice mod :)

I see in your road map you may make AIS work hand-in-hand with Image Handler2. Any word on that?

Peace;

Kiddo

8 Jan 2008, 6:47 AM
#3
jaycode avatar

jaycode

Zen Follower

Join Date:
Jun 2007
Location:
Australia - Melbourne
Posts:
306
Plugin Contributions:
1

Re: AJAX Image Swapper - Patch to swap between standard and AIS image display

Hey, thanks!

Well, heheh... haven't really got time to even start working on that :p I haven't even installed Image Handler2 nor knowing what its functions are, yet.

The greatest pleasure in life is doing what people say you cannot do.

Check on www.WebExtremeCustomiser.com for my modules (free contribution):
AJAX Image Swapper
AJAX Banner Swapper
Fixed Navigation

15 Jan 2008, 3:08 PM
#4
adam9110 avatar

adam9110

New Zenner

Join Date:
Jan 2006
Posts:
92
Plugin Contributions:
0

Re: AJAX Image Swapper - Patch to swap between standard and AIS image display

Hello Jay,,

Your mod is really cool. But i have made a movement to my zen cart ,, Finally , I can not get the image shown on Product_info page. And what is more , I get the error that when i inject the SQL..

1146 Table 'china.configuration_group' doesn't exist
in:
[SELECT @last_id :=last_insert_id() FROM configuration_group;]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

I notice this problem caused with the below code.

UPDATE configuration_group SET sort_order = last_insert_id() WHERE configuration_group_id = last_insert_id();

SELECT @last_id :=last_insert_id() FROM configuration_group;

And in the Admin/catalog/Ajax image... show that your version is V1.2 not 2.1 .. But i have download the 2.1 from your webpage.

So the currently version is not compatible with IH2 and No attributor items .??

But thanks for you help... I will try until you finally got the above mod work with yours together...

Regards,

19 Jan 2008, 12:47 AM
#5
greenhat avatar

greenhat

Zen Follower

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

Re: AJAX Image Swapper - Patch to swap between standard and AIS image display

adam9110:

Hello Jay,,

Your mod is really cool. But i have made a movement to my zen cart ,, Finally , I can not get the image shown on Product_info page. And what is more , I get the error that when i inject the SQL..

1146 Table 'china.configuration_group' doesn't exist
in:
[SELECT @last_id :=last_insert_id() FROM configuration_group;]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

I notice this problem caused with the below code.

UPDATE configuration_group SET sort_order = last_insert_id() WHERE configuration_group_id = last_insert_id();

SELECT @last_id :=last_insert_id() FROM configuration_group;

And in the Admin/catalog/Ajax image... show that your version is V1.2 not 2.1 .. But i have download the 2.1 from your webpage.

So the currently version is not compatible with IH2 and No attributor items .??

But thanks for you help... I will try until you finally got the above mod work with yours together...

Regards,

change this line:

SELECT @last_id :=last_insert_id() FROM configuration_group;

to

SELECT @last_id :=last_insert_id() FROM zen_configuration_group;

worked for me..

19 Jan 2008, 5:22 AM
#6
jaycode avatar

jaycode

Zen Follower

Join Date:
Jun 2007
Location:
Australia - Melbourne
Posts:
306
Plugin Contributions:
1

Re: AJAX Image Swapper - Patch to swap between standard and AIS image display

greenhat:

change this line:

SELECT @last_id :=last_insert_id() FROM configuration_group;

to

SELECT @last_id :=last_insert_id() FROM zen_configuration_group;

worked for me..
Lets see... with

SELECT @last_id :=last_insert_id() FROM zen_configuration_group;

If you use other prefix than zen_ it wouldn't work.

configuration_group might work, ugh should I change the installation sql again?

The greatest pleasure in life is doing what people say you cannot do.

Check on www.WebExtremeCustomiser.com for my modules (free contribution):
AJAX Image Swapper
AJAX Banner Swapper
Fixed Navigation

12 Jul 2010, 10:32 AM
#7
shemin avatar

shemin

New Zenner

Join Date:
Jul 2010
Posts:
2
Plugin Contributions:
0

Re: AJAX Image Swapper - Patch to swap between standard and AIS image display

I installed the latest 3.1.4, product information found in a blank page, how to solve it? Thanks!