Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Image Upload


ManagerJosh

Recommended Posts

Posted

Since no one was helping me in my other thread, I thought I try this forum. I was wondering in osCommerce 2.2 that we can upload an image into a subfolder like /images/$manufacturer_name/$imagefile

 

Is it possible without going into MySQL and modifying it.

Posted

Cross posting does not make things faster ... just takes up more space.

 

Sometimes, good things come to those who wait ... granted I hear tell patience was a virgin ... but then I digress ...

 

At the moment the code does not provide an automatic way for images to be loaded in sub-directories. Those that are in there were coded that way to show that they could be organized in a neater fashion than everything dumped in one place.

 

Do feel free to re-write that and contribute an add-on enhancement as it would be a nice feature :D

Posted

I did an affiliate outlink addon recently but I'm not at this point willing to share the coding because the refusal of help from certain people -_-

 

I'll take a peep into what I can do.

Posted

See what you can come up with ... I have seen a number of folks looking for a similar feature to what you are refering to and it would be handy to organize images and such.

 

Good luck on it.

Posted
I did an affiliate outlink addon recently but I'm not at this point willing to share the coding because the refusal of help from certain people -_-

 

Thats a really poor attitude. Makes a mockery out of all those who have taken the time to contribute scripts and of the Core Team who put in a hell of a lot of work free of charge.

 

In my opinion.

Posted

Unfortunately when I brought my idea to the core team, they disagreed with it completely on the idea. So i set out to do it myself. And I did it, and there is not a single problem with it.

 

I don't think anyone would want such a code hack and even if they did want it, I didn't see much support when I asked for help on it before. -_-

 

 

 

Just a minor research question:

 

In categories.php, when you select the drop down menu for a manufacturer, $pInfo->manufacturers_id what determines what product's ID is when the admin adds/updates a product

Posted

This script is starting to annoy me....

Could someone give me an insight on what I did wrong?

 

$manufacturers_array = array(array('id' => '', 'text' => TEXT_NONE));
   $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name, manufacturers_directory from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
   while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
     $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],
                                    'text' => $manufacturers['manufacturers_name']);
   }
   $manufacturers_data = tep_db_fetch_array($manufacturers_query);




$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/$manufacturers_data['manufacturers_directory']}; 
// Directory Modifications

       $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, pd.products_name, pd.products_description, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id  from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . $HTTP_GET_VARS['pID'] . "'");
     $product = tep_db_fetch_array($product_query);

     $pInfo = new objectInfo($product);
     $products_image_name = $pInfo->products_image;
   }

Posted

OK, so within 2 posts you go from "I've got code that I'm not going to share because people won't help me" to "Somebody tell me what I'm doing wrong" with a big slice of totally uncommented code and we've been given no context.

 

Here's a clue about the Free Software world: You get by giving.

 

I just spent about 12 hours enhancing the Excel Upload, and I just finished turning it in as a contribution.

 

It was based on some code that dynamok had submitted as a contribution just a couple days ago.

 

Now everyone has a good excel/csv upload solution.

 

See how it works?

 

A couple days ago, I contributed a fedex shipping module, which I'd spent about 8-10 hours writing.

 

I've been writing php exclusively for over 2 years as a senior level engineer, been coding of some type for over 20 years, and I'm sure if I wanted to, I could find the bug in your code, but somehow, I'm just not too motivated. After all, why should I help debug code I'm never going to get to use?

 

Tim

Posted
Unfortunately when I brought my idea to the core team, they disagreed with it completely on the idea. So i set out to do it myself. And I did it, and there is not a single problem with it.

 

I do not recall reading about any related issues concerning that.

 

Could you post some references (with their appropriate timestamp)?

:heart:, osCommerce

Posted
I do not recall reading about any related issues concerning that.

 

Could you post some references (with their appropriate timestamp)?

 

 

I was under this username previously but on the older forum system before oscommerce switched to phpBB.

Posted
OK, so within 2 posts you go from "I've got code that I'm not going to share because people won't help me"  to "Somebody tell me what I'm doing wrong" with a big slice of totally uncommented code and we've been given no context.

Tim

 

I never said I wouldn't release this modifications. I won't release the affiliate outlink (eg. amazon.com) hack because oscommerce doesn't agree with my idea hence reasons why I developed it myself

 

As for multiple directories for images, I will probably release it (after I get the bugs ironed out) and I have intentions of releasing that, but my affiliate outlink is one I intend not to.

Posted
I won't release the affiliate outlink (eg. amazon.com) hack because oscommerce doesn't agree with my idea hence reasons why I developed it myself

 

It's a good thing not everyone thinks this way. If everyone kept their ideas to themselves because some people didn't agree with it, where would we be today? :shock:

If every member of this board donated $1 to the dev team, that would be over $11,000.00. Don't you think this cart is worth at least a $1????

Posted
I won't release the affiliate outlink (eg. amazon.com) hack because oscommerce doesn't agree with my idea hence reasons why I developed it myself

 

It's a good thing not everyone thinks this way. If everyone kept their ideas to themselves because some people didn't agree with it, where would we be today? :shock:

 

You are misquoting me entirely. I'm saying that oscommerce didn't like the idea because it is completely different from what their vision was.

 

Enough about that other hack....

 

 

 

 

I've successfully was able to create in manufacturers.php on the admin interface to specify a directory of choice.

 

My current problem now is implementing it by when a user selects from the drop down menu, it selects the ID and by doing so, selects the directory determined.

 

Suggestions on how to address the problem.

Posted

Well I don't know if this applies but I was testing my site so I uploaded an item. It's images, info about the product, the price and such. I didn't have to do anything special and the image I uploaded worked.

 

I uploaded the image under admin. Add product.

 

- Alex

Extreme Alterations

Posted

Freedom,

 

The purpose for this rewrite is so that we can specify a subdirectory under /images for an item.

 

It is completely optional, but it helps maintain a level of sanity in the image folder.

Posted

okay something isn't making sense...could someone from the dev team explain the upload procedure to me?

 

Cause I can't figure out the order of operation on which script goes first.

Posted

Okay I'm not understanding how the upload sequence is working here. I've seen other upload sequences before, but none as complex as this one....

 

Help?

Archived

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

×
×
  • Create New...