Hi!
Notice: Undefined index: engraving in /path/httpdocs/store/cart.php on line 13 error
This usually happens when you try to access an array index key that does not exists, for example:
$a = array(
'apple' => 'fuji',
'orange' => 'vanilla'
);
echo $a['apple'];
echo $a['coconut']; # will emit a notice because 'coconut' index does not exists
Now, it seems that your issue is in this line:
$engraving = $_POST['engraving'];
But I see in section 5 you print the $engraving
variable apparently without defining it anywhere. It is defined only when a POST request is executed, but if you access the cart with a GET request then you should get a notice for undefined variable: engraving
. So check if this is related to the cart saved in the session array. Do:
<?php
echo "<pre>" . print_r($_SESSION['cart'], true) . "</pre>";
To get the contents, then if it does not help print the results and the code in which you define the variable.