Forums / All Other Contributions/Addons / Question regarding images in the "add product" section

Question regarding images in the "add product" section

Views: 647

Results 1 to 5 of 5
16 Jun 2014, 4:02 AM
#1
jax2 avatar

jax2

New Zenner

Join Date:
Feb 2010
Posts:
14
Plugin Contributions:
0

Question regarding images in the "add product" section

I don't know where else to put this, and I'm hoping someone might be able to steer me towards an answer if one exists... here goes:

I have over 8000 products I have to manually enter into my shop - extremely time consuming, but no proper csv exists of my products. To help alleviate some of the tasks, I uploaded all 8000 images to the server, each one is an uppercase name with a lowercase .jpg extension (E.g. SNAA12.jpg).

The way I am doing it now is alt tabbing back and forth and copying and pasting info into my cart; title, type in the price, paste description, type in quantity, paste the item ID and paste it again in the image section and add a .jpg afterwards.

I know it sounds silly, but having to type in that .jpg every single time is beginning to be a pain. I am wondering if there is any add on or mod that will automatically add in the same item ID and add a .jpg to the end of it so I can skip having to add it manually...

Any suggestions? I know in the price section, when you add in the price, it automatically fills in the next box, that is kind of what I would like to have for the image (already on server) field.

16 Jun 2014, 4:29 PM
#2
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Question regarding images in the "add product" section

jax2:

I don't know where else to put this, and I'm hoping someone might be able to steer me towards an answer if one exists... here goes:

I have over 8000 products I have to manually enter into my shop - extremely time consuming, but no proper csv exists of my products.
<snip>
Any suggestions?

Yes. Find an easier way. Assuming it takes 2 minutes to add each product, it is going to take well over a month, working 8 hours a day, 7 days a week to add them all.

You obviously know that csv files can be imported into ZenCart, and you probably know that there are several tools/addons specifically written for this purpose.

My advice would be to familiarize yourself with one of these tools by exporting and importing the products you've already entered, and when you've become familiar with the .csv requirements you can then use a spreadsheet to add the rest of your products, making judicious use of the cut n paste facilities provided by such programs.

It'll take a couple of days or so to become familiar with the process, but in the long run you'll be saving yourself a LOT of time and effort.

Cheers
RodG

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

17 Jun 2014, 1:30 AM
#3
jax2 avatar

jax2

New Zenner

Join Date:
Feb 2010
Posts:
14
Plugin Contributions:
0

Re: Question regarding images in the "add product" section

I thought the same thing, however, my supplier DOES provide CSV's, just nowhere near how the shop CSV is set up. They do not list categories, the images are in a completely different CSV file...

I have already exported my shops 800+ inventory I've already done and looked at how I could add new products to the csv from theirs, and it seems like it would actually be MORE difficult than adding them manually, which, btw, I have timed lol... it's 40 seconds almost on the dot per item, and I calculated the exact same way you did, figuring still over a month to do! ARGH! That's why I figured hey, if I can tick off an extra 4 or 5 seconds of having to tab (or click) and enter a ".jpg" it would significantly reduce my input time.

17 Jun 2014, 1:41 PM
#4
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Question regarding images in the "add product" section

jax2:

That's why I figured hey, if I can tick off an extra 4 or 5 seconds of having to tab (or click) and enter a ".jpg" it would significantly reduce my input time.

OK, so here's what you'll need to do:

load the file /youradmin/includes/modules/update_product.php into a text editor

Find the line that reads:

 $sql_data_array['products_image'] = zen_db_prepare_input($_POST['products_image']); 

Change it to

$sql_data_array['products_image'] = zen_db_prepare_input($_POST['products_image'])[B].".jpg" [/B];

Save the file, and give it a try. I'll either do what you need, or cause a syntax error. Hopefully the former. :)

Cheers
RodG

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

17 Jun 2014, 5:02 PM
#5
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,808
Plugin Contributions:
22

Re: Question regarding images in the "add product" section

jax2:

I thought the same thing, however, my supplier DOES provide CSV's, just nowhere near how the shop CSV is set up. They do not list categories, the images are in a completely different CSV file...

RodG's previous replies are true to the point - you should really familiarize yourself with using those CSV files. I've seen hundreds of supplier CSVs and not one single file that was ready to be imported into Zen Cart out of the box. It's all about re-arranging the columns, that's all there is to it.
As for the images CSV file - that's a really simple one. I'm assuming that file has an identifier column (based on products ID or SKU or whatever). Whether you're using Excel or OpenOffice Calc, you can enter the same formula required to update your database using an SQL patch.

Let's say column A is your SKU (which you would use as products_model), and column B is image file name.
In Excel, use column C and enter the following:

UPDATE products SET products_image = '

Now, column D would contain:

' WHERE products_model = 

And column E will have

;

Select those cells, pull selection all the way to the bottom and use "Fill->Down" to get the same values for all rows.
Now go to column F and enter:

=C1&B1&D1&A1&E1

and press Enter.
Column F should now look like:

UPDATE products SET products_image = 'someimage.jpg' WHERE products_model = 123456;

Now, select that cell, pull selection to the bottom and use "Fill->Down". The formula gets copied and relevant data is added.

And, finally, copy all that new data into your admin->Tools->SQL Patches and click execute. Voila, ALL images entered. Of course, you'll need to upload images via FTP. Oh, and you MUST backup your database before running this, especially if it's your first time - you might crash the database and lose all work you've done... Just be careful...

This may see complicated at first, but rest assured it's as simple as it gets. I've used EasyPopulate and this type of SQL patches on a daily basis back in the days I had a computer shop - my suppliers had sent me new CSV files with thousands of products every morning - it took me about 15 minutes to update all 3 suppliers with over 10.000 products... :wink:

Regards,
Leonard

My site - Pro ZC Help
My portfolio | My plugins