Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Additional Images Module


Parikesit

Recommended Posts

I want to add 3 photos to one product, how to do that?

this is from the AI Docs. Was there something in this you didn't understand?

 

After a successful install the product edit page and the product/category list

pages should show features for the Additional Images. On the Product edit page

you will now see 3 product image upload locations. These are for the primary or

default image with every product. You must fill this image location first for

every product before adding additional images.

 

One-step-back from the Product edit page is the product/catagory list pages.

when you have a product selected, the right side tab will show the product summary

and a button to add an additional image.

Link to comment
Share on other sites

the window is sized via javascript in the popup_add_images.php. The following code is what sizes the window.

 

  imgWidth = <?php echo $imagemenu->maximagewidth; ?>+<?php echo $extra_window_width; ?>;
 imgHeight = <?php echo $imagemenu->maximageheight; ?>+<?php echo $extra_window_height; ?>-i;
 var width = screen.width;
 var height = screen.height;
 var leftpos = width / 2 - imgWidth / 2;
 var toppos = height / 2 - imgHeight / 2;
 window.moveTo(leftpos, toppos);

 if (document.getElementById("mainimage")) window.resizeTo(<?php echo (!empty($imagemenu->maximagewidth)?$imagemenu->maximagewidth:'document.getElementById("mainimage").width'); ?>+<?php echo $extra_window_width; ?>, <?php echo (!empty($imagemenu->maximageheight)?$imagemenu->maximageheight:'document.getElementById("mainimage").height'); ?>+<?php echo $extra_window_height; ?>-i);

 

if you change the last line to something like this, it will resize the popup to the screen size:

  if (document.getElementById("mainimage")) window.resizeTo(screen.width, screen.height);

 

 

Is it possible to set the popup window to have slider bars if the main popup image and other thumbnails are too big for the popup window?

 

please see http://www.ecomtools.co.uk/catalog/product...?products_id=30

 

I have 5 thumbnails but only 4 show up in the popup as one has 'fell off' the bottom.

Link to comment
Share on other sites

Is it possible to set the popup window to have slider bars if the main popup image and other thumbnails are too big for the popup window?

 

please see http://www.ecomtools.co.uk/catalog/product...?products_id=30

 

I have 5 thumbnails but only 4 show up in the popup as one has 'fell off' the bottom.

yes, in product_info.php find this:

 

function popupWindow(url) {
window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res
izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le
ft=150')
}

 

update to this:

 

function popupWindow(url) {
window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,re
sizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,l
eft=150')
}

 

the other option would be to make the popup have 2 columns of 3, so that doesn't happen. See the setting in the Admin > Configuration > Additional Images.

Link to comment
Share on other sites

yes, in product_info.php find this:

 

function popupWindow(url) {
window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res
izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,l
e
ft=150')
}

 

update to this:

 

function popupWindow(url) {
window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,re
sizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,
l
eft=150')
}

 

the other option would be to make the popup have 2 columns of 3, so that doesn't happen. See the setting in the Admin > Configuration > Additional Images.

 

Thanks, as usual, a quick and relevant reply. The 2 columns of 3 is the better option, but the [close window] display is half cut off at the bottom of the window.

 

See http://www.ecomtools.co.uk/catalog/product...3fbc45d41df76e0

 

Is there any way to just make the popup window a bit deeper to show the whole of the [close window] text?

Link to comment
Share on other sites

Thanks, as usual, a quick and relevant reply. The 2 columns of 3 is the better option, but the [close window] display is half cut off at the bottom of the window.

 

See http://www.ecomtools.co.uk/catalog/product...3fbc45d41df76e0

 

Is there any way to just make the popup window a bit deeper to show the whole of the [close window] text?

 

you will find that adjustment in the popup_add_image.php script

look for: function resize() {

 

you will find a section for each browser, adjust the "i=" value to increase or decrease the height of the window. negative values are valid. That value is subtracted from the height of the window, so a smaller number will increase the window height.

Link to comment
Share on other sites

you will find that adjustment in the popup_add_image.php script

look for: function resize() {

 

you will find a section for each browser, adjust the "i=" value to increase or decrease the height of the window. negative values are valid. That value is subtracted from the height of the window, so a smaller number will increase the window height.

 

Thanks Todd, spot on, works perfectly!

Link to comment
Share on other sites

I installed this a few days ago, and I am having a problem with Additional Images link on the Catalog Menu - when i click on it i get blank screen. I am using rc2a version, can this be an issue? Can someone help me, please. Other than that, i really like this contribution.

Link to comment
Share on other sites

I installed this a few days ago, and I am having a problem with Additional Images link on the Catalog Menu - when i click on it i get blank screen. I am using rc2a version, can this be an issue? Can someone help me, please. Other than that, i really like this contribution.

if you are using anything but English in the admin, you forgot to copy all english language items to the language you are using in the admin when you installed it.

Link to comment
Share on other sites

if you are using anything but English in the admin, you forgot to copy all english language items to the language you are using in the admin when you installed it.

I only use English. what else could it be? is there a debugger i can use? your help is really appreciated.

Link to comment
Share on other sites

I only use English. what else could it be? is there a debugger i can use? your help is really appreciated.

 

you should check to make sure you have full PHP error reporting turned on with your host. You can check for the error reporting in the server info under tools in your admin, but also check with your host.

 

in your application_top.php find this:

error_reporting(E_ALL & ~E_NOTICE);

change to this:

error_reporting(E_ALL);

try again, look for errors and an error file in your hosting space if that is how your host is setup.

Link to comment
Share on other sites

Halo, i'm, rocdy. I have installed Additional images last month, and i found that if we use generate images into 3 size, why the original images still inside the folder, so if we download 1 images but i got 4 images in my images folder. 2large images, 1medium, and 1small. Have any idea to solve that.

 

any idea will be very appreciated. thank :unsure:

Edited by rocdy

Rocdy

 

Beginner in php programming and still learning from this forums.

Special thanks for Oscommerce Community Forums that help me a lot. :-)

Link to comment
Share on other sites

I have installed the contribution properly. It is working great.

Thanks a lot for such a needed peace of code.

 

Ash,

I think you may get something if you try to look in to your catalog/includes/application_top.php file and find the follwing line:

#catalog/includes/application_top.php

 

 

define('FILENAME_POPUP_ADD_IMAGE', 'popup_add_image.php');

 

needs to be

define('FILENAME_POPUP_IMAGE_ADD', 'popup_add_image.php');

 

please note, one says IMAGE_ADD, the other ADD_IMAGE.

 

good luck!

 

thanks again for the contribution.

Hello

Iam new here , I have tested oscommerce additional immage contribution and other on the local host machine and Iwant to host my store now bu I am confuside wich hosting company is appropriate for os commerce .

php.ni file and MSQL5 my.cnf file must be be ste to non strict mode please help

you can reply me on the following mail [email protected]

thanks in advance

Edited by sofiene1
Link to comment
Share on other sites

Hi

I must say this is a great contribution and cleaned things up a lot from my old version of additional images. I have just updated to v2, then to v2.1

 

I have also installed Lightbox 2 and whilst having additional images v2 i integrated the code into product_info.php fine and then got the code sorted in includes/modules/additional_images.php so the additional product images worked in lightbox 2

 

However since upgrading addional images v2.1, the file structure is quite different and it seems that includes/modules/additional_images.php isn't used anymore. Instead, i assume its replacement is popup_add_image.php

 

The problem is popup_add_image.php is so much different and i cant see how to change the code to suit lightbox

 

Can anyone help at all or be able to integrate this;

<script language="javascript"><!--
document.write('<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank" rel="lightbox" title="'.$product_info['products_name'].'" >' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
//--></script>
<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank" rel="lightbox" title="'.$product_info['products_name'].'" >' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
</noscript>

 

into popup_add_image.php (if that is indeed the correct file to alter)

 

many thanks

steve

Link to comment
Share on other sites

Halo, i'm, rocdy. I have installed Additional images last month, and i found that if we use generate images into 3 size, why the original images still inside the folder, so if we download 1 images but i got 4 images in my images folder. 2large images, 1medium, and 1small. Have any idea to solve that.

 

any idea will be very appreciated. thank :unsure:

 

That is how it works. The code retains the original image and image name so that you can reprocess the images if you decide to change any size settings or if you decide to upload new images (of the same names) and reprocess the images into the required sizes.

Link to comment
Share on other sites

Here is the code to replace in product_info.php if it helps anyone who has installed the latest Additional Images V2.1 and also has Fancy Lightbox 2.14

 

This change will make the main product image open with Lightbox but still need the code changed in popup_add_image.php from Additional Images V2.1 to enable the additional images to open with lightbox

 

Find:

?>

			<script language="javascript"><!--
document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_ADD_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . (!empty($product_info['products_image_med'])?$product_info['products_image_med']:(!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:(!empty($product_info['products_image'])?$product_info['products_image']:''))), addslashes($product_info['products_name']), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_WIDTH:''), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_HEIGHT:''), 'hspace="5" vspace="5"') . '<br>' . (!empty($product_info['products_image_description'])?$product_info['products_image_description']:TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>');
//--></script>
			<noscript>
			<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . (!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:$product_info['products_image'])) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . (!empty($product_info['products_image_med'])?$product_info['products_image_med']:(!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:(!empty($product_info['products_image'])?$product_info['products_image']:''))), $product_info['products_name'], (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_WIDTH:''), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_HEIGHT:''), 'hspace="5" vspace="5"') . '<br>' . (!empty($product_info['products_image_description'])?$product_info['products_image_description']:TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>
			</noscript>

		  <?php */

 

and change to:

 

?>

			<script language="javascript"><!--
document.write('<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_pop']) . '"target="_blank" rel="lightbox" title="'. $product_info['products_name'].'" >' . tep_image(DIR_WS_IMAGES . (!empty($product_info['products_image_med'])?$product_info['products_image_med']:(!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:(!empty($product_info['products_image'])?$product_info['products_image']:''))), addslashes($product_info['products_name']), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_WIDTH:''), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_HEIGHT:''), 'hspace="5" vspace="5"') . '<br>' . (!empty($product_info['products_image_description'])?$product_info['products_image_description']:TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>');
//--></script>
			<noscript>
<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . (!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:$product_info['products_image'])) . '" target="_blank" rel="lightbox" title="'.$product_info['products_name'].'">' . tep_image(DIR_WS_IMAGES . (!empty($product_info['products_image_med'])?$product_info['products_image_med']:(!empty($product_info['products_image_pop'])?$product_info['products_image_pop']:(!empty($product_info['products_image'])?$product_info['products_image']:''))), $product_info['products_name'], (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_WIDTH:''), (ADDIMAGES_RESTRICT_PARENT=='true'?DISPLAY_IMAGE_HEIGHT:''), 'hspace="5" vspace="5"') . '<br>' . (!empty($product_info['products_image_description'])?$product_info['products_image_description']:TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>
			</noscript>

		  <?php

 

Hope this helps people

 

Thank you in advance to anyone who can change popup_add_image.php from Additional Images V2.1 to enable the additional images to open with lightbox

Regards

Steve

Link to comment
Share on other sites

That is how it works. The code retains the original image and image name so that you can reprocess the images if you decide to change any size settings or if you decide to upload new images (of the same names) and reprocess the images into the required sizes.

 

Ok, that is are right.

 

I want to ask something. Why went i use images auto generate, the prosses in my popup window went view the large images is litter bit slow compare to use single images only. May be U can try to test it in here : www.bnetb-tanahabang.com

 

like when i point my mouse right on the other images, it take 1 or 1.5 second to view the other large images. I know this is slow, because in the previous time i use single images in my additional images was so fast.

 

Any idea to make it faster will be very appreciated.

 

anyway, thank for this great great great contributions. :)

Edited by rocdy

Rocdy

 

Beginner in php programming and still learning from this forums.

Special thanks for Oscommerce Community Forums that help me a lot. :-)

Link to comment
Share on other sites

Ok, that is are right.

 

I want to ask something. Why went i use images auto generate, the prosses in my popup window went view the large images is litter bit slow compare to use single images only. May be U can try to test it in here : www.bnetb-tanahabang.com

 

like when i point my mouse right on the other images, it take 1 or 1.5 second to view the other large images. I know this is slow, because in the previous time i use single images in my additional images was so fast.

 

Any idea to make it faster will be very appreciated.

 

anyway, thank for this great great great contributions. :)

 

The delay is due to the fetching of the images when you mouse-over the thumbnail. I've thought about preloading the images in javascript, but nothing has been coded. maybe in the future version.

Link to comment
Share on other sites

The delay is due to the fetching of the images when you mouse-over the thumbnail. I've thought about preloading the images in javascript, but nothing has been coded. maybe in the future version.

 

Thank you for the replay. ok, then i will wait for the new version. Thank for this great contribution. :)

 

i'm rocdy from indonesia. glad to join this forum.

Edited by rocdy

Rocdy

 

Beginner in php programming and still learning from this forums.

Special thanks for Oscommerce Community Forums that help me a lot. :-)

Link to comment
Share on other sites

when i imported the database_setup_v2.1.0.sql to my datebase, there are something wrong as below:

 

 

SQL search:

 

ALTER TABLE `products` CHANGE `products_image` `products_image` VARCHAR( 255 ) NULL DEFAULT NULL ALTER TABLE `products` ADD `products_image_med` VARCHAR( 255 ) NULL AFTER `products_image` ,

ADD `products_image_pop` VARCHAR( 255 ) NULL AFTER `products_image_med` ,

ADD `products_image_description` VARCHAR( 64 ) NULL AFTER `products_image_pop` ;

 

 

 

MySQL return:

 

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ALTER TABLE `products` ADD `products_image_med` VARCHAR( 255 ) NULL AFTER `produ' at line 2

Link to comment
Share on other sites

the last 4 lines have been corrected to this:

 

ALTER TABLE `products` CHANGE `products_image` `products_image` VARCHAR( 255 ) NULL DEFAULT NULL;  
ALTER TABLE `products` ADD `products_image_med` VARCHAR( 255 ) NULL AFTER `products_image` ,
ADD `products_image_pop` VARCHAR( 255 ) NULL AFTER `products_image_med` ,
ADD `products_image_description` VARCHAR( 64 ) NULL AFTER `products_image_pop`;

Link to comment
Share on other sites

Hi !

I tried to install this contrib yesterday but I had a problem with global variables, the URL said me that they should be On. I couldn't solve the prolem so I rescue all information before that.

 

I'll try to do it again but I would know what update you use to install the same. I have the 2.2rc2a.

 

 

Thank you!!

Link to comment
Share on other sites

Hi !

I tried to install this contrib yesterday but I had a problem with global variables, the URL said me that they should be On. I couldn't solve the prolem so I rescue all information before that.

 

I'll try to do it again but I would know what update you use to install the same. I have the 2.2rc2a.

 

 

Thank you!!

That sounds like you added/changed some code you shouldn't have in application_top.php. When you merge the files, you should only add to your shop the code that is between these tags in the scripts to be modified:

// BOF: Additional Images
(the code to merge with yours)
// EOF: Additional Images

Link to comment
Share on other sites

Hi!

I installed it and everything was OK but when I try to manage the photos in the admin-->catalog-->BOX_CATALOG_IMAGES_PRODUCTS i have this error.

 

 

Warning: require(includes/FILENAME_ADDITIONAL_IMAGES_CONFIGURE) [function.require]: failed to open stream: No such file or directory in /home/glamypassi/domains/glamypassion.com/public_html/admin/additional_images.php on line 32

 

Fatal error: require() [function.require]: Failed opening required 'includes/FILENAME_ADDITIONAL_IMAGES_CONFIGURE' (include_path='.:/usr/local/lib/php') in /home/glamypassi/domains/glamypassion.com/public_html/admin/additional_images.php on line 32

 

Anybody knows how can I solve it?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...