View Full Version : **OSCOMMERCE** Under categories each image for the products don't resize
Richard_1010
04-14-2007, 01:30 PM
Hi all,
This is the only problem now i am having with my oscommerce template, am not getting any response from the oscommerce and as you were very helpful yesterday thought i would try here again!
Each time i upload a product the image does not resize under the categories so for example i list a car under cars and the image will be full size but any where else it is a thumbnail which is set in the admin section, this makes the whole layout go crazy when on a category page. I am using a custom template but not sure how i can fix it. Any ideas?
Thanks in advance
rafiki
04-14-2007, 01:34 PM
resize the picture period, or give the img tag some arguments on what size to make it?
Richard_1010
04-14-2007, 01:39 PM
You see, instantly get a reply, amazing people you are!
I am not a programmer but can alter somethings, am not to sure on how to resize the picture period
rafiki
04-14-2007, 01:48 PM
how are you adding the image?
Richard_1010
04-14-2007, 01:56 PM
I go into admin then add product and there is the upload button to select the image you want.
rafiki
04-14-2007, 02:33 PM
I go into admin then add product and there is the upload button to select the image you want.
when you uoload the file call a php class or function to resize the image to the size you want to show it on yoursite
Richard_1010
04-14-2007, 02:39 PM
Thanks for that but i did try something similar but it didn't work, the error is with in the template because i just noticed that the width should be able to be changed in the admin section but when it chances it works but just not on the category pages like it should.
iLLin
04-14-2007, 03:04 PM
Why don't you upload the size you want. Just resize it to how you want before yo upload? Makes sense to me...
EDIT: The Product images on the product pages, are ran through a function to resize. And you should have an admin setting that specifies the width and height of the product images. Crappy part about OSC, is it just downsizes the main image. It doesn't create a thumbnail so the user downloads the full size of the image when viewing. Real crappy... Look for a thumbnail contribution.
Richard_1010
04-14-2007, 03:10 PM
I would have to resize the images to small like 90px which does not give detail to the image when they want to click to enlarge, i know i can add an extra picture of it in the description box but i didn't want to do this if i could fix it.
In the admin section yes you should be able to set it which i can but it does not alter the images when you click on the categories only the images on the home page or shopping cart etc.
When you go in to the admin area to change the width and height which page gets changed, if i know this then theres a chance i can compare the code to another template and see if i can detect the error.
I have looked for others using my template and all have the same problem, i have only found one (not English) that doesn't have this problem)
iLLin
04-14-2007, 03:13 PM
paste up the code that displays your image.
Richard_1010
04-14-2007, 03:18 PM
Thanks for the reply, am 2 steps closer. I have found the page that lists the products, i then compared with another template and did some code swapping and i have sorted it apart from now have 2 images but still sorting it out. Thank you for your replies! :-D So happy!!
Richard_1010
04-14-2007, 03:29 PM
Right sorted out the double image, only one thing which is bugging me that is between each image there is no gap so the images are joint, the products get listed downwards. The code that i altered to get where i am now is below i have tried to insert a line break but can't work out where it should go, any ideas?
case 'PRODUCT_LIST_QUANTITY':
$lc_align = 'right';
$lc_text = ' ' . $listing['products_quantity'] . ' ';
break;
case 'PRODUCT_LIST_WEIGHT':
$lc_align = 'right';
$lc_text = ' ' . $listing['products_weight'] . ' ';
break;
case 'PRODUCT_LIST_IMAGE':
$lc_align = 'left';
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' .
$listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH,
SMALL_IMAGE_HEIGHT) . '</a>';
} else {
$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">'
. tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
}
break;
case 'PRODUCT_LIST_BUY_NOW':
$lc_align = 'center';
$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' .
$listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
break;
}
$list_box_contents[$cur_row][] = array('align' => $lc_align,
'params' => 'class="productListing-data"',
'text' => $lc_text);
}
}
//echo '<div align="center" style="height:360px;">'. tep_draw_separator("pixel_trans.gif", "100%", "5");
new productListingBox($list_box_contents);
//echo '</div>';
rafiki
04-14-2007, 03:31 PM
tried adding <BR /> <BR /> to the output?
Richard_1010
04-14-2007, 03:37 PM
With out sounding to thick, wheres the output?
iLLin
04-14-2007, 03:42 PM
Man osc is not a product you want to start learning php on. It's slow, formatted like crap, and poor coding practices all in one product...
The output is coming from the variable $lc_text.
iLLin
04-14-2007, 03:43 PM
Also when posting code here, wrap the code in [ php ] tagss
CFMaBiSmAd
04-14-2007, 04:33 PM
Man osc is not a product you want to start learning php on. It's slow, formatted like crap, and poor coding practices all in one product...I'll second that. Unless the long overdue "next" version has been released (I have not been on the OSC site for a while - there are literally 100+ posts per day on their forum, a large number of them to fight and fix the same problems over and over) the current version of OSC is still a "developmental version" (it was written at a time when there was nothing like it available for the price and it took off in popularity before it was really a product that should have even been released to the public.) Aside from necessary security patches, the current version was released about four years ago or so, and has not had the many known bugs fixed.
To get OSC to install, to work the way you want it to, and to make changes to it, you need to know a substantial percentage of the PHP programming language.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.