how to remove category/product->data->image in admin?

Post By:user_43451 | Reply

after i set category/product image (under data tab), how do i clear the image (btw i don't want to delete the image from Image Manger as the image is also used by other category/product)?
user_43451Sun, 21 Aug 2011

anyway i modified the code for this..

add following accordingly in adminviewtemplatecatalogcategory_form.tpl

Code: Select all
<a class="button" onclick="clear_image('image','preview')"><span>Clear Image</span></a>
...
function clear_image(hidden,img) {
   if ($('#'+hidden).val()=='') {
      alert('There is no image to be cleared.');
      return;
   }
   $('#'+hidden).val('');
   $('#'+img).attr('src','<?php echo $no_image; ?>');
}


add following accordingly in admincontrollercatalog.php, getForm()
Code: Select all
$this->data['no_image'] = $this->model_tool_image->resize('no_image.jpg', 100, 100);

user_388Sun, 21 Aug 2011

Unfortunately there's no way to remove an image. The best alternative is to add no_image.jpg to your images and select that as the category/product image.

`Reply Or Comment!
Please LogIn to Reply!