unpublish products with variants with zero stock

  • Posts: 252
  • Thank you received: 3
11 years 3 months ago #119018

-- 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_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

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
11 years 3 months ago #119042

Hi,

I think you can use the mass action
www.hikashop.com/support/documentation/167-massaction-form.html

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 252
  • Thank you received: 3
11 years 3 months ago #119405

Hello Jerome,
It looks like the massaction can help me on this, but I want to be sure if it's working the way I would like.
After reading your documentary on this I have created the your example on out-of-stock.
But now I would like to test it. And I'm bit afraid that the product will be massed up.

In the product database the parent-product are all 0, the stock is on the variant.
Should this batch working correctly. So, move product which have no stock anymore on the variant to a category called out-of-stock.
And is there a way to test this. Something like a report or it shows me the products which will be moved.

I hope the everything is explained it correctly.
If this works this is a very powerfull tool.

Regards

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
11 years 3 months ago #119411

Hi,

To show which products will be changed, you can remove your action and instead use the action "display the results".
That will display you a list of the elements filtered.
Note that you probably want to have a filter on the product_type column equal to "variant" so that only variants get affected by the modification if that's what you want.

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

  • Posts: 252
  • Thank you received: 3
11 years 2 months ago #122315

Hello,
previously I mentioned that I get a script error on Massaction.
In the attached file you'll a picture of this message

Attachments:

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
11 years 2 months ago #122576

Hi,

A problem with my sweety otree library ?
How many categories do you have ?

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 252
  • Thank you received: 3
10 years 11 months ago #137367

Hi,
Last days I have been playing a bit with the massaction tool.
I did some queries. And in chrome it works fine instead of firefox.
Still I would like to get a hint.
What I have created as a report now shows me all variants with 0-stock.
I selected to show on screen. So manualy I can unpublish the product.
But I actualy need to unplubish the parent-product.
How can I manage that?
So summarized: the massaction needs to show all parentproducts where all variants have no stock (=0).
This would help me a lot

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
10 years 11 months ago #137378

Hi,
Then that's quite easy. Simply enter the total stock in your main products and the system will adjust the total stock when the variants are bought. Then, you can just have a filter on the product_quantity for main products in your mass action.

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

  • Posts: 252
  • Thank you received: 3
10 years 11 months ago #137476

Hi Nicolas,
Yes I would say also that is simple but all my main product are on 0 or -1 stock.
Then I first need to update the stock of the main product.
Can I do this also in massaction?

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

  • Posts: 12953
  • Thank you received: 1778
10 years 11 months ago #137549

Hi,
Sure, you'll just have to add an "Update values" action and apply it on the "product_quantity" field.

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

  • Posts: 252
  • Thank you received: 3
10 years 11 months ago #137566

Hi,
Can you be a bit more specific
Where can I select the option update values?

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

  • Posts: 12953
  • Thank you received: 1778
10 years 11 months ago #137580

By creating a new mass action, and using the options under the "actions" tab, for example you can update every quantity field of your products to 10000 like this :

Attachments:

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

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

Hello,
After I have read through the different steps and process I'm not completly convident on the different actions.
I will try to explain.
Nicolas suggested that all parent product should have the total stock of all variants.
Which is not the case in our database.
So you optained to give those product stock by another mass-action.
But then I can only give those product a hard quantity.
For instance 10.
But the when I do a massaction to show all products where the variant has zero stock I don't think that all correct information is there
Perhaps I see wrong
I would expect to see
product_parent_id product_code product_quantity product_published
01234 0 1
01234 01 0 1
01234 02 0 1
And if that's the information: unplublish the parent product

I hope you can tell me how to do so

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

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

Hi,

Actually you cannot get the total quantity of each variants of a product to change the product quantity.
This is something that you should do before.

To do what you need, I think that you will have to create your own plugin based on the massactions.
A plugin which will get the quantity of each variants of a product, and if this quantity is 0 then unpublish the product.

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

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

Hello Xavier,
That is exactly what I would like to have.
But I am not that skilled to program
Who can help me on this?

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

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

Hi,

I think that the best thing is to post a request on the commercial jobs section of this forum.
This require some development and we are not able to provide this kind of codes on the forum.

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

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

Hello Xavier,
Thanks for your reply.
I gonna manage it through my POS system in the store.
There is already a connection between them for my stock.
and pricing.
But it would be nice to have build in something like that in the future

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

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

Hi,

I have added it on our TODO list :)

The following user(s) said Thank You: Boudewijn

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

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

Hello Xavier,
Yesterday I noticed that you have published the new version of hika shop.
In the changlog there was something written on the mass action with variants.
Is it possible to do this query now.
And if so, can you tell me.

Thanks so far

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

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

Hello Xavier,
Perhaps you missed my latest reply.
When you have time you can take a look at it

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

Time to create page: 0.124 seconds
Powered by Kunena Forum