Jump to content

Selling into the negatives


bbtil

Recommended Posts

Hi, I've recently run into an issue where I set the product options matrix to a certain amount and the shopping cart is allowing items to be sold into the negatives. The option that says allow out of stock purchases is not selected. Any suggestions?

Link to comment
Share on other sites

Just to clarify: You are saying the store will allow a customer to add a 'zero or negative stock level' product to the basket, proceed through checkout, and pay for that item? Or you are saying that the store "implies" one can Add to Basket a 'zero or negative stock level' product to the basket?

If this is just the Add to Basket button indicator, then there have been issues when that product has an Options Matrix. The current version of the Foundation skin makes an AJAX call to CubeCart verifying the stock level of the "just now" chosen combination of options. Only then is the stock level revealed for that combination.

Link to comment
Share on other sites

I see this as a problem with the core code. The skin does not determine if an out-of-stock item can or cannot be sold. The skin only displays what CubeCart tells it to display.

Please verify the exact version of CubeCart you are using, and whether there are any plugin modules or code snippets in use. (Not gateways or shipping modules.)

Link to comment
Share on other sites

There are several places where CubeCart checks for stock levels throughout the shopping experience. All "should" check for the enabled/disabled state of the store setting "Allow out of stock purchases".

Let's try this:

In admin, Store Settings, Layout tab, "Allow users to change front-end skin", set to Yes (Logged in admins only). On the Stock tab, "Show stock levels", check to enable, and "Main stock level as matrix stock level summary", check to enable.

Using a programmer's text editor, make an edit to /skins/foundation/templates/main.php by adding {debug} at the very end.

On the storefront, you should now see a drop-down selector at the bottom-right. Choose Foundation. Your browser will want to throw a popup. Let it. (You may need to dismiss this popup and refresh the page to get a fresh popup.) This the template engine debug console. Visit a product page that you know has zero or negative stock

Scroll to where $CONFIG is in the left pane. Then look for 'stock_level' (should be "1") and 'basket_out_of_stock_purchase' (should be "0") keys in the right pane.

Then scroll to almost the bottom and find $PRODUCT in the left pane. Then find 'stock_level' (will show quantity available) and 'use_stock_level' (should be "1") in the right pane.

Do all these settings agree?

Link to comment
Share on other sites

That might be ok, as each Option Matrix combo has a "Use Stock Level" checkbox. This key/value is not given to the skin.

In the latest version sof Foundation, an AJAX request is made and the result contains the stock level.

However, there is always a check on stock levels whether at the main product level, or, if an option matrix combo exists, at that level.

I do not recall any other reports of this happening.

You say you found $product in the left pane. When viewing a product page, it should be $PRODUCT. Please verify.

In admin, bring the product up for editing where you said $products 'use_stock_level' was at 0. On the General tab, note whether Use Stock Level is disabled. This would agree with what you found in the debug console.

Check the box and Save.

Try to replicate purchasing an out-of-stock item.

Link to comment
Share on other sites

This is the product we're having the issue with https://shocktechusa.com/45-grip-grames/gunfighter.html

There is supposed to be a black and clear option but both have different quantities available.

if I have some of one and none of the other it still shows both options and allows the other to be purchased. on the top level product page it won't let me uncheck the stock levels and it shows only one amount for the two products.

Link to comment
Share on other sites

Which options are combined in the Options Matrix table? I understand you have Finish, but are the other two included in the table? Is the Finish option(s) loaded from a Set?

And, no, generally CubeCart does not, at this point, indicate which options are in/out of stock.

However, this plugin (https://www.cubecart.com/extensions/plugins/absolute-matrix-option-prices-price-list-hide-out-of-stock-matrix-options) puts the Options Matrix table on the View Product page and enforces in/out of stock purchasing capability.

 

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.

×
×
  • Create New...