How to prevent HikaShop from deleting images

  • Posts: 54
  • Thank you received: 2
  • Hikashop Business
9 years 3 months ago #209437

-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.3
-- PHP version -- : 5.6.11
-- Browser(s) name and version -- : n/a

Hi,

I have uploaded my images (in a directory structure) by ftp to the webserver, located in HikaShop's default image upload folder. When adding products, images are selectedfrom this directory structure.

When you delete a product and the product is the last product a particular image is assigned to, the image itself will be deleted as well.

Is there any way to prevent HikaShop from deleting images on product deletion?

Thanks in advance!

Joep

Last edit: 9 years 3 months ago by jvstratum.

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

  • Posts: 82725
  • Thank you received: 13338
  • MODERATOR
9 years 3 months ago #209440

Hi,

There is no option for that.
HikaShop delete the images on purpose to make sure that they don't eat up too much space on your server in the long run.

You can always remove the code:

$class = hikashop_get('class.file');
			$class->deleteFiles('product', $elements, $ignoreFile);
			$class->deleteFiles('file', $elements, $ignoreFile);
from the file administrator/components/com_hikashop/classes/product.php to avoid the deletion of the images when deleting products via the interface. But I don't recommend that as you'll loose the change each time you update HikaShop.

The following user(s) said Thank You: jvstratum

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

  • Posts: 54
  • Thank you received: 2
  • Hikashop Business
9 years 3 months ago #209726

Thank you Nicolas. I won't change the PHP-code since I won't want to loose changes after every update.

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

Time to create page: 0.040 seconds
Powered by Kunena Forum