php - Unset array from multidimensional array -
These are my works i have a problem in removing and editing shopping cart
before I had only two criteria for just $ id and $ quantity, but I had to add $ version, which stores for instance size.
Insert $ _SESSION and the foreground ['carriage'] works like a magic, but as I said it was not removed and updated.
function addToCart () function removeFromCart () Thank you. > itemprop = "text">
public static function addToCart ($ data) {$ id = $ data ['id']; // id $ volume = $ data ['qty']; // volume $ version = $ data ['version']; // variant // ovą ?? A?, Ãme, zda $ _SESSION ['train]] if (! ($ _ Session [' train ']) ($$$ _ [ride] [' train '] = array ();} Array_push ($ _ session ['Cart'], array ('id' => ID, 'quantity' = & gt; $ quantity, 'version' = & gt; $ edition));} {/ code> < p> edit function ()
public static function editCart ($ data) {// edit volume + -}
$ id]);
Comments
Post a Comment