Mass action delete all articles

  • Posts: 45
  • Thank you received: 0
10 years 7 months ago #120242

I have been testing with importing articles, but some are incorrect.
To start over I would like to delete all.

I have been informed that I can use Mass action and delete category for category.
But I am unable to find out how it works, can you help?

See attachment for the settings I have tried:

Attachments:
Last edit: 10 years 7 months ago by info@ifparts.com.

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

  • Posts: 2334
  • Thank you received: 403
10 years 7 months ago #120248

According to your screenshot you're trying to delete products from the category with the id OTHER, which seems difficult ;)
It looks like this category has the ID 17 so you should try with this ID instead.

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

  • Posts: 45
  • Thank you received: 0
10 years 7 months ago #120262

I felt stupid after reading your message, and happy because I thought I found the solution.
But it still does not work.

I have tried a few different options, but without reslut, see attachment

Attachments:

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

  • Posts: 2334
  • Thank you received: 403
10 years 7 months ago #120264

The screenshot shows that you mass action is applying on categories (it's the selected option in "Data").
This option has to be set on "Product". Also, could you confirm that you have something displayed next to the filter? Like the number of product in the category.

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

  • Posts: 45
  • Thank you received: 0
10 years 7 months ago #120463

Hello Eliot,

Please see second print screen in the zip file of my previous post.
I have also tried with, selecting product. I have writen the number of a category in the filter.

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

  • Posts: 2334
  • Thank you received: 403
10 years 7 months ago #120490

Indeed there was a bug in the massaction system.
Please edit the massaction.php file in administrator/components/com_hikashop/classes and delete this line:

if(!hikashop_level(2)) return true;

It should work better ;)

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

  • Posts: 45
  • Thank you received: 0
10 years 7 months ago #120607

Hello Eliot,

This did the job. Thank you very much!!

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

  • Posts: 45
  • Thank you received: 0
10 years 7 months ago #120615

Hello Eliot,

2 small problems,
1 st problem see print screen: categories are deleted, but the articles still excist.
2nd: Mass action is not starting any more.

Attachments:
Last edit: 10 years 7 months ago by info@ifparts.com.

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

  • Posts: 2334
  • Thank you received: 403
10 years 7 months ago #120625

Hi there,

1 - If you're deleting the categories that's normal, you should have deleted the product first and then the category itself. Mass actions are made to process specific data (categories for example) without impacting other data (product).
2 - Could you be more precise about it? How does this happen?

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

  • Posts: 45
  • Thank you received: 0
10 years 7 months ago #120627

Hello Eliot,

1. Is it possible to delete all articles afterwards?
2. If I try to open a new massaction or try to open an excisting one, I receive a blank screen. Nothing else happens.

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

  • Posts: 2334
  • Thank you received: 403
10 years 7 months ago #120639

1 - Indeed you can simply select the "delete products" action without any filter, it will delete every product you have.
2 - Really strange behavior, could you turn on the debug mode in the main joomla configuration.
We will also probably need a backend and a FTP access to check this and fix it. You can PM me these informations :)

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

  • Posts: 13201
  • Thank you received: 2322
10 years 7 months ago #120887

Hi,

It is opening the mass action screen when you create a new one or edit an old mass action.
It just take a very long time, and probably crash your browser.

We are actually not able to reproduce that bug on our local websites, so I will try to debug that on your end.

Have you any plugin which could be called when editing a massaction, or something else ?
I think that there is an endless loop.

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

  • Posts: 45
  • Thank you received: 0
10 years 7 months ago #121007

Hello,

It seems like this problem solved itself, I am able to use/open mass action again.
But when i try to dele all records nothing happens, I have tried the following configurations:

1. Data: product
Trigger filter: empty
Filters: Empty
Action: Delete elements

2. Data: product
Trigger filter: off
Filters: Product column > id 1 (I only fill in: 1)
Action: Delete elements

With the first option, nothing happens
With the second option, only 500 lines are deleted.

Are you able to advice me about what I am doing wrong?

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

  • Posts: 13201
  • Thank you received: 2322
10 years 7 months ago #121033

Hi,

I think that the problem come form the number of products to delete.
If there is too much products it can't suppress all of them in one step.

I suggest to use the limit, set a limit from 0 to 500, and do the process many times.

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

  • Posts: 45
  • Thank you received: 0
10 years 7 months ago #121037

Hello,

I have just ordered and paid for the bussines edition.
This is no good news, ins't there any other option to delete parts?

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

  • Posts: 13201
  • Thank you received: 2322
10 years 7 months ago #121051

Hi,

Thanks to replace the function "onProcessProductMassActiondeleteElements" in the file "your_site/plugins/hikashop/massaction_product" by:

	function onProcessProductMassActiondeleteElements(&$elements,&$action,$k, $start = 0){
		$ids = array();
		$i = 0;
		$productClass = hikashop_get('class.product');
		foreach($elements as $element){
			$nb = $i - $start;
			if($nb >= 0 && $nb < 500){
				$ids[] = $element->product_id;
				$i++;
			}elseif($nb >= 500){
				$result = $productClass->delete($ids);
				$start = $start + 500;
				$this->onProcessProductMassActiondeleteElements($elements,$action,$k, $start);
			}
		}
	}

This will delete all the product 500 per 500.

Last edit: 10 years 7 months ago by Xavier.

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

Time to create page: 0.113 seconds
Powered by Kunena Forum