Adding items to cart with a custom form
-
I have posted a form which will add items to a woocommerce cart. If I process the form in the template, it works fine but the cart doesn’t reflect the added items until I manually reload the page. Its too late to reload the page in the template, so I process the form and reload the page in an action:add_action( ‘wp_loaded’, ‘custom_process_form’ ); The correct number of items are added, but the cart displays the wrong item count. The number I actually added is doubled. If I reload the page manually, it shows the correct number. What is the correct way to do this? Am I using the wrong action?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Adding items to cart with a custom form’ is closed to new replies.