I have a form in my PHP page which is created by a loop through an array.
echo \'
I solved the issue by doing the following.
The guys above here all got me on the right track and couldn't have done it without them!
Changed
To
Also changed
if (isset($_POST['add_to_chart']))
{
$product_id = $_POST['product_id'];
$size = $_POST['size'][0];
$qty = $_POST['amount'];
}
To this
if (isset($_POST['add_to_chart']))
{
// Array ID key
$key = key($_POST['size']);
$product_id = $_POST['product_id'];
$size = $_POST['size'][$key];
$qty = $_POST['amount'][$key];
}
Works like a charm! Thank you all for your very helpful comments!