mass action doesn't work as expected after using "process"

  • Posts: 99
  • Thank you received: 6
  • Hikashop Business
4 days 3 hours ago #364414

-- url of the page with the problem -- : antiqueswan.com/
-- HikaShop version -- : 5.1.1
-- Joomla version -- : 5.2.1
-- PHP version -- : 8.2.25

Hello,

I have a mass action set up to delete unpublished products each month. I recently discovered that it's not working. Please see attached screenshot to see the settings.

This is the same mass action that was discussed in this thread:
www.hikashop.com/forum/orders-management...s-automatically.html

Is this no longer set up correctly? Can you point me in a direction to determine a fix, please?

Thanks,

Karen

Attachments:

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

  • Posts: 82818
  • Thank you received: 13362
  • MODERATOR
4 days 5 minutes ago #364415

Hi,

Note that this mass action will only delete up to 10 (due to the "10" in the value field of the limitations section of your mass action) unpublished products each month.
If each month, you unpublish more than 10 products, then the unpublished products will start piling up.

Similarly, if you manually process the mass action, it will only delete up to 10 unpublished products. If you have hundreds of unpublished products, you might not notice that 10 of them have been deleted after the processing of the mass action.

On top of this, note that the mass action on the "product" type actually process both products and variants. So if you unpublish 100 variants of a product, then for just that product's variants to be processed by the mass action will require 10 months.

Because of all of this, I'm thinking that the mass action is actually working, but you just don't notice it because it's not processing enough products / variants often enough.

Also, you want to check that your cron task is running :
www.hikashop.com/support/documentation/5...cron-task.html#check
If the cron task is not running, then the mass action won't be called every month.

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

  • Posts: 99
  • Thank you received: 6
  • Hikashop Business
3 days 21 hours ago #364429

OK, understood. Thank you for looking at it and providing the explanation. I'll make the adjustments so it performs the way I'd like it to.

One other related question: Is there a way to use a mass action to delete ONLY the images of an unpublished product? I'm trying to control the size of the site and it's the images that take all the bandwidth. It would be nice to still have a record of the unpublished products but eliminate their images.

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

  • Posts: 82818
  • Thank you received: 13362
  • MODERATOR
3 days 10 hours ago #364431

Hi,

There is no action available by default to delete the images of a product. However, you can use the "run PHP code" action with this code in order to do that:

$fileClass = hikashop_get('class.file');
$fileClass->deleteFiles('product', {product_id});

The following user(s) said Thank You: karendunne

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

  • Posts: 99
  • Thank you received: 6
  • Hikashop Business
3 days 2 hours ago #364447

I see what you mean. Thank you.

While I can make sense of php, I'm not a php developer. Does that code target only the unpublished products? I don't recognize anything that indicates it is for unpublished items.

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

  • Posts: 82818
  • Thank you received: 13362
  • MODERATOR
2 days 22 hours ago #364448

Hi,

No, this code targets the products filtered by the mass action.

So, you still want to have your filter on the product_published column in your mass action.

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

Time to create page: 0.064 seconds
Powered by Kunena Forum