Kennedy
Kennedy

Reputation: 335

how to update the image fields in admin side of prestashop

I have added image caption fields in admin products images tab using follwing code in following location

admin/themes/default/template/controllers/products/images.tpl

<td id="td_image_id" class="pointer dragHandle center positionImage">
<input type="text"   name="image_caption"   value=image_caption  >  
</td>

I have added image_caption field in ps_image table

imageLine({$image->id}, "{$image->getExistingImgPath()}", {$image->position}, "{if $image->cover}enabled{else}forbbiden{/if}", assoc," {$image->image_caption}");

using above data retreive from the table .now i have stuggle with update the image_caption field.how to update that field ?

Upvotes: 0

Views: 830

Answers (1)

R&#233;mi Gaillard
R&#233;mi Gaillard

Reputation: 106

There are only 5 arguments in the imageLine JS function, see below

function imageLine(id, path, position, cover, shops)

You need to edit this function by something like that:

function imageLine(id, path, position, cover, shops, image_caption)
{
 line = $("#lineType").html();
 line = line.replace(/image_id/g, id);
 line = line.replace(/image_caption/g, image_caption);
 ....
}

I hope that will help you.

Upvotes: 1

Related Questions