Jump to content

Stock levels not working for products with options


shopmaker
 Share

Recommended Posts

Cubecart version 6.2.4
PHP version 7.2.31

I have an issue with my store. I've just discovered that for products with options the stock levels are being ignored and a customer can enter any quantity and purchase them. For products without options the stock level is being respected and an over-quantity order is correctly limited to whatever the stock level is. 

On the options pages I have checked "Use stock level" next to the relevant options in the matrx, with the stock level entered there too.

I'm not sure if this is relevant, but I'm also getting the following error recurring in the error_log: 
 

[20-Jun-2020 15:45:39 UTC] PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /home/tvcommco/public_html/store/classes/db/database.class.php on line 692
[20-Jun-2020 15:45:46 UTC] PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /home/tvcommco/public_html/store/classes/db/database.class.php on line 692
[20-Jun-2020 15:47:08 UTC] PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /home/tvcommco/public_html/store/classes/db/database.class.php on line 692

Any help gratefully received! 

Thank you,

Andy.

PS. I can edit PHP but I have no clue how it works 😉

Edited by shopmaker
Link to comment
Share on other sites

I am not able to replicate this* - a zero-level stock on a specific option combination as specified in the Options Matrix table - cannot be added to the shopping basket.

Comparing the code between CC624 and CC629 shows only this issue (*the edits covered which I have implemented) that may have an effect:
https://github.com/cubecart/v6/issues/2490

specifically catalogue.class.php, near line 1373.

These edits will show up in CC6210.

Continuing to look.

Edited by bsmither
Link to comment
Share on other sites

Please verify that in admin, Editing the Product, General tab, "Use Stock Level" is checked.

It seems that honoring the Options Matrix table's "Use Stock Level" setting for each option combination is ignored if the main "Use Stock Level" is not checked.

(But you would think it is because there is an enforcement being tested.)

Edited by bsmither
Link to comment
Share on other sites

Ahh, thank you so much. I must have turned off the "master" stock level check box at some point and it's propagated through the listings. 

Regarding the PHP error, I'm sorry but I don't understand the fix that is required from the forum posts you linked to.

Andy. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...