unpublish products with variants with zero stock

  • Posts: 13201
  • Thank you received: 2322
10 years 1 month ago #145634

Hi,

Sorry for the late reply.
As you said, something has been changed regarding the variants in the mass actions, but not what you need.

It is still on our TODO list. :)

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

  • Posts: 252
  • Thank you received: 3
9 years 10 months ago #158622

Hello Xavier,
Just to let me know.
Did you manage add this to the last update?
Or is there perhaps another way to coop with this?
Regards

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

  • Posts: 13201
  • Thank you received: 2322
9 years 10 months ago #158630

Hi,

Not yet managed in the mass actions.
If you have PHP and MySQL knowledges, you can potentially make a plugin to get all the products where the variants have no stock.
Here is some documentation to create a mass action plugin:
hikashop.com/support/support/documentati...s-action-plugin.html

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

  • Posts: 252
  • Thank you received: 3
9 years 10 months ago #158763

Hi Xavier,
Thank for answering.
creating a plugin is rather a bridge to far for me.
I'd hoped it would be available on short term.
I will fix it with my POS system. The same as my stock.

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

  • Posts: 344
  • Thank you received: 3
7 years 5 months ago #253991

Hikashop 2.6.4
Joomla 3.6.4

So I am going to start selling clothes in my store.
And since clothes come in different sizes I will need many products with variants.

Anyway, I want the main product to be automatically unpublished when all the variants (I.e Small, meidum, large, X-large) have reached Stock quantiy 0.

Is this possible ?

Then in would be much easier for me to delete it from the back-end afterwards.

Since the clothes are unique and when its sold out it does not come in the store again.

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

  • Posts: 81513
  • Thank you received: 13066
  • MODERATOR
7 years 5 months ago #254014

Hi,

Yes. If you set the sum of the stock of all the variants in the quantity field of the main product, it will decrement automatically when the variants are purchased and when reaching 0, customers won't be able to purchase the product. And if you want to remove it from the listings, just make sure that the "out of stock" setting of your listings is set to false so that you don't display the out of stock products on the listings.

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

  • Posts: 344
  • Thank you received: 3
7 years 5 months ago #254069

OK tnx for reply.
This sounds good.

But to make it even easier; Is it possible tweak the code so that the sum of the quantity variants is the one that display in the back-end products listing ? (without setting any sum in the quantity field of the main product)

See attached image to see where I mean.



...and for the normal products without variants it should just work the way is does as normal.

Attachments:

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

  • Posts: 252
  • Thank you received: 3
7 years 5 months ago #254088

We have created a batch in our POS system.
Which checks the stock on parent products and their child in our maintenance system.
If there is zero stock on all.
It set the publised from 1 to 0
That way it is not visible.
It makes it also easier to delete on the hika database.

Issue is still on how to deal on NOOS product.
Also this is set in the POS system.
These product are overuled.

I hope this also give you some ideas how to maintain your webshop

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

  • Posts: 81513
  • Thank you received: 13066
  • MODERATOR
7 years 5 months ago #254072

Hi,

You could, but then you wouldn't be able to sort the products by quantity as you would still have -1 (unlimited) in the database for the product quantity and the ordering is done in MySQL.
µAnd the code to do that is not easy as you would have to do a MySQL for each product of the listing to retrieve the quantity of all the variants and then do the sum.

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

Time to create page: 0.093 seconds
Powered by Kunena Forum