Import Image ALT and Title tags from spreadsheet

  • Posts: 197
  • Thank you received: 5
  • Hikashop Business
10 years 5 months ago #159965

We are about to start importing products in our shop. I just realized that in all the example spreadsheet there seems to be only a column for the image but not one for the image ALT or Title tag.

is that correct? Do we have to add them manually or is the shop maybe generating those from the image filename?

Thank you for your reply.

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
10 years 5 months ago #160004

That's correct, the title and alt tags cannot be set in the CSV for now.
You can either do it manually, or export/import a CSV of the hikashop_files table entries of your database via PHPMyAdmin after the import of your products in order to add the title/alt in the corresponding columns of the files via Excel.

Please Log in or Create an account to join the conversation.

  • Posts: 197
  • Thank you received: 5
  • Hikashop Business
10 years 5 months ago #160128

Thank you for the kind reply.

Indeed it would be nice if those could be added to the bulk import. I can see all sort of things going wrong by screwing around with PhpMyAdmin (and also in my case it would make me the only person in my office with the skills to do that).

Hopefully you guys can get around to adding that in the near future. Meanwhile thank you very much for the clarification, it saved me a ton of time.

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
10 years 5 months ago #160259

Hi,

That's on our todo list.

Please Log in or Create an account to join the conversation.

  • Posts: 197
  • Thank you received: 5
  • Hikashop Business
10 years 3 months ago #167910

I can attest that adding the Alt and Title tags to the images using PhpMyAdmin works well, but it is not a pleasant thing to do. Beside the inherent risk of messing things up (which can be ameliorated by making backups and being careful), one thing is to create a meaningful "alt" tag while looking at a picture and another is to enter it in a spreadsheet.

I personally cannot wait for this to be implemented in a upcoming built of Hikashop. Even a separate import script would be better than what we have now. By that I mean a separate script that lets you enter a product SKU, picture name, alt and title tags in a separate spreadsheet. It would be easy from a user POV as it simply would require to spawn a separate CSV and import it.

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
10 years 3 months ago #168037

Hi,

You must have missed this line of the changelog of HikaShop 2.3.2:

The CSV import system now supports the import of images name, alt, order, and of the files order, free download option, name and download limit

www.hikashop.com/support/support/documen...ashop-changelog.html
So this is already implemented if you use the latest version of HikaShop, and you can use the column names images_name and images_description for that.

Please Log in or Create an account to join the conversation.

  • Posts: 197
  • Thank you received: 5
  • Hikashop Business
10 years 3 months ago #168053

I must have missed that. But part of the reasoin is that when I export my products I cannot find a column in the CSV for "alt" or "title" tags.

How would I go about importing those new fields for the existing products and for new products from this point on?

Her eis a list of columns I took from an export file just now:

product_id
product_parent_id
product_name
product_description
product_quantity
product_code
product_published
product_hit
product_created
product_sale_start
product_sale_end
product_delay_id
product_tax_id
product_type
product_vendor_id
product_manufacturer_id
product_url
product_weight
product_keywords
product_weight_unit
product_modified
product_meta_description
product_dimension_unit
product_width
product_length
product_height
product_max_per_order
product_access
product_group_after_purchase
product_min_per_order
product_contact
product_display_quantity_field
product_last_seen_date
product_sales
product_waitlist
product_layout
product_average_score
product_total_vote
product_page_title
product_alias
product_price_percentage
product_msrp
product_canonical
product_warehouse_id
product_quantity_layout
product_status
product_vendor_params
categories_ordering
parent_category
categories_image
categories
price_value
price_currency_id
price_min_quantity
price_access
files
images
related
options

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
10 years 3 months ago #168078

These columns are not yet supported by the export system, only by the import system.
As I said in my previous message, you can use the column names images_name and images_description to enter the title and the alt of your images.

The following user(s) said Thank You: conticreative

Please Log in or Create an account to join the conversation.

  • Posts: 197
  • Thank you received: 5
  • Hikashop Business
10 years 3 months ago #168205

Sounds great, thank you.


EDIT: Something just occurred to me. You know how each product, in fact each variant even, can have multiple pictures?
How are those handled? Do you only get one name and description for all the pictures of one product/variant? That wouldn't be the end of the world, but I am sure I am going to be asked that question at some point by the marketing people.

Last edit: 10 years 3 months ago by conticreative.

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
10 years 3 months ago #168214

No, you can have one name/description per image. Like for the images field, you can use a separator in the images_name/images_description fields to have several names/descriptions for a variant/product. The point is to have as many separators in these fields than in the images field.

Note that you'll want to add this patch so that it works properly:
www.hikashop.com/forum/product-category-...-product.html#168213

Please Log in or Create an account to join the conversation.

  • Posts: 260
  • Thank you received: 25
8 years 4 months ago #245153

Hi,

I am able to successfully import my batched CSV file and all works as expected, but it wont import image Alts and descriptions.

The headings I am using are:
images_name
images_description

But when I look at individual products, the Alt is still the defaul value (derived from file name) and the description is empty.

No errors reported on the import.

Any help on this most appreciated.

Simon


Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
8 years 4 months ago #245171

Hi,

We would need to look at your CSV to be able to say anything useful.
Could you provide it ?

Please Log in or Create an account to join the conversation.

  • Posts: 260
  • Thank you received: 25
8 years 4 months ago #245181

Hi Nicholas,

Yes of course.

File Attachment:

File Name: hikashop-alts.csv
File Size:18 KB


Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
8 years 4 months ago #245250

Hi,

It's because of the comma in your texts. Because of that the system thinks that you have a name and a description for several images but only one image and because of that, it doesn't know what to add where.

Change the code:

$this->_separate($product->$name);
			if(count($product->$name) != count($files)) continue;
			$key = 'file_'.$var;
			foreach($files as $k => $file){
				$files[$k]->$key = $product->{$name}[$k];
			}
to:
$key = 'file_'.$var;
			if(count($files)>1){
				$this->_separate($product->$name);
				if(count($product->$name) != count($files)) continue;
				foreach($files as $k => $file){
					$files[$k]->$key = $product->{$name}[$k];
				}
			}else{
				foreach($files as $k => $file){
					$files[$k]->$key = $product->$name;
				}
			}
in the file administrator/components/com_hikashop/helpers/import.php and that should work fine with your CSV.

The following user(s) said Thank You: sambob

Please Log in or Create an account to join the conversation.

  • Posts: 260
  • Thank you received: 25
8 years 4 months ago #245271

Thanks Nicolas, perfect!
Greatly appreciated!


Don't look at what is and ask 'why?'; look at what isn't and ask 'Why Not!'

Please Log in or Create an account to join the conversation.

Time to create page: 0.069 seconds
Powered by Kunena Forum