Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product listing


FWR Media

Recommended Posts

try this new function in html_output.php

// New HTML image wrapper function modified for KISS Image Thumbnailer by FWR Media
 function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') {
   // If width and height are not numeric then we can't do anything with it


$imageg = @getimagesize($src);

// Check the input variables and decide what to do:

if($width > $imageg[0] && $height > $imageg[1]){

  $image = '<img src="' . tep_output_string($src) . '" alt="' . tep_output_string($alt) . '"';

  if (tep_not_null($alt)) {
 $image .= ' title=" ' . tep_output_string($alt) . ' "';
  }




 $image .= ' '.$imageg[3];


  if (tep_not_null($parameters)) $image .= ' ' . $parameters;

  $image .= ' />';

  return $image;

}else{

  if ( !is_numeric ( $width ) || !is_numeric ( $height ) ) return tep_image_legacy( $src, $alt, $width, $height, $parameters );
  require_once DIR_WS_MODULES . 'kiss_image_thumbnailer/classes/Image_Helper.php';
  $attributes = array( 'alt' => $alt, 'width' => $width, 'height' => $height );
  $image = new Image_Helper( array( 'src'				   => $src,
		 'attributes'		    => $attributes,
		 'parameters'		    => $parameters,
		 'default_missing_image' => DIR_WS_IMAGES . 'no_image_available_150_150.gif',
		 'isXhtml'			   => true,
		 'thumbs_dir_path'	   => DIR_WS_MODULES . 'kiss_image_thumbnailer/thumbs/',
		 'thumb_quality'		 => 75,
		 'thumb_background_rgb' => array( 'red'   => 255,
				  'green' => 255,
				  'blue'  => 255 ) ) );
  if ( false === $image_assembled = $image->assemble() ) {
 return tep_image_legacy( $src, $alt, $width, $height, $parameters );
  }
  return $image_assembled;
}
 } // end function

it checks first the Image dimensions with the original - if both width and height are bigger - it will instead just link the original Image

Link to comment
Share on other sites

Hi,

 

maybe this function would be usefull for reset or clean thumbs cache at admin -> Configure -> Images

 

Run in phpMyadmin (mySql):

INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES
('Reset thumbs', 'RESET_IMAGE_THUMBS', 'false', 'Reset thumbs cache', 4, 9, '2013-02-20 19:36:26', '2013-01-29 17:11:10', 'tep_cfg_reset_thumbs_cache', 'tep_cfg_select_option(array(''reset'', ''false''),');

 

 

add this hard coded function into admin/includes/functions/general.php

 function tep_cfg_reset_thumbs_cache( $action = 'false' ) {
   if ($action == 'reset' ) {
  $mask = "../includes/modules/kiss_image_thumbnailer/thumbs/*.jpg";
  array_map( "unlink", glob( $mask ) );
  $mask = "../includes/modules/kiss_image_thumbnailer/thumbs/*.gif";
  array_map( "unlink", glob( $mask ) );
  $mask = "../includes/modules/kiss_image_thumbnailer/thumbs/*.png";
  array_map( "unlink", glob( $mask ) );
  tep_db_query( "UPDATE " . TABLE_CONFIGURATION . " SET configuration_value='false' WHERE configuration_key='RESET_IMAGE_THUMBS'" );
   }
 }

 

;)

Regards,

Gergely

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

Hi,

 

maybe this function would be usefull for reset or clean thumbs cache at admin -> Configure -> Images

 

Yes there really should be a way to clear the thumbs via admin.

Link to comment
Share on other sites

once this is installed, does it automatically update any existing images already uploaded for products?

 

ie, the existing default products that are in the fresh install, or would it start working from when you upload your pictures after installation?

 

also, does this alter the existing layout for product info and its images?

 

not sure whether i need another plugin to create a nice layout for the images.

 

im thinking of something like this? big picture and small pictures on right.

 

http://www.shoprevolution.com/fred-perry-silk-tie-belt/

 

thanks

Edited by vampirehunter
Link to comment
Share on other sites

once this is installed, does it automatically update any existing images already uploaded for products?

 

ie, the existing default products that are in the fresh install, or would it start working from when you upload your pictures after installation?

 

As they are being viewed. Meaning right after install take a look at the thumbs folder and it's probably empty, then go view one of your products and revisit the thumbs folder, you'll see the thumbs have been generated for that products images. This occurs for existing images and future uploaded images.

 

also, does this alter the existing layout for product info and its images?

 

Same layout, just thumbed.

 

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

 

thanks

 

would any of you guys have any tips on what to do to modify the default image gallery layout to something like this?

 

im trying to find any tutorials /guidelines for css/html that can help achieve this layout.

 

kind of like the smaller thumbnails can be scrolled across or something similar?

 

this site the thumbnails are going left to right, and you can scroll across.

http://www.truffleshuffle.co.uk/store/mens-black-superman-vision-tshirt-p-11832.html

 

this site, thumbnail are on the right hand side of the main picture, and go downwards.

http://www.shoprevolution.com/chicken-or-egg-shopper/

 

 

I guess the scrolling option would be better as some products might need many multiple images.

 

If i can sort out the layout like the ones above, it would be great in conjunction with this plugin.

Edited by vampirehunter
Link to comment
Share on other sites

@@FWR Media

 

Hi Robert, thank you very much for this wonderful contribution. I'm testing this now in my new 2.3 store and noticed a small issue. This may be me... and not your contribution....

 

When the length of my image file names is... for example canon_digital_ixus_800_is_1.png... it not display on the product listing (I have not yet installed in the product info). When I shorten file name to MODEL01.png for example, this image displays fine...

 

Is there a functions in one of your files that can be changed to allow for a longer file name?

 

Also when the image is not displayed because of this issue there is not "no image available" image in its place. Just blank...

 

Thank you very much in advance...

 

 

Link to comment
Share on other sites

hi, i installed the plugin, works perfect!

 

 

 

For the main images (the full size ones in the image folder)

 

i was wondering, is there any way to have the actual Main full size images renamed when uploaded to something more random or specific for each product?

 

for example, if my file name is picture1.jpg

 

whats the best way to change it so that when it uploads, it will be given a more appropriate or maybe random name according to the product id its being uploaded for?

Edited by vampirehunter
Link to comment
Share on other sites

Hi Robert,

 

somehow found this:

  if ( false !== $parameters ) $this->html .= ' ' . tep_output_string( $parameters );

 

changed to:

  if ( false !== $parameters ) $this->_html .= ' ' . tep_output_string( $parameters );

 

Regards

Gergely

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

Hi Robert,

 

somehow found this:

 if ( false !== $parameters ) $this->html .= ' ' . tep_output_string( $parameters );

 

changed to:

 if ( false !== $parameters ) $this->_html .= ' ' . tep_output_string( $parameters );

 

Regards

Gergely

 

is this a fix for something?

Link to comment
Share on other sites

is this a fix for something?

 

Dear @@vampirehunter,

 

yes it is. This slide out given parameters to "_html" string and not throwing errors. The "html" is not exist in the class.

 

(Image_Helper.php)

Edited by Gergely
given file association

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

how do i make sure that if item has no image, that i can show the "no image available" thumbnail in the shopping cart?

 

as of now, if items have image, they show, but if no image, then just get the product name.

Edited by vampirehunter
Link to comment
Share on other sites

i find this code for functions/html_output.php

 

seems to work but is this the proper way of doing it in conjunction with the kissit thumbnailer?

 

if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) {
 $src=DIR_WS_IMAGES.'noimage.gif';
}

//for what`s the url like :'images/aa/'
if(!file_exists($src)||strlen(strstr($src,"."))<=0){
$src=DIR_WS_IMAGES.'noimage.gif';
}

Edited by vampirehunter
Link to comment
Share on other sites

which version are you using??

 

I think this was an older...

 

You could see some new features here

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

  • 4 weeks later...

Hello @@FWR Media

 

I just installed this mod and it works great. Except on the index page where broken images are displayed. Please tell me what settings in admin I need to check or any code in the index page.

 

I use OSC 2.3.3

 

Thanks

Edited by discxpress
Link to comment
Share on other sites

does anyone have any tips on displaying a custom image when a product has no images uploaded?

 

specifically for the product info page.

 

I've managed to get a "no image" displayed on the product listings page and the shopping cart page, but not the product info page.

 

if a product has no images, then on the product info page, nothing is shown.

Edited by vampirehunter
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...