Author Topic: alt images and order images  (Read 7702 times)

Offline ygalbrami

  • Full Member
  • ***
  • Posts: 128
  • Karma: +9/-2
    • View Profile
alt images and order images
« 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
« Last Edit: May 11, 2013, 10:48:01 AM by ygalbrami »

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4358
  • Karma: +299/-10
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: alt images and order images
« Reply #1 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.
Please  rate your experience or leave your review
We need your help to build better free open source ecommerce platform for everyone. See how you can help

Offline ygalbrami

  • Full Member
  • ***
  • Posts: 128
  • Karma: +9/-2
    • View Profile
Re: alt images and order images
« Reply #2 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?

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2051
  • Karma: +320/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: alt images and order images
« Reply #3 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.
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline ygalbrami

  • Full Member
  • ***
  • Posts: 128
  • Karma: +9/-2
    • View Profile
Re: alt images and order images
« Reply #4 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.

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2051
  • Karma: +320/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: alt images and order images
« Reply #5 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.
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline ygalbrami

  • Full Member
  • ***
  • Posts: 128
  • Karma: +9/-2
    • View Profile
Re: alt images and order images
« Reply #6 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.
« Last Edit: May 14, 2013, 03:53:47 PM by ygalbrami »

 

Powered by SMFPacks Social Login Mod