Auto rename image names to product title

Hi,

does anyone have a foggiest idea if it’s possible to automatically rename images names to it’s product title.



My store is connected to a retail software which stores all the product info and stores the images. When image is send to the CSC it has a name like this: 116401351594979508fb3e35e154.jpg which is bad for SEO.



I’d like to make CSC to automatically rename the image file names to product titles. Is it even possible?



Thanks in advance,

Jacek

this is for old version bu you can try it



[url=“Auto ALT tag for Product Images - v1.x Configuration - CS-Cart Community Forums”]Auto ALT tag for Product Images - v1.x Configuration - CS-Cart Community Forums

Thanks John for the answer.



Unfortunately, that's not what I meant. The problem is that the file name of the image ([font=“arial, verdana, tahoma, sans-serif”][color=“#282828”]116401351594979508fb3e35e154.jpg) is automatically generated and consists of the checksum. I wonder if it's possible to use some kind of magic like mod_rewrite to cheat search engines and users and display the name of the file as title_of_the_product.jpg [/color][/font]



[font=“arial, verdana, tahoma, sans-serif”][color=“#282828”]Btw, I modified the part of the code from the topic above. Now, it automatically changes alt to title. I added also condition that if alt is filled by the admin it shows it.[/color][/font]



Just change line 150 in /customer/common_templates/image.tpl from:


[quote]alt=“{$alt_text}” title=“{$alt_text}”[/quote]



to


[quote]{if $alt_text}alt=“{$images.icon.alt|default:$images.detailed.alt}”{else}alt=“{$product.product|escape:html}”{/if} {if $alt_text}title=“{$images.icon.alt|default:$images.detailed.alt}”{else}title=“{$product.product|escape:html}”{/if}

[/quote]



Works on 3.0.6 Ultimate

you can do this, but it's a combination of excel-fu, batch-fu and awesome-fu. Not advised to the light hearted in anycase.

I found something similar to my problem here but the image structure doesn't allow to do this trick. JesseLee, you meant actually changing the file names? Could you describe more specific your idea?

for 4.2.2

/templates/common



image.tpl



{strip}
{if $capture_image}
{capture name="image"}
{/if}
{if !$obj_id}
{math equation="rand()" assign="obj_id"}
{/if}
{$image_data=$images|fn_image_to_display:$image_width:$image_height}
{$generate_image=$image_data.generate_image && !$external}

{if $show_detailed_link}

{/if}
{if $image_data.image_path}
{if $product.product}{$product.product|truncate:64:
{else}

{/if}
{if $show_detailed_link}
{if $images.detailed_id}

{/if}

{/if}
{if $capture_image}
{/capture}
{capture name="icon_image_path"}
{$image_data.image_path}
{/capture}
{capture name="detailed_image_path"}
{$image_data.detailed_image_path}
{/capture}
{/if}
{/strip}

[list]

[]soldierly Thank you, works great!

[
]I have one question: is it possible to show width and height in code of site!

[]sorry for my english

[
]Хотела сказать можно ли чтоб отображались характеристики width и height в коде страницы?

[/list]

better to leave this option as is for optimized responsive theme… you may have issues on mobile devices if you do such changes

[quote name='soldierly' timestamp='1410447501' post='191976']

for 4.2.2

/templates/common



image.tpl



{strip}
{if $capture_image}
{capture name="image"}
{/if}
{if !$obj_id}
{math equation="rand()" assign="obj_id"}
{/if}
{$image_data=$images|fn_image_to_display:$image_width:$image_height}
{$generate_image=$image_data.generate_image && !$external}

{if $show_detailed_link}

{/if}
{if $image_data.image_path}
{if $product.product}{$product.product|truncate:64:
{else}

{/if}
{if $show_detailed_link}
{if $images.detailed_id}

{/if}

{/if}
{if $capture_image}
{/capture}
{capture name="icon_image_path"}
{$image_data.image_path}
{/capture}
{capture name="detailed_image_path"}
{$image_data.detailed_image_path}
{/capture}
{/if}
{/strip}


[/quote]

Hi, i had use your tips for my site but image file name not rename to product title.

When i try save image on my site, image file name still same name when i upload.

Exp:

Product name: Headphone Sades SA-711

My SEO name: headphone_sades_sa_711

My images file upload: sa711.jpg



I want atuo rename my image to headphone_sades_sa_711.jpg



Please help me.



Thanks/



I use cscart 4.3.1.

Hello

I have a 4.3.5 cs-cart and i really need to autorename almost all image to product name.

Because i have all image from a suppliers and is not ok because the name of the image is the name of suppliers.

Can somebody help me whit a code?

Thanks!

Our team can help you to write new module for this functionality. Feel free to contact us if you are interested

Our team can help you to write new module for this functionality. Feel free to contact us if you are interested

Ok

Make me a offer and send it to ionut.enache@zenon.ro

If you make me a module, can you make the name of the products to be the name of image...?