Image alt text lost after importing?

I don't do much with exporting/importing, but wanted to change the quantities of many of my items.

So, I exported a comma separated with only Product code and Quantity fields, edited the quantities in Excel, imported the saved file with no other changes, and I noticed that all of the image alt texts for the primary images were lost/blank/missing after the import (additional images were left intact).

Thankfully a backup and restore to the database has me back to where I was. I think. I hope. Odd, and a bit unnerving as I'm not sure what else may be lost if I try this again. ?

Wondering if anyone else has experienced this or would like to test on theirs?

Thanks for any info…

Yes, I think it's a bug. The only reason I haven't persued it is because I have my alt text automatically created from the product name.

Tool - thank you for the response. I'll mill around the bug section and if it isn't there, I'll report for the fun of it.

Also, I knew the old code and changes for 1.x CS to get alt tags from the product name, but what would it be for 2.x? (couldn't find while searching the forums, sorry! [EDIT : correction, I did find some tweaks, but not for 2.2.x specifically. ?)

The code is a little different in the last few versions but if you look at the “tweaks” you may be able to figure it out. I'm out of town right now but I will look into it when I get back.

Tool - always appreciated. The mods I found did not pertain to my files, as in, I could not even locate similar code in my template(s) to even begin editing.

If there's a mod I can do, great, especially if it overrides an import scewup/bug. If not, no big deal, I can keep going as is.

Safe travels.



{if $detailed_image_path || $wrap_image}




{if $detailed_image_path || $wrap_image}


Tool - many thanks! I tried it and it doesn't work, still displays the text I entered. But I'll re-do when I have time today and see. I also have some photos that I need to credit the source, which I use alt text for too, so maybe this isn't the best automatic option. ?

I haven't been able to figure out the code to make the alt text either, but if you purchase and use something like MagicThumb from MagicToolbox, you can change the settings to use the title or whatever as your alt text. It is definitely a very nice tool.



@wwgreen, actually, tools option works just fine. You just need to clear your cache.

Tool, I see the else statement is in there, but still it replaces the alt image text also for images I do have this filled out for. Do you know why it would do this?

Would it be possible to change the code so it only replaces the alt text for images that do not have one yet?

Flow, it depends on which image…detailed or thumbnail? The detailed doesn't have an if statement for the title. I actually haven't been able to test the thumbnail if statement because like wwgreen, my alt text that I enter somehow gets removed. I think it has something to do with importing but I haven't looked into it.

Thanks tool…

I had alt-team create an add-on for me that makes alt-image look like: manufacturer - product name

Together with my brand add-on, this works great.

[font=arial,helvetica,sans-serif]Yep, I did something similar. My page title has the manufacturer, mpn, and product name so instead of using $product.product, I used $product.page_title[/font]

Thanks again for the comments here.

FYI for everyone interested, it is a bug, confirmed, and addressed/fixed here :

Problem is, not sure how to apply this fix to my version. ? Oh well…


Just insert {debug} in any page to find all the variables! Then you can edit the PRODUCT TPL files to have the product name included in the ALT tags of all images!

I personally find CSV much easier to use, and do not have any issues at all, importing products and their alternative text for primary / secondary images.

If anyone would like some help with their import / export automation, please let me know! :)

The example below includes:

  • Product ID (internal),
  • Product Code,
  • Category,
  • Sub Categories,
  • Product Name,
  • Description,
  • Features,
  • Options,
  • Search Words,
  • META Keywords (Meta Description optional - I don’t bother but should!),
  • Detailed Image (Full size - automatically resized and thumbnail made from it by Cs-Cart),
  • List Price,
  • Price,
  • Status (Available / Hidden / Disabled),
  • Quantity in Stock,
  • Inventory Tracking (Allows for separate import of quantities for combinations!),
  • Out of stock actions,
  • Zero Price Actions,
  • Taxes, and
  • Shipping and Freight.

    The ‘product options’ are automatically created for you with drop-down select boxes, check boxes, radio buttons, extended text etc…


<br />
Product ID,Product code,Category,Secondary categories,Product name,Description,Features,Options,Search words,Meta keywords,Detailed image,List Price,Price,Status,Quantity,Inventory tracking,Out of stock actions,Zero price action,Taxes,Shipping freight<br />
10,ABC1234,Category///Sub Category///Sub Sub Category,Category///Sub Category2///Category 1234; Category///Sub Category3/// Category ABCD,"Extreme Widget - 4 Corners, Blue Finish [Mens]","<div style=""font-family:Verdana,Geneva,Tahoma; font-size:12px;""><br />
<p><span style=""font-size:16px;""><b>EXTREME WIDGET - 4 CORNERS, BLUE FINISH</b></span></p><br />
<p><span style=""font-size:13px;"">How much wood can a wood chuck chop if a wood chuck could chop wood.<br /><u>Contains:</u> ply wood, laminate.</span></p><br />
<p><span style=""font-size:13px;"">This product matches and can be combined with: ABC2345, BCD1234 in sizes: 2XS - 2XL.</span></p><br />
<div style=""margin-left:10px; margin-top:5px;""><br />
	<p>&bull; <b>Widget Sizes:</b> <i>3XS - 5XL</i>.</p><br />
	<p>&bull; <b>Widget Colours:</b> <i>Black, White, Yellow, Green.</i></p>	<br />
</div><br />
<p style=""padding-top: 0px; padding-bottom:0px;"">&nbsp;</p><br />
<p><span style=""color: #000000; font-size: small; font-weight: bold;"">MEASUREMENT SIZE GRID</span></p><br />
<p><span style=""color: #000000;"">You may use the table below to determine an appropriate size and fit.  When ready to order, choose from the list of sizes in the drop-down box above.</span></p><br />
<span style=""color: #101010;""><img style=""float: left; border: 0px;"" title=""SIZE GRID - Widget Measurements"" src=""images/size_charts/ABC1234.png"" alt=""SIZE GRID - Widget Measurements"" border=""0"" /></span><br />
<br />
</div>","{1}Widget Sizes: E[3XS - 5XL];{2}Supplier: S[Supplier AAA];{3}Item ID: T[ABC1234];{4}Gender: S[MENS]","{1000}Widget Colours: S[{100}BLACK,{101}WHITE,{102}YELLOW,{103}GREEN]; {2000}Widget Sizes: S[{500}3XS,{501}2XS,{502}XS,{503}S,{504}M,{505}L,{506}XL,{507}2XL,{508}3XL,{509}4XL,{510}5XL]","Search Word1, Search Word2, Search Word3, Search Word3","Meta Keyword1, Meta Keyword2, Meta Keyword 2, Meta Keyword3","/home/xxxx/public_html/IMPORT/Widgets/ABC1234_hero.jpg#{[EN]:Extreme Widget - 4 Corners, Blue Finish [Mens];}",100.00,100.00,A,100.00,O,B,P,TAX.,50.00
```<br />
I was going t use colours above to represent each section linked to the comma separated variables but couldn't due to the "Code" block <img src="upload://6j4WBaIkh87XQWLgsfZeyVm9COz.png" class="bbc_emoticon" alt=":P"><br />
<br />
I hope this is of help, to show you how easy images (and everything else) can be done! <img src="upload://rA9Qa8gnUPZzRZRdI8kt3dpjkrs.png" class="bbc_emoticon" alt=":)">

[quote name='UniDevelopers' timestamp='1331347041' post='132871']Just insert {debug} in any page to find all the variables! Then you can edit the PRODUCT TPL files to have the product name included in the ALT tags of all images![/quote]

Did you not read the thread? It's posted.

[quote name='UniDevelopers' timestamp='1331347041' post='132871']I personally find CSV much easier to use, and do not have any issues at all, importing products and their alternative text for primary / secondary images.[/quote]

You obviously are not using the current version. It is a confirmed bug in the bug tracker with a fix.


We are certainly using the most current version 2.2.4 professional.

I have just clicked on a product, then right clicking on the image and can see the alt text! (Firefox > Right Click > View Image Info > “Associated Text: Jacket - Waterproof (Mens) - ABC1234”). Even the enlarged image has alternative text! I'm sorry, but there is no problem with any of the product images!

Do you really think I would spend all that time trying to help people if I didn't know what I was doing?

Using this format works, works for the specific client site we are working on now, and has worked for all other sites using 2.2.4 and before. This site has not been upgraded, and was installed in 2.2.4. Then modifications were transferred across (including a significant change to EXIM), configuration and settings are implemented, and then images uploaded to /IMPORT/ and then Product Imported, Secondary Images Imported. Done!

[quote][color=“#666600”]“…/[/color][color=”#000000"]ABC1234_hero[/color][color=“#666600”].[/color][color=“#000000”]jpg[/color][color=“#880000”]#{[EN]:Extreme Widget - 4 Corners, Blue Finish (Mens);}"[/color][/quote]

I've offered before to help others by sharing my method but have had no nibbles of interest for a free spreadsheet to perform all your product management, formatting (html), images, secondary + teritiary images, and so on.

Additionally, I've just searched all of the files, and cannot find "$add_fields[$_f][] = $_db_field;" anywhere. I then performed a search for “$add_fields[$_f] = true;” and found it on line 360 in “…/controllers/admin/exim.php”. So clearly we havin't applied the patch!

Make sense?

So, when you do an import to update prices or stock, do you export/import all of those fields? If so, that would explain why your alt tags aren't missing.

When I do a price change sheet or stock sheet, I only import in the fields:

Product code

Cost (my own field)




When I do this, the alt tags are removed.

But, I have an Ace up my sleeve. I use MagicToolbox's MagicThumb, which allows me to use use the product name or whatever as my alt tag. Pretty sweet.

Anyways, just curious.



G’day Brandon,

Yes, I have finally acheived the habit of making all product changes and modifications outside of the script / admin interface! So performing an import of only certain columns would take more time fiddling about (at this stage) than the extra time it would take to process these columns (decision making).

I have not set up another worksheet in Excel to only export descriptions for example (including Product_ID - not Product_code), however now that I think about it, I could quite easily do a macro, having it locate the end and have an offset (Selection.End(xlDown).Select, and ActiveCell.Offset(0, -1).Select etc, etc. Whoa! Stop! You do not want me going on about VBA in Excel!) So that when there is an X located at the end of a column, that column is exported (minus the X in the last cell of the column (offset)). Thanks for the idea! :)

However until now, for me it has been no big deal waiting an extra 30 - 120 seconds for all products to be updated, images re-imported and resized and so on, while importing into CS-Cart.


[quote name='UniDevelopers' timestamp='1331360432' post='132885']Yes, I have finally acheived the habit of making all product changes and modifications [color=#ff0000]outside of the script / admin interface[/color]![/quote]

You didn't mention that previously. No wonder you didn't have any problems. I'm pretty sure this thread is discussing why the standard software is not functioning properly. Proceed with the train ride…I will get off at this stop.

Yep, that one went right over my head. So are you doing this through phpMyAdmin or do you have your own script? For my quantity/price/cost/status updates, I just use the built in script in CS-Cart. It is way simple and I don't have to worry about accidentally screwing up all of my other data.