File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -508,6 +508,22 @@ public function clearCartConditions()
508508 );
509509 }
510510
511+ /**
512+ * get cart sub total without conditions
513+ * @param bool $formatted
514+ * @return float
515+ */
516+ public function getSubTotalWithoutConditions ($ formatted = true )
517+ {
518+ $ cart = $ this ->getContent ();
519+
520+ $ sum = $ cart ->sum (function ($ item ) {
521+ return $ item ->getPriceSum ();
522+ });
523+
524+ return Helpers::formatValue (floatval ($ sum ), $ formatted , $ this ->config );
525+ }
526+
511527 /**
512528 * get cart sub total
513529 * @param bool $formatted
Original file line number Diff line number Diff line change @@ -66,6 +66,17 @@ public function hasConditions()
6666 return false ;
6767 }
6868
69+ /**
70+ * check if item has conditions
71+ *
72+ * @return mixed|null
73+ */
74+ public function getConditions ()
75+ {
76+ if (! $ this ->hasConditions () ) return [];
77+ return $ this ['conditions ' ];
78+ }
79+
6980 /**
7081 * get the single price in which conditions are already applied
7182 * @param bool $formatted
You can’t perform that action at this time.
0 commit comments