http://aquaassets.net/index.php?main...products_id=78
Hover images work.......but if you click to see larger it does not work (hovering wont work well on cell so i need it to click)
This just in (a couple of hours ago) that affects (with solution) a concern related to additional images when a default image is in use for missing images: https://www.zen-cart.com/showthread....95#post1292095
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Hi everybody!
I wanted to share a small modification i did to auto generate the path for the image in the Image Manager.
Use it at your own risk
When you add the first image to an item it generates the path for where it will be stored.
I manage multiple site and i wanted one site to create the path with the category and sub-category and the rest of my sites based on the manufacturer.
So here it goes :
First, add these function to the top of /yourAdmin/image_handler.php (I added them around line 36)
The function replace_weird_char($str) replaces the characters you don't want in a file path. You can add any character you want in the array.PHP Code:
function replace_weird_char($str){
$unwanted_array = array( 'Š'=>'S', 'š'=>'s', 'Ž'=>'Z', 'ž'=>'z', 'À'=>'A', 'Á'=>'A',
'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C',
'È'=>'E', 'É'=>'E', 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I',
'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O',
'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U', 'Û'=>'U',
'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss', 'à'=>'a', 'á'=>'a',
'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a', 'æ'=>'a', 'ç'=>'c',
'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i',
'î'=>'i', 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o',
'ô'=>'o', 'õ'=>'o', 'ö'=>'o', 'ø'=>'o', 'ù'=>'u', 'ú'=>'u',
'û'=>'u', 'ý'=>'y', 'þ'=>'b', 'ÿ'=>'y', '/'=>'', '\\'=>'',
' '=> '-', '.'=>'_', '®'=>'', '™'=>'' );
return strtr( $str, $unwanted_array );
}
function get_new_img_path($product_id, $base = '', $create_path_from = ''){
$path = '';
switch ($create_path_from) {
case 'category':
$cat_array = zen_generate_category_path($product_id, 'product');
$temp_path = '';
$is_first = true;
foreach ($cat_array[0] as $value) {
if (!$is_first) {
$temp_path .= '/';
}
$temp_path .= replace_weird_char($value['text']);
$is_first = false;
}
if ($temp_path != '') {
$path = $base != '' ? ' value="' . $base . '/' . $temp_path . '"' : ' value="' . $temp_path . '"';
}
break;
case 'manufacturer':
$manufacturer_name = replace_weird_char(zen_get_products_manufacturers_name($product_id));
if ($base != '') {
$path = ' value="' . $base . ($manufacturer_name != '' ? '/' . $manufacturer_name : '') .'"';
} else {
$path = ($manufacturer_name != '' ? ' value="' . $manufacturer_name .'"' : '');
}
break;
case '':
$path = $base != '' ? ' value="' . $base . '"' : '';
break;
}
return strtolower($path);
}
The second function get_new_img_path(...) creates the path according to the information you supplied. (Explained in the next section)
Second, change this line (around line 867) :
to this :PHP Code:
$contents[] = array('text' => TEXT_INFO_OR.' ' . zen_draw_input_field('imgNewBaseDir', '', 'size="20"') );
This is where the magic happens. The function get_new_img_path receive 3 parameters.PHP Code:
$contents[] = array('text' => TEXT_INFO_OR.' ' . zen_draw_input_field('imgNewBaseDir', '', 'size="20"' . get_new_img_path($pInfo->products_id, 'products', 'manufacturer')) );
The first one is the product id, don't change it.
The second is the base of the path. If you enter 'products' the path will start with 'product/[something]'.
The last is the type of path you want, you have 3 options ('', 'category' or 'manufacturer')
Here is some example :
- get_new_img_path($pInfo->products_id, 'products', 'manufacturer')
output : 'products/[manufacturer]/'
- get_new_img_path($pInfo->products_id, '', 'manufacturer')
output : '[manufacturer]/'
- get_new_img_path($pInfo->products_id, '', '')
output : ''
- get_new_img_path($pInfo->products_id, 'products', 'category')
output : 'products/[category]/[sub-category]/[sub-category]/.../[sub-category]/'
- get_new_img_path($pInfo->products_id, 'products', 'category')
output : '[category]/[sub-category]/[sub-category]/.../[sub-category]/'
Finally, i had to make a small modification to the database because the maximum number of characters in the file path for the image is 64 and you can easily go over this with the category option.
In the table 'products' the field 'products_image' needs to be change from varchar(64) to varchar(200). (I choose 200 but less could work to, i just didn't want to bother with it anymore...)
This has been tested on 4 different website and with more than 5000 items but it still should be tested thoroughly before going to a live site.
I hope it can help some of you out!
Have a good one!![]()
Hi,
Running 1.5 with ZenCart.
Our client has a site which has image handler. Although it has never worked properly, and often is unable upload images.
I am doing some testing today, however I am stuck without being able to load up a product at all within image uploader. I am faced with the same message:
"No Image Handler information found."
Any clue where to start with this error?
some other modules remove the version constant from the database when they are installed.
Insert this in your database, and it should work again. You should edit the version number to the version you are you using.
Code: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 ('IH version', 'IH_VERSION', '4.3.2', 'IH Version is stored but not shown on configuration menus', '6', '10000', NULL, '0001-01-01 00:00:00.000000', NULL, NULL);
Zen cart installation / maintenance / customisation / hosting
Supported Modules: Dutch language pack, Multi site, Dynamic Price Updater and more.
Hello. Zen Cart 1.5.4 - Issue with Larger Image Upload
Anytime we upload an image larger than 2700 pixels (there-abouts) the admin page for Image Handler breaks in 1/2 - if you view source the code literally stops 1/2 way down the page...the last line of code in the source is:
<td class="dataTableContent" align="center" valign="top">
And you can't upload anymore images - there is not button to add more. It seems if you upload an image smaller than 2700 px wide we are fine.
We recently upgraded the site - new theme - upgrade from ZC 1.3.x to 1.5.4 (Image Handler is v. 4) Used to be able to upload any size images.
Once the above issue happens we have to delete the record and start over with the product info.
Anyone else experience this? Any ideas to look at?
Thanks.
Yeah, have seen it though where I've seen it the limit was much smaller...if not mistaken there's a thread or two out there about this, but basically it's a limit posed by the graphical sizing software not by IH4 itself... IH4 just happens to show the effect. Also, I think that there is some commenting out of code that might allow everything to progress as "normal" but that detail is covered elsewhere than this particular post. Long and short of it is while requested to provide the largest/highest quality image as possible, there still is an upper limit to everything...
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
OK, this is driving me nuts because I can't narrow down the cause.
I have a test site up (here)
The product image on the left (all are missing but 1) is showing in the browser as 100 pixels wide. I can't quite figure out why that is, but that's not what I'm here to ask. The NATIVE size of the image is 250 x 103 and I can't figure out for the life of me where that's coming from! The actual size of the original image is 3x that (750 x 311). The image src is in the bmz_cache/8/ folder but how's it get there? I have NO setting (that I can find) sizing anything to 250px wide and/or 103px tall, or "1 third" or anything like that.
I assumed for that page that the setting should be "Image - Product Listing Width/Height", which I have set to 100 and 100! respectively. Yet it keeps generating this 250*103 image. It has to be IH doing it, right? THat's why it is in that folder?
Incidentally, I changed that setting to something else but there's no effect on the page... no matter what, I get it showing as 100px wide with a native width of 250px.
HELP!
I uploaded a 2nd image... this time the original image is 712*960. I still have the image set to resize to 100*100!. For this case, however, on that page it shows as 100*135 with a native size of 212*286. This time not exactly 1/3, so maybe that was a coincidence... but still, where in the world is this random resizing coming from???
Isn't the whole point of IH to automatically resize to the WANTED size, not some weird in-between size so the browser still has to smoosh it?
Bookmarks