Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Pics


ReginaStelling

Recommended Posts

Posted

Was wondering...I've got some products with pictures, and some without pictures in my product database...How can we set this up in osCommerce? I logged into the admin section, and am looking at the Configuration section....

 

In the Image section, there's a parameter for Image Required. If I set it to FALSE, can I have some products with images and some without?? Is that all there is to it?

 

THANKS!

Regina

  • 2 weeks later...
Posted

I would also like an answer to this question.

 

Does anyone have one?

 

Myles

Never doubt that a small group of thoughtful committed citizens can change the world; indeed, it's the only thing that ever has.

Posted

Anyone knows about this question? I am interested to know as well.

 

Furthermore, anyone knows how I can set the images to be in sub-directory of imagines\ directory? Eg. imagines\microsoft\ms_win2k.gif

 

This is featured in the initial samples when the osCommerce was first installed. However, new products that I created will not accept sub-directory entry in the field for imagine upload. Also, I have entered a wrong imagine file or I want to delete a particular product's image but there is no function to delete it. Leaving the field blank does not overwrite the previous filename too.

Posted

Yes. Setting Image Required to True is used to display broken images (the red X). This is to help you identify if an image is missing. Setting this to False will allow you to have products without images without showing the broken image.

 

 

chaicka, to upload images to their own folder follow these instructions: http://wiki.oscommerce.com/helpHowtoUploadImages

I'd rather be flying!

Posted
Yes. Setting Image Required to True is used to display broken images (the red X). This is to help you identify if an image is missing. Setting this to False will allow you to have products without images without showing the broken image.

 

 

chaicka, to upload images to their own folder follow these instructions: http://wiki.oscommerce.com/helpHowtoUploadImages

I have tried that method and it does not work.

 

In the IE 6.0 SP1, the error will appear:

 

Warning: move_uploaded_file(/home/pkc/public_html/shop/images/iasus/Iasus_NT.jpg): failed to open stream: Permission denied in /home/pkc/public_html/shop/admin/includes/classes/upload.php on line 94

 

Warning: move_uploaded_file(): Unable to move '/tmp/phpjPWFq5' to '/home/pkc/public_html/shop/images/iasus/Iasus_NT.jpg' in /home/pkc/public_html/shop/admin/includes/classes/upload.php on line 94

 

Pls help...Pardon me coz I am rather new to all these new web design languages and methods.

Posted

Try using a GIF image of nothing but color that matches your background image.

  • 2 weeks later...
Posted

Hi.

Sorry for reviving this old thread.

 

Couldn't find this on wiki.

If I want products images to be in a subdirectory, but NOT each one in a different, just "catalog/images/products/"; is there a way to upload them directly to that folder, without writing "products/image_file.jpg" in the appropiate place in admin?

Note that I don't want all the images in this directory, just products images.

 

And anyway, writing "products/image_file.jpg" isn't working for me neither.

But my problem is that I will not be the one uploading the images and products, and the one doing this can become quite confused writing slashes and backslashes on the image field.

 

Thank you so much;

SGershon

If at first you don't succeed, you must be a programmer.

 

Tip Posted: Languageless Reviews

Posted

I could do something like:

//This is in configuration.php

define('DIR_WS_IMAGES', 'images/');

define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');

define('DIR_WS_PROD_IMG', DIR_WS_IMAGES . 'products/'); //this line is new.

 

But then, which files should I modify in order to:

1) The admin needs to upload the images to DIR_WS_PROD_IMG;

2) ALL the pages need to look for the images in the above variable.

 

Any ideas?

SGershon

If at first you don't succeed, you must be a programmer.

 

Tip Posted: Languageless Reviews

  • 3 weeks later...
Posted

The file you need to look at is admin>categories.php --- for your example above:

 

find this code

 

// copy image only if modified

$products_image = new upload('products_image');

$products_image->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_image->parse() && $products_image->save()) {

$products_image_name = $products_image->filename;

 

and replace with this:

 

//copy image only if modified

$products_image = new upload('products_image');

$products_image->set_destination(DIR_FS_CATALOG_IMAGES . DIR_WS_PROD_IMG);

if ($products_image->parse() && $products_image->save()) {

$products_image_name = DIR_WS_PROD_IMG . $products_image->filename;

 

That should do it ...

 

good luck

Stuart

  • 3 weeks later...
Posted

SGershon

 

did you solve your issue? I am having a similar issue and have no solution. I have chmod to 777 as well as tried your fix. No luck.

Posted

Hi Jim

 

Which version of osc are you using and have you installed any mods that add to the categories.php file?

 

Stuart

  • 2 weeks later...
Posted

Unfortunately I am in the same boat with this... tried all sorts of things to fix it but no luck yet.

 

Mine was working but during the last couple of weeks it stopped and now it will only load images to the /images dir

 

I would appreciate any one who knows how to change it responding please

 

regards

Paul

  • 3 months later...
Posted

Hi

 

OK - this is how I have set my admin>categories.php up to achieve this in MS2.

 

Firstly you need to create a folder in "images" set to 777 - lets call it "products" for this example. Then change the categories.php as follows:

 

find

 

/ copy image only if modified

$products_image = new upload('products_image');

$products_image->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_image->parse() && $products_image->save()) {

$products_image_name = $products_image->filename;

 

 

replace with

 

//copy image only if modified

$products_image = new upload('products_image');

$products_image->set_destination(DIR_FS_CATALOG_IMAGES . 'products/');

if ($products_image->parse() && $products_image->save()) {

$products_image_name = 'products/' . $products_image->filename;

 

Try this and post what you have if it doesn't work and we'll see if we can fix it so it does

 

Stuart

 

B)

Posted

At the beginning, I followed the instruction of http://wiki.oscommerce.com/helpHowtoUploadImages to do, it worked. But now the link of http://wiki.oscommerce.com/helpHowtoUploadImages was dead. And, the instruction doesn't work also.

 

Yesterday, I tried the instruction in http://www.oscommerce.info/kb/osCommerce/Tips_and_Tricks/188 but it totally didn't work.

 

I'll try Stuart's method later. I found that there're so many users have this problem. I think the image upload function of oscommerce is the worst. :angry:

Posted
At the beginning, I followed the instruction of http://wiki.oscommerce.com/helpHowtoUploadImages to do, it worked. But now the link of http://wiki.oscommerce.com/helpHowtoUploadImages was dead. And, the instruction doesn't work also.

 

Yesterday, I tried the instruction in http://www.oscommerce.info/kb/osCommerce/Tips_and_Tricks/188 but it totally didn't work.

 

I'll try Stuart's method later. I found that there're so many users have this problem. I think the image upload function of oscommerce is the worst. :angry:

 

Hi,

 

I tried Stuart's method and it works fine for me!

 

Regards,

Edze

  • 1 month later...
Posted

and waht if you want to put your images in different directories such that each manufacturer or product category is alocated a different image directory in images/ folder:

 

images/microsoft/software

images/microsoft/hardware

images/philips

images/acer

...

 

it is not practical to type in the image name and take care of the slash marks and all. it is very confusing.

 

i tried the knowledge base method as well didn't work for me. at least it an't practical. am confident i did it right.

 

any further suggestions?

Did you try? Did you fail? No matter! Try again. Fail again! But fail better!

Posted

Sulqk

 

I have replied to your pm - but which version of osc are you using? And have you added any mods that change this code? The method above should work for you if you have a straight MS2

 

Siavash

 

OK - thats a little more complicated - you are going to have to add some additional code allowing you to choose from a drop down list which folders you want to store the image into when you upload the files. I think I've seen a mod that does that, try searching for it in the contributions ... otherwise the method is fairly similar only you might refer to a variable instead of an actual folder in the code above --- I hope that makes sense, I'm afraid I don't have time to sort anything for that at the moment.

 

Stuart

Posted

Hi stuart thanks for the reply i have pmed you back,

 

i am using OCS 2.2. I havent installed any mods, was working fine a few months ago until i came to change a few products lately, just happened with no reason at all...

 

The problem is that i cannot upload images from my images subfolder i have named shop (images/shop/mypics.jpg).

 

The following forum suggests i change the admin>categories.php file @

 

/ copy image only if modified

$products_image = new upload('products_image');

$products_image->set_destination(DIR_FS_CATALOG_IMAGES);

if ($products_image->parse() && $products_image->save()) {

$products_image_name = $products_image->filename;

 

http://www.oscommerce.com/forums/index.php?showtopic=87613

 

but my admin/categories.php file has the code:

 

// copy image only if modified

$products_image = tep_get_uploaded_file('products_image');

$image_directory = tep_get_local_path(DIR_FS_CATALOG_IMAGES);

 

if (is_uploaded_file($products_image['tmp_name'])) {

tep_copy_uploaded_file($products_image, $image_directory);

$products_image_name = $products_image['name'];

} else {

$products_image_name = $HTTP_POST_VARS['products_previous_image'];

}

} else {

$product_query = tep_db_query("select p.products_id, pd.language_id,

 

 

HOW DO I CHANGE FOR IT TO DISPLAY IMAGES FROM MY SUBFOLDER "SHOP"?

 

I am soo confued, im not a master at this, been at this problem for weeks now, any help appreciated..

 

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...