[Skip to main content](#vessel-content)

#   unpublish products with variants with zero stock

##

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

12 years 9 months ago [\#145634](#145634) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[unpublish products with variants with zero stock](/forum/37-import-export-csv-xls/861124-unpublish-products-with-variants-with-zero-stock?start=20#145634 "-- url of the page with the problem -- :   dodowear.nl  -- HikaShop version -- : 2.2 -- Joomla version -- : 2.5 -- PHP version -- : x.x.x -- Browser(s) name and version -- : Firefox -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  Hello, we work with products with variants As most of the products are seasonly (only delivered once) they need to be unpublished when sold out. So when all variant of a product have no stock anymore the parent product should become unactive. Up until now I do this manualy with import and export in excel or walking trough the website. But as you can understand this is a lot of work. So I was wondering if you could tell me a simplerer and more time winning method  thanks in advance Boudewijn")*

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. ![:)](/media/kunena/emoticons/3.png ":)")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjExMjQtdW5wdWJsaXNoLXByb2R1Y3RzLXdpdGgtdmFyaWFudHMtd2l0aC16ZXJvLXN0b2NrP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Boudewijn](/forum/user/6864-boudewijn "View Boudewijn's Profile")**
- [![Boudewijn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6864.jpg)](/forum/user/6864-boudewijn "View Boudewijn's Profile") Topic Author
- [ Offline](/forum/user/6864-boudewijn)

Less More

- Posts: 252
- Thank you received: 3
-
-
-
- [](http://www.dodowear.nl)
-

12 years 6 months ago [\#158622](#158622) by [Boudewijn](/forum/user/6864-boudewijn "View Boudewijn's Profile")  Replied by *[Boudewijn](/forum/user/6864-boudewijn "View Boudewijn's Profile")* on topic *[unpublish products with variants with zero stock](/forum/37-import-export-csv-xls/861124-unpublish-products-with-variants-with-zero-stock?start=20#158622 "-- url of the page with the problem -- :   dodowear.nl  -- HikaShop version -- : 2.2 -- Joomla version -- : 2.5 -- PHP version -- : x.x.x -- Browser(s) name and version -- : Firefox -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  Hello, we work with products with variants As most of the products are seasonly (only delivered once) they need to be unpublished when sold out. So when all variant of a product have no stock anymore the parent product should become unactive. Up until now I do this manualy with import and export in excel or walking trough the website. But as you can understand this is a lot of work. So I was wondering if you could tell me a simplerer and more time winning method  thanks in advance Boudewijn")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjExMjQtdW5wdWJsaXNoLXByb2R1Y3RzLXdpdGgtdmFyaWFudHMtd2l0aC16ZXJvLXN0b2NrP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

12 years 6 months ago [\#158630](#158630) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[unpublish products with variants with zero stock](/forum/37-import-export-csv-xls/861124-unpublish-products-with-variants-with-zero-stock?start=20#158630 "-- url of the page with the problem -- :   dodowear.nl  -- HikaShop version -- : 2.2 -- Joomla version -- : 2.5 -- PHP version -- : x.x.x -- Browser(s) name and version -- : Firefox -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  Hello, we work with products with variants As most of the products are seasonly (only delivered once) they need to be unpublished when sold out. So when all variant of a product have no stock anymore the parent product should become unactive. Up until now I do this manualy with import and export in excel or walking trough the website. But as you can understand this is a lot of work. So I was wondering if you could tell me a simplerer and more time winning method  thanks in advance Boudewijn")*

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](https://hikashop.com/support/support/documentation/168-create-you-own-mass-action-plugin.html)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjExMjQtdW5wdWJsaXNoLXByb2R1Y3RzLXdpdGgtdmFyaWFudHMtd2l0aC16ZXJvLXN0b2NrP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Boudewijn](/forum/user/6864-boudewijn "View Boudewijn's Profile")**
- [![Boudewijn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6864.jpg)](/forum/user/6864-boudewijn "View Boudewijn's Profile") Topic Author
- [ Offline](/forum/user/6864-boudewijn)

Less More

- Posts: 252
- Thank you received: 3
-
-
-
- [](http://www.dodowear.nl)
-

12 years 6 months ago [\#158763](#158763) by [Boudewijn](/forum/user/6864-boudewijn "View Boudewijn's Profile")  Replied by *[Boudewijn](/forum/user/6864-boudewijn "View Boudewijn's Profile")* on topic *[unpublish products with variants with zero stock](/forum/37-import-export-csv-xls/861124-unpublish-products-with-variants-with-zero-stock?start=20#158763 "-- url of the page with the problem -- :   dodowear.nl  -- HikaShop version -- : 2.2 -- Joomla version -- : 2.5 -- PHP version -- : x.x.x -- Browser(s) name and version -- : Firefox -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  Hello, we work with products with variants As most of the products are seasonly (only delivered once) they need to be unpublished when sold out. So when all variant of a product have no stock anymore the parent product should become unactive. Up until now I do this manualy with import and export in excel or walking trough the website. But as you can understand this is a lot of work. So I was wondering if you could tell me a simplerer and more time winning method  thanks in advance Boudewijn")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjExMjQtdW5wdWJsaXNoLXByb2R1Y3RzLXdpdGgtdmFyaWFudHMtd2l0aC16ZXJvLXN0b2NrP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[river](/forum/user/9591-river "View river's Profile")**
- [![river's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar9591.gif)](/forum/user/9591-river "View river's Profile")
- [ Offline](/forum/user/9591-river)

Less More

- Posts: 344
- Thank you received: 3
-
-

10 years 1 month ago [\#253991](#253991) by [river](/forum/user/9591-river "View river's Profile")  Replied by *[river](/forum/user/9591-river "View river's Profile")* on topic *[unpublish products with variants with zero stock](/forum/37-import-export-csv-xls/861124-unpublish-products-with-variants-with-zero-stock?start=20#253991 "-- url of the page with the problem -- :   dodowear.nl  -- HikaShop version -- : 2.2 -- Joomla version -- : 2.5 -- PHP version -- : x.x.x -- Browser(s) name and version -- : Firefox -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  Hello, we work with products with variants As most of the products are seasonly (only delivered once) they need to be unpublished when sold out. So when all variant of a product have no stock anymore the parent product should become unactive. Up until now I do this manualy with import and export in excel or walking trough the website. But as you can understand this is a lot of work. So I was wondering if you could tell me a simplerer and more time winning method  thanks in advance Boudewijn")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjExMjQtdW5wdWJsaXNoLXByb2R1Y3RzLXdpdGgtdmFyaWFudHMtd2l0aC16ZXJvLXN0b2NrP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86593
- Thank you received: 14334
-
-

10 years 1 month ago [\#254014](#254014) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[unpublish products with variants with zero stock](/forum/37-import-export-csv-xls/861124-unpublish-products-with-variants-with-zero-stock?start=20#254014 "-- url of the page with the problem -- :   dodowear.nl  -- HikaShop version -- : 2.2 -- Joomla version -- : 2.5 -- PHP version -- : x.x.x -- Browser(s) name and version -- : Firefox -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  Hello, we work with products with variants As most of the products are seasonly (only delivered once) they need to be unpublished when sold out. So when all variant of a product have no stock anymore the parent product should become unactive. Up until now I do this manualy with import and export in excel or walking trough the website. But as you can understand this is a lot of work. So I was wondering if you could tell me a simplerer and more time winning method  thanks in advance Boudewijn")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjExMjQtdW5wdWJsaXNoLXByb2R1Y3RzLXdpdGgtdmFyaWFudHMtd2l0aC16ZXJvLXN0b2NrP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[river](/forum/user/9591-river "View river's Profile")**
- [![river's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar9591.gif)](/forum/user/9591-river "View river's Profile")
- [ Offline](/forum/user/9591-river)

Less More

- Posts: 344
- Thank you received: 3
-
-

10 years 1 month ago [\#254069](#254069) by [river](/forum/user/9591-river "View river's Profile")  Replied by *[river](/forum/user/9591-river "View river's Profile")* on topic *[unpublish products with variants with zero stock](/forum/37-import-export-csv-xls/861124-unpublish-products-with-variants-with-zero-stock?start=20#254069 "-- url of the page with the problem -- :   dodowear.nl  -- HikaShop version -- : 2.2 -- Joomla version -- : 2.5 -- PHP version -- : x.x.x -- Browser(s) name and version -- : Firefox -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  Hello, we work with products with variants As most of the products are seasonly (only delivered once) they need to be unpublished when sold out. So when all variant of a product have no stock anymore the parent product should become unactive. Up until now I do this manualy with import and export in excel or walking trough the website. But as you can understand this is a lot of work. So I was wondering if you could tell me a simplerer and more time winning method  thanks in advance Boudewijn")*

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.

[ ![screenshot-www.kvikki.no2016-10-3116-51-47.png](/forum/attachment/34336) ](/forum/attachment/34336 "...3116-51-47.png")

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

- [ ![screenshot-www.kvikki.no2016-10-3116-51-47.png](/forum/attachment/34336) ](/forum/attachment/34336 "...3116-51-47.png") [ ](/forum/attachment/34336?download=1 "...3116-51-47.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjExMjQtdW5wdWJsaXNoLXByb2R1Y3RzLXdpdGgtdmFyaWFudHMtd2l0aC16ZXJvLXN0b2NrP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Boudewijn](/forum/user/6864-boudewijn "View Boudewijn's Profile")**
- [![Boudewijn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6864.jpg)](/forum/user/6864-boudewijn "View Boudewijn's Profile") Topic Author
- [ Offline](/forum/user/6864-boudewijn)

Less More

- Posts: 252
- Thank you received: 3
-
-
-
- [](http://www.dodowear.nl)
-

10 years 1 month ago [\#254088](#254088) by [Boudewijn](/forum/user/6864-boudewijn "View Boudewijn's Profile")  Replied by *[Boudewijn](/forum/user/6864-boudewijn "View Boudewijn's Profile")* on topic *[unpublish products with variants with zero stock](/forum/37-import-export-csv-xls/861124-unpublish-products-with-variants-with-zero-stock?start=20#254088 "-- url of the page with the problem -- :   dodowear.nl  -- HikaShop version -- : 2.2 -- Joomla version -- : 2.5 -- PHP version -- : x.x.x -- Browser(s) name and version -- : Firefox -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  Hello, we work with products with variants As most of the products are seasonly (only delivered once) they need to be unpublished when sold out. So when all variant of a product have no stock anymore the parent product should become unactive. Up until now I do this manualy with import and export in excel or walking trough the website. But as you can understand this is a lot of work. So I was wondering if you could tell me a simplerer and more time winning method  thanks in advance Boudewijn")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjExMjQtdW5wdWJsaXNoLXByb2R1Y3RzLXdpdGgtdmFyaWFudHMtd2l0aC16ZXJvLXN0b2NrP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86593
- Thank you received: 14334
-
-

10 years 1 month ago [\#254072](#254072) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[unpublish products with variants with zero stock](/forum/37-import-export-csv-xls/861124-unpublish-products-with-variants-with-zero-stock?start=20#254072 "-- url of the page with the problem -- :   dodowear.nl  -- HikaShop version -- : 2.2 -- Joomla version -- : 2.5 -- PHP version -- : x.x.x -- Browser(s) name and version -- : Firefox -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  Hello, we work with products with variants As most of the products are seasonly (only delivered once) they need to be unpublished when sold out. So when all variant of a product have no stock anymore the parent product should become unactive. Up until now I do this manualy with import and export in excel or walking trough the website. But as you can understand this is a lot of work. So I was wondering if you could tell me a simplerer and more time winning method  thanks in advance Boudewijn")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy84NjExMjQtdW5wdWJsaXNoLXByb2R1Y3RzLXdpdGgtdmFyaWFudHMtd2l0aC16ZXJvLXN0b2NrP3N0YXJ0PTIwJnRtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.082 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
