-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stock displayed for an attribute option isn't updated correctly on the product page #1
Comments
Thanks @nattywebdev -- I'm not currently using this module on any sites so I'm going to have to rely on you to do some lifting. Any Javascript errors in the console, or information that may be relevant in the watchdog log or PHP log? It's also possible that the JS that comes with this module doesn't account for attributes/options being changed on the fly, in which case the JS needs improvement. Have you checked the D7 queue for this module? |
@laryn will do. I'll report back here. |
This issue on the D7 queue describes the same problem: although that refers to when the stock reaches zero. In my case I see that but also the stock not being correctly displayed for the first attribute option after the second one has been selected and you then revert back to the first. There is a supplied patch, which I've manually applied to the uc_out_of_stock.js file in the Backdrop module, but it appears not to fix the problem. I see no difference in the behaviour after making the changes. The patch is here: @laryn might you be able to take a quick look at that to see if there needs to be other changes (I'm thinking Backdrop-specific) that I'm not seeing? I'll also add my modified uc_out_of_stock.js file as an attachment. Oh I see I can't do that, so I'll add the code here below.
|
@nattywebdev Could you submit that patched file as a PR? It would be easier to spot check that way. |
I will if I can find out how. Is there a step-by-step guide I can follow? |
@nattywebdev Good job, looks like the PR was created correctly. Now we can compare to the patch more easily. The way I see it, we should:
In spot checking the patch vs. your PR, it looks like they've added this line way at the top of the file, above everything else: |
I'm not able to do any more, so when you say 'we' I hope you mean 'you'! I've looked through the code but I can't really see how it works, never mind why it's failing. |
[transferred from https://github.com/backdrop-contrib/ubercart/issues/521 once I realised this was more relevant here]
I'm working on a new site with a large number of products (around 3000) - currently it's a live D7 Commerce site that I am rebuilding with Backdrop and Ubercart.
A key issue for my client is stock, which us a product variation level in D7. I'm rebuilding the product collection with attributes and options to replace variations and stock per option is needed.
I have found that the stock quantity displayed on the add to cart form isn't displayed correctly when you switch from one option to another.
I assume this is a bug so am reporting it here - unless I'm doing something wrong (if so I'd appreciate guidance!).
Images below show the relevant detail.
Test product default (on page load) - shows 'in stock' before any option selected:
Test product with 'Fat Quarter' selected - stock should be 9 (9 is correctly displayed):
Test product with 'Fat Eighth' selected - stock should be 5 (9 is incorrectly displayed):
Stock displayed from editing node:
The text was updated successfully, but these errors were encountered: