bigcommerce / cornerstone

The BigCommerce Cornerstone theme
https://developer.bigcommerce.com/stencil-docs
286 stars 606 forks source link

Product Pick List Stock Issues #1951

Open rowleyaj opened 3 years ago

rowleyaj commented 3 years ago

A customer reported an issue in our storefront yesterday where they were unable to purchase as the only option available was add to wishlist. After some investigation I found that this is due to product pick list items being out of stock on the item in question. I spoke with support earlier and I believe this issue has been reported as BCTHEME-384. I'm unable to see what information this ticket holds so can't contribute a fix - hence the GitHub issue.

We've manually disabled these products for the moment to avoid customer confusion but would really appreciate a prompt resolution.

Expected behavior

Products that use product pick lists in options previously displayed a grey out of stock message when one of the product options had no available stock, their stock status also wasn't known on category pages. This was different behaviour to normal out of stock items which display as out of stock on category pages and display a red message showing out of stock on product pages. Add to cart button was visible but disabled once product options JS ran.

Actual behavior

Products that use product pick lists in options now do not show a message when pick list items are out of stock. The add to cart button is missing entirely.

Steps to reproduce behavior

Create two products. One will be the "kit" product, one will be the "component" product. Add a product pick list option to the kit product and choose the component product as the only option. Mark the component product as out of stock, and observe the behaviour of the kit product page.

fthobe commented 3 years ago

Hi @rowleyaj , FYI: this issue is open for years now.

this problem is part of a group of issues related to the correct interpretation of stock related to variants and options on BC. Unfortunatly picklist options, even when out of stock will always be interpreted as In Stock as much as the core product.

My eyes wander towards @bookernath that has generously promised to look into #1756 and provide and outlook this week.

rowleyaj commented 3 years ago

Hey @fthobe thanks for the info. I definitely agree with the other issue that the options don't correctly set the stock for the main product. This is slightly different though as I think it's a recent change.

I'm pretty certain that the add to cart button used to be there, but greyed out. I'm 100% that there used to be a message in a grey box when options were out of stock but the main product wasn't. This is what I think has changed recently.

Perhaps whilst fixing the other issue :/ I'd love to get on a call with folks who are actually fixing this and work through the test cases.

bc-jz commented 3 years ago

@rowleyaj Thank you for the report and sorry about the troubles you have seen. I want to get some more details about this issue and work to get you a resolution.

To start, I am pretty sure what you are seeing is due to an update to make the product.can_purchase property reflect the in stock state for products with variants. This change has exposed a problem in the cornerstone theme (and those based on cornerstone) where the add to cart button only prints if can_purchase is true on the initial page load.

That being said I tried to reproduce your error and saw some mixed results. When I followed your reproduction steps exactly (product with a pick list that has a single out of stock product) I did get the can_purchase value of false and the missing add to cart. However when I added another in stock product to the pick list option (now 2 products) then the add to cart was not hidden (can_purchase = true). I also confirmed that if the option is not required then the add to cart will not be hidden even if the pick list only has the one out of stock product.

Can you clarify a couple details on your actual products seeing issues? I am certain they are more complicated than your replication steps:

There is a new cornerstone release coming that will ensure the add to cart button will always be printed and merely hidden or grayed out for an unpurchasable initial state. While waiting for that you could address the existing issue with a small theme change, by disabling your default option selections on these products, or by choosing in stock defaults.

Let me know if you have any questions and sorry again that these problems emerged. I'm confident we can find a setup that will work for your products.

rowleyaj commented 3 years ago

Hi @bc-jz, thanks for the detailed reply. Sorry for the delay in getting back to you. I think I'll need to try the latest cornerstone as our add to cart button is still missing, but we've had an update on the support ticket saying that part has been fixed.

This change has exposed a problem in the cornerstone theme (and those based on cornerstone) where the add to cart button only prints if can_purchase is true on the initial page load.

This is the part that has been fixed with the latest cornerstone - if so I need to update I think. I just need to port our changes as we have some custom pages.

Are you tracking inventory on the "kit" product? Either on the variant or product level?

We don't track inventory on the kit product itself, only the individual products that are used to make up the kit. There is one exception in this when we find a kit has missing component products. We have to enable inventory tracking on the kit and mark it as out of stock so that it gets sent to our data feeds for facebook/google ads etc. It's not ideal but the only way I could think to correct mark them as out of stock for feeds.

Are you making variants from the product pick list option choices or are these "modifier options" (meaning options not connected to a variant)?

We use modifier options. In our theme we then hide these entirely.

by disabling your default option selections on these products, or by choosing in stock defaults.

To provide a little more context to how we use pick list product options. One kit product is made up of say 5 products. It's effectively a pre-determined bundle. Our theme uses a custom page to hide the choices by turning them to hidden options. They only ever have one option in each pick list which is the default chosen option and it's required for the kit to be complete. This is the only way we found we were able to list products for sale individually and track stock when they were also sold in kits. We make the kits on demand so the product can either be sold alone or in the kit but once we're out of stock it effects both.

Side note I'd love to be able to use predetermined variants in the product option. i.e we have one component product with multiple variants, and it's a specific variant that is used in the kit product. At the moment we have say 20 component products that should actually be variants but can't be due to how this bundling/kitting functionality works with inventory.