remove sold items automatically

  • Posts: 99
  • Thank you received: 6
  • Hikashop Business
1 year 11 months ago #346877

-- url of the page with the problem -- : antiqueswan.com/
-- HikaShop version -- : 4.6.2
-- Joomla version -- : 3.10.11
-- PHP version -- : 8.0

Our site sells one of a kind items. I'd like to know if items that have sold can automatically be removed from the system entirely; the images in particular. The sold items take a lot of space and I'm trying to reduce the size of the site.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 11 months ago #346880

Hi,

You could create a mass action with the trigger "every day" and a filter on the product column "product_quantity" being equal to 0 and an action "delete the elements" and it will delete the products with a stock of 0 once a day. This will also delete the images linked to the products being deleted automatically.

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

  • Posts: 99
  • Thank you received: 6
  • Hikashop Business
1 year 11 months ago #347017

Thank you, Nicolas, the mass action makes sense. In this scenario though, I'm haven't been able to find the right filter. The shop is set up as a catalog so when an item is "sold" it's actually sold offline. Then, we manually unpublish the item and add "sold" and "archived" to the category field. Please see screenshot. When an item is for sale, it is published and assigned to various categories. Please see screenshot.

I've looked at all the filter possibilities but haven't been able to find an unpublished state to choose, or a "sold" and "archived" category to choose. When selecting "product columns" and "product_published = unpublished" the results (e.g. 1014) are the same as writing in "published," which is not correct. There are 375 published items.

Could you offer some guidance for this particular set up? I will certainly run the mass action on a backup copy first, but even before that I wanted to see if I'm even getting close to the right settings.

Thanks,

Karen

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 11 months ago #347018

Hi,

You can indeed use the product_published column. You need to use the value "0" instead of "unpublished".
Note that if you want to see what is filtered, you can use an action "display the results" instead of the "delete the elements" one. That way, you can confirm that the mass action will delete the correct elements when you change back the action.

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

  • Posts: 99
  • Thank you received: 6
  • Hikashop Business
1 year 11 months ago #347108

Well, of course, I should have thought to set it to 0 instead of writing unpublished. Thank you. I have it working now from using the "process" button. Even though I had it set to trigger every minute, I had to manually process the mass action. Is that normal?

Also, with the trigger selection, there is an option to choose every minutes, days, weeks, or months but not a field to set the number of minutes, days, weeks, or months. The selection being plural, e.g. days, makes me think there should be a trigger that I could set to occur every X number of days. Am I missing something here?

Last edit: 1 year 11 months ago by karendunne.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
1 year 11 months ago #347111

Hi,

For the "every" triggers to work, you need to first setup your cron task:
www.hikashop.com/support/documentation/5...ashop-cron-task.html
Also, if you use a cron task triggered every 15 minutes, even if your mass action says every minute, it will only trigger every 15 minutes.

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

  • Posts: 99
  • Thank you received: 6
  • Hikashop Business
1 year 11 months ago #347237

Got it, thank you, Nicolas, for the link and explanation.

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

Time to create page: 0.062 seconds
Powered by Kunena Forum