Browser: Chrome 110 OS: macOS / Windows / Linux / etc. URL: Link to a page that illustrates this issue Video: Short screen recording that illustrates this issue (free tool: jam.dev)
[Please describe this bug in as much detail as possible so we can replicate & debug this bug]
Im using the Woocommerce Single Product Template from Bricks and the following elements:
For a variable products there is no “stock status” notice for the variations from the product stock element just an out of sock notice and the amount via the add to cart element ( we use german market to add the needed additional price data ):
For variable products, we found out, then when we add a stock to the “parent / main product” a stock status will be displayed, but only from the main product which is pretty bad because when a variation is running a low stock - it should display that variation status - it does display out of stock correctly though.
We use the add to cart and product stock elements.
We would like to display the same data for both product types. Sadly the Price element is not working for variations either as it only shows a range and is not updated to the correct variation price on a variation select.
1) Variable Products stock status
I can’t reproduce the problem - as soon as I select a variation (this is the default behavior), the correct stock status is displayed. By the way, in your screenshot I see “2 in stock”, so I don’t understand exactly what the problem is.
2) Simple Product Price
That’s because the product price element is missing.
I don’t know exactly what influence german market has on your report, but you could alternatively switch to a standard theme like TwentyTwentyThree or TwentyTwentyFour and see if it behaves differently there.
i mean the “auf lager / in stock” wording - for variations its either the exact amount or not available if its 0 - but i would like to show - in stock - low stock or not available and no exact number, which i can on a simple product with product stock element but not with add to cart element which i need for variation
will check with other theme to make sure, we have been using impreza on other pages and didnt had any issues there with german market but will make sure to check later and provide feedback.
But to make sure for a simple product i need to add the price element, its not getting the price from the add to cart element if it is no variation ?
That’s correct. The product price element shows the price for simple products and the range for variable products. As soon as you choose a variation, the variation price shows within the add to cart element.
just to clarify - this behaviour should not happen - the product price element should be auto hidden on the frontend when the product is variable by bricks
elements are: product price + add to cart element and the product is variable
If this is not intended its either a bug or a conflict with german market and i will check with them first, as they hook into the woocommerce price and add the relevant data and they said it should be compatible with any theme that is using the woocommerce templates themselves. The strange thing here aswell is, that the price from the add to cart variation get the correct german market data added, but the product price element does not. Neither for simple nor for variable products
2nd thing regarding the stock - this is what i mean:
in the product stock element there is the option to display a low stock wording, which is not available in the add to cart. And the product stock element does not render on the front end for variable products.
But both do render for a simple product, where i guess the part from the add to cart element should be hidden so its not duplicate ( if i dont add the low stock wording they would both show “5 vorrätig” )
As far as I can see that’s the default behavior of WooCommerce, so we stick to it.
Right, but it shows above the add to cart, because it depends on the variation, not the product in general. This is again the default behavior, as you can see here with the 2024 default theme: CleanShot 2023-12-20 at 10.32.26 · CleanShot Cloud
Thank you for ur time on this matter
I think we missunderstood each other a bit here.
Ok so for the price everything is like it should then sorry for my confusion. I have to check with german market then, why its not adding the correct data for the price and as i don’t want the “product price element” to show any data when a variation is selected but need the german market data for simple products
Regarding the stock:
I understand that it should not show any stock, when no variation is selected.
What i mean is the following behaviour / data:
This is what i would like to have for simple and variable products
I would like to show a “in stock, low stock or out of stock” msg but not the actual stock number.
The low stock / out of stock msg is possible with the bricks stock element - but this element is only shown for simple products - not variable. ( my idea was to use this element for both types and adjust it / add the in stock message )
The stock / hide stock tab in add to cart is shown in simple products AND on variations.
So if i keep both active i will have for example on simple products:
low stock ( stock element )
2 in stock ( add to cart element )
and for variable products:
2 in stock ( add to cart element )
or if its out of stock for simple products:
out of stock ( stock element )
out of stock ( add to cart element )
variable
out of stock ( add to cart element )
screenshots: ( using the same template for both products element order: product price, product stock, add to cart ) - i have deactivated german market aswell to make sure theres no conflict:
simple - bricks:
So i struggle to understand what i have to do in order to show just 1 time out of stock or low stock for simple products.
Do i have to modify the bricks add to cart element / the woo template it uses to show the no / low / in stock texts i would like to have for both product types?
Or would it be better to just hide the stock info on the add to cart bricks element and adjust the product stock element to show data for variable products aswell.
Either way i still think the duplicate out of stock for a simple product should not happen when using both elements as its not the default woo behaviour?
I wouldn’t deny that, because the whole WooCommerce “stock” topic is relatively complicated, as there are different types of stock management and it also behaves differently depending on the product type
You could hide the price range for variable products in general:
For simple products, your custom message would be displayed above the Add to cart, for variable products the exact quantity would be displayed after you have selected a variation. The custom messages for variable products only work if you manage the stock on the product - not on the variation. To do this, you would have to use a custom function that adds up the number of variations and then displays the corresponding message.
Well, WooCommerce does not allow you to place things freely, but only displays them in their default place.
Ok so i have to find some custom solution then and either modify the woo add to cart part or hide the stock and find some other way to display this for simple & variations
For simple products, your custom message would be displayed above the Add to cart, for variable products the exact quantity would be displayed after you have selected a variation. The custom messages for variable products only work if you manage the stock on the product - not on the variation. To do this, you would have to use a custom function that adds up the number of variations and then displays the corresponding message.
I dont want to show the total sum stock for all variations, i would like to really just show the in / low / out stock msg for each individual variation and for simple products.
I’ll figure it out now that i know exactly where to look thx