Closed ralucaStan closed 2 years ago
Can confirm this happens when using the Block Template. When using the Core PHP template this works as expected. Going to investigate further.
This is occurring because the code that enqueues the required script is running before the code that registers the required script.
This is only an issue for block templates because we are getting the block template html by running get_the_block_template_html
which enqueues the required scripts, before we run wp_head()
, which registers the required scripts here. Resulting in a scenario where we are trying to enqueue scripts before they are registered, meaning they don't get included on the frontend.
Prerequisites (mark completed items with an [x]):
Describe the bug Adding a variable product to cart on the Twenty Twenty-Two theme fails.
Expected behavior On the product page, when the user selects the variations and clicks
Add to cart
the product should be added to the cartActual behavior On the product page, when the user selects the variations and clicks
Add to cart
he sees a warningPlease choose product options...
although the options were chosenSteps to reproduce the bug (We need to be able to reproduce the bug in order to fix it.) Steps to reproduce the bug:
Add to cart
Please choose product options by visiting V-Neck T-Shirt
Screenshots If applicable, add screenshots to help explain your problem.
Isolating the problem (mark completed items with an [x]):
WordPress Environment We use the WooCommerce System Status Report to help us evaluate the issue. Without this report we won't be able to fully evaluate this issue.