Post by straightlight » Fri Jan 13, 2012 5:46 am

Not to take any chances on this, I built a VQMod version. See from the attachment.

Attachments

Delete product images from the admin.


Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by genegrin » Fri Jan 13, 2012 6:08 am

Thank you very much. please explain me what must i do with that delete_product_images.xml file? sorry, i'm not a coder.

Active Member

Posts

Joined
Wed Jun 08, 2011 3:00 am

Post by straightlight » Fri Jan 13, 2012 6:14 am

XML files are useful with VQMod. If you don't have it, you will have to install it which the OC team seem to recommend it so to not override any core files: http://code.google.com/p/vqmod/download ... encart.zip

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by genegrin » Fri Jan 13, 2012 6:39 am

Thank you once. Yes, i have xml files. i just can't understand where i have to put that delete_product_images.xml. tell me please.
Last edited by genegrin on Fri Jan 13, 2012 6:47 am, edited 1 time in total.

Active Member

Posts

Joined
Wed Jun 08, 2011 3:00 am

Post by straightlight » Fri Jan 13, 2012 6:45 am

Under the vqmod/xml folder.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by genegrin » Fri Jan 13, 2012 6:48 am

okay.

Active Member

Posts

Joined
Wed Jun 08, 2011 3:00 am

Post by genegrin » Sat Jan 14, 2012 12:08 am

I was wrong, i don't have a vqmod/xml folder.
When we set up OC, I thouhgt it would be easy to delete sold items and their images.
Problem is, we're selling xmas ornaments and collectibles. So if items are sold, we need to delete them total.

Active Member

Posts

Joined
Wed Jun 08, 2011 3:00 am

Post by straightlight » Sat Jan 14, 2012 12:14 am

In order to delete these items momentarily, it wouldn't be from the product's controller but rather from the orders as soon as the order status would be set to Complete on your behalf. Although, doing it this way wouldn't give you the advantage of reversing the process since the images and its relations would be already gone except for the orders result. :/

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by genegrin » Sat Jan 14, 2012 12:37 am

So the best resolve is to delete sold items' images by hand as one by one. Am i right? Will their dates be deleted from the database in this case as well?
Many thanks once.

Active Member

Posts

Joined
Wed Jun 08, 2011 3:00 am

Post by straightlight » Sat Jan 14, 2012 12:46 am

If you manually delete from FTP, nothing from the database regarding the product_images will be deleted though. The best approach would be to have a copied order images table so to get rid of the ones from the store at the same time as the FTP once set to a Complete order from the admin.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by genegrin » Sat Jan 14, 2012 2:25 am

straightlight wrote:The best approach would be to have a copied order images table so to get rid of the ones from the store at the same time as the FTP once set to a Complete order from the admin.
Do you mean to delete them from the database directly?
Sorry i'm re-asking the things.

Active Member

Posts

Joined
Wed Jun 08, 2011 3:00 am

Post by straightlight » Sat Jan 14, 2012 2:44 am

Here's a patch. Sorry for the bit delay but I still had to develop this VQMod file so to make this feature possible on both ends (FTP and admin).

On the attachment, you will find the XML file.

// Optional if you don't want to keep those images but at least to execute the following query below is what would be amended as an extra step so to also show the images amongst the order products and straight from the orders.

In your PHPMyAdmin console, under your OpenCart database in the SQL tab, execute the following query:

Code: Select all

CREATE TABLE `oc_order_product_image` (
  `product_image_id` int(11) NOT NULL AUTO_INCREMENT,
  `product_id` int(11) NOT NULL,
  `image` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `sort_order` int(3) NOT NULL DEFAULT '0',
  PRIMARY KEY (`product_image_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
Note: Rename oc_ from the table if invalid.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: Bing [Bot] and 16 guests