Delete the elements action doesn't work

  • Posts: 193
  • Thank you received: 76
9 years 5 months ago #178556

-- HikaShop version -- : 2.3.4
-- Joomla version -- : 3.3.6

I created Mass Action to delete all products from category, but "Delete the elements" action doesn't seems to work.
When I change action to "Display the results" it works as expected.

Attachments:
Last edit: 9 years 5 months ago by korzo.

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

  • Posts: 193
  • Thank you received: 76
9 years 5 months ago #178577

It doesn't work because method onProcessProductMassActiondeleteElements() is completely broken.
Only scenario when it partially works is when limit is more then 500.
Then exactly 500 records are deleted.
Here is fix:

function onProcessProductMassActiondeleteElements(&$elements,&$action,$k, $start = 0){
	$ids = array();
        $c = count($elements);

        for($i = $start; $i < $start + 500 && $i < $c; $i++)
        {
            $ids[] = $elements[$i]->product_id;
        }

        $productClass = hikashop_get('class.product');
        $productClass->delete($ids);

        if($i < $c)
        {
            $this->onProcessProductMassActiondeleteElements($elements,$action,$k, $start + 500);
        }
}

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

  • Posts: 13201
  • Thank you received: 2322
9 years 5 months ago #178622

Hi,

Yes we had indeed this issue, it's already corrected on our end, and the fix will be in the next release.
Thanks.

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

Time to create page: 0.073 seconds
Powered by Kunena Forum