Did you search 'round here?
There's lots of info on this subject. A brief overview:
Display the items. When a user clicks "buy", pass data about the item clicked via a form or the URL to a cart script.
The best cart script plan is to use sessions...so:
session_start();
$newitem=array($item_num, $manf, $size, $color, $price);
$_SESSION['cart'][]=$item;
So, now you have an array in $_SESSION['cart'][0] that contains all the information about the first T-shirt...and then they buy another?? So we hope....
😉