i made new page on my site that people choose PC part to buy..
My case is how to create a button for add all product choosen to cart then redirect to the cart pages.
Select list HTML Code
<div><select id="ddrakit-processor" class="ddrakit"><option value='{"gaming":"0","render":"0","priceperform":"0"}'>- Pilih processor -</option><option value='{"product_id":9,"category_id":17,"harga":"100000000","gaming":"20","render":"10","priceperform":"20"}'>Intel i99 - Rp. 100,000,000,-</option></select></div>
<div><select id="ddrakit-motheboard" class="ddrakit"><option value='{"gaming":"0","render":"0","priceperform":"0"}'>- Pilih motherboard -</option><option value='{"product_id":11,"category_id":20,"harga":"80000","gaming":"40","render":"50","priceperform":"10"}'>ASUS ROG Z999 - Rp. 80,000,-</option></select></div>
<div><select id="ddrakit-ram" class="ddrakit"><option value='{"gaming":"0","render":"0","priceperform":"0"}'>- Pilih memory RAM -</option><option value='{"product_id":10,"category_id":19,"harga":"500000","gaming":"40","render":"10","priceperform":"20"}'>V-GEN 128GB DDR8 - Rp. 500,000,-</option></select></div>
<div><select id="ddrakit-vga" class="ddrakit"><option value='{"gaming":"0","render":"0","priceperform":"0"}'>- Pilih graphic card -</option><option value='{"product_id":8,"category_id":16,"harga":"2000000","gaming":"10","render":"20","priceperform":"10"}'>RADEON RX 999 - Rp. 2,000,000,-</option><option value='{"product_id":16,"category_id":16,"harga":"16499000","gaming":"20","render":"10","priceperform":"20"}'>MSI - GeForce GTX 1080 Ti Gaming X Trio - Rp. 16,499,000,-</option></select></div>
<div><select id="ddrakit-psu" class="ddrakit"><option value='{"gaming":"0","render":"0","priceperform":"0"}'>- Pilih power supply -</option><option value='{"product_id":17,"category_id":22,"harga":"50000","gaming":"10","render":"50","priceperform":"10"}'>Corsair RM8000 8000w - Rp. 50,000,-</option></select></div>
<div><select id="ddrakit-casing" class="ddrakit"><option value='{"gaming":"0","render":"0","priceperform":"0"}'>- Pilih Casing -</option><option value='{"product_id":12,"category_id":21,"harga":"5020000","gaming":"10","render":"10","priceperform":"10"}'>Corsair Casing Gaming - Rp. 5,020,000,-</option></select></div>
Thank you.
Use this link in your custom page
<a href="?add-to-cart=<?php echo $loop->post->ID; ?>" rel="nofollow" data-product-id="<?php echo $loop->post->ID; ?>" class="btn btn-primary">Add to cart</a>
Are you saying a form? I'd use a backend server to handle the form and do the redirect to the checkout page and whatnot. Submitting form is what you should use and it's straightforward to implement.