Jump to content

Fix Digital Product Stock Level


Recommended Posts

Welcome Jen29! Glad to see you made it to the forums.

Currently, CubeCart is not coded to do this. That is, a digital item cannot be restricted by stock levels.

But we can probably develop a code snippet to override this.

Please let us know if you are running a specific version of CubeCart, or if we can plan for the latest version.

My initial reply was probably for CubeCart many versions ago.

Edited by bsmither
Link to comment
Share on other sites

There is a very simple edit to show actual stock levels on digital items when viewing the Product Inventory list.

Also, experiments with my installation of CC618 will restrict purchases of digital items to the actual stock level - provided that, in admin:

Store Settings, Stock tab: "Allow out-of-stock purchases" is unchecked, and "Reduce stock levels" is set to Pending (probably the better of the three settings).

Add/Edit a digital product, General tab: "Use Stock Level" is checked, and there is a numeric value for Stock Level.

Here is the code edit:

Using a programmer's text editor, in the file /admin/sources/products.index.inc.php, near line 1180:


if ($result['use_stock_level'] == 0 || $result['digital'] > 0 || !empty($result['digital_path'])) {
	$result['stock_level'] = "∞";


if ($result['use_stock_level'] == 0 || $result['digital'] > 0 || !empty($result['digital_path'])) {
//	$result['stock_level'] = "∞";


Link to comment
Share on other sites

  • 3 months later...

Join the conversation

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

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.


  • Create New...