File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -419,7 +419,32 @@ public function getItem($row_id)
419419 ? false
420420 : $ this ->cartContents [ $ row_id ];
421421 }
422+
423+ // ------------------------------------------------------------------------
422424
425+ /**
426+ * Find cart item
427+ *
428+ * Returns the details of a specific item in the cart
429+ *
430+ * @param $key
431+ * @param $value
432+ * @return bool|mixed
433+ */
434+ public function find ($ key , $ value )
435+ {
436+ if ($ this ->totalItems () == 0 ){
437+ return false ;
438+ }else {
439+ foreach ($ this ->cartContents as $ row ){
440+ if (isset ($ row [$ key ]) && $ row [$ key ] == $ value ){
441+ return $ row ;
442+ }
443+ }
444+ return false ;
445+ }
446+ }
447+
423448 // ------------------------------------------------------------------------
424449
425450 /**
You can’t perform that action at this time.
0 commit comments