AbanteCart Community

Shopping Cart Operations => Support => General Support => Topic started by: ygalbrami on May 11, 2013, 09:50:09 AM

Title: alt images and order images
Post by: ygalbrami on May 11, 2013, 09:50:09 AM
there is a way to put alt in the images?

i need all the items will be the same as the alt
i don't care do change some code to do that.

i very need that for  google SEO.

i need also when i upload images with the name: image-1.jpg, image-2.jpg, image-3.jpg
it will be order by thenumber of the image automatic

how i can make this happend?

thank you
Title: Re: alt images and order images
Post by: abantecart on May 12, 2013, 10:41:33 PM
You can set alt text in the resource library.
Locate the image and click edit. You need to provide Title to set Alt on the image.
Title: Re: alt images and order images
Post by: ygalbrami on May 13, 2013, 12:02:18 AM
I will upload 1000 images to make salt like this will take long long time.

Can you please give me another way?
I need the salt will be the same as the title items
How I can to that with code?
Title: Re: alt images and order images
Post by: abolabo on May 13, 2013, 04:59:43 AM
I will upload 1000 images to make salt like this will take long long time.

Can you please give me another way?
I need the salt will be the same as the title items
How I can to that with code?

What do you try to paste into title except image's file name?
"Alt" and "title" are textual description of image. It can be changed depending on language of UI.
Another words, text of "alt" attribute is unique for every image.
I don't see automatic method yet.
Title: Re: alt images and order images
Post by: ygalbrami on May 13, 2013, 05:58:21 AM
There is a way but I don't know how or where to edit the code all my  image name by SKU so it need to rename the alt in all the images.

Please I need that code <IMG SRC="<?php echo $image ?"> alt="<?php echo $title ?>">

I will tank you if you can help me with this.
Title: Re: alt images and order images
Post by: abolabo on May 13, 2013, 06:26:02 AM
open file public_html/storefront/controller/blocks/bestseller.php and add sku into $this->data['products'] array in line 86.
then you can edit tpl with product list, for ex.public_html/storefront/view/default/template/blocks/bestseller_home.tpl
Code: [Select]
<img src="<?php echo $product['thumb']['thumb_src']?>" alt="<?php echo $product['sku']; ?>">inside loop.
Note! It's custom solution. We don't recommend use it. Upgrade of cart will rewrite your changes.
Usually we use hook for controllers when build template extension.
Title: Re: alt images and order images
Post by: ygalbrami on May 13, 2013, 07:08:52 AM
ok i did this and i make few changes
your code you give me is WRONG and don't work

this is the correct code, i post it here just to let you know: in bestseller.tpl:
Code: [Select]
  $item['image'] = '<img src="'.$product['thumb']['thumb_url'].'" alt="'.$product['name'].'">';
this is:
Code: [Select]
$product['thumb']['thumb_url']and not:
Code: [Select]
$product['thumb']['thumb_src'] as you put here.

in product.tpl is not same code :
Code: [Select]
echo '<img src="'.$image_main[ 'thumb_url'].'" alt="'.$heading_title.'">';
please give us good code next time, thanks

you can locked this as it works.