- Deprecated:
- 100.1.0
Definition at line 18 of file Sidebar.php.
◆ __construct()
- Parameters
-
Cart | $cart | |
HelperData | $helperData | |
ResolverInterface | $resolver | @codeCoverageIgnore |
Definition at line 46 of file Sidebar.php.
◆ checkQuoteItem()
checkQuoteItem |
( |
|
$itemId | ) |
|
Check if required quote item exist
- Parameters
-
- Exceptions
-
- Returns
- $this
Definition at line 84 of file Sidebar.php.
86 $item = $this->cart->getQuote()->getItemById($itemId);
87 if (!
$item instanceof CartItemInterface) {
88 throw new LocalizedException(
__(
"The quote item isn't found. Verify the item and try again."));
◆ getResponseData()
getResponseData |
( |
|
$error = '' | ) |
|
Compile response data
- Parameters
-
- Returns
- array
Definition at line 62 of file Sidebar.php.
71 'error_message' => $error,
◆ getSubtotalHtml()
Retrieve subtotal block html
- Returns
- string
Definition at line 166 of file Sidebar.php.
168 $totals = $this->cart->getQuote()->getTotals();
169 $subtotal = isset(
$totals[
'subtotal']) &&
$totals[
'subtotal'] instanceof Total
170 ?
$totals[
'subtotal']->getValue()
172 return $this->helperData->formatPrice($subtotal);
◆ getSummaryQty()
Retrieve summary qty
- Returns
- int
Definition at line 143 of file Sidebar.php.
145 if (!$this->summaryQty) {
146 $this->summaryQty = $this->cart->getSummaryQty();
◆ getSummaryText()
Retrieve summary qty text
- Returns
- string
Definition at line 156 of file Sidebar.php.
◆ normalize()
Apply normalization filter to item qty value
- Parameters
-
- Returns
- int|array
Definition at line 127 of file Sidebar.php.
130 $filter = new \Zend_Filter_LocalizedToNormalized(
131 [
'locale' => $this->resolver->getLocale()]
133 return $filter->filter($itemQty);
◆ removeQuoteItem()
removeQuoteItem |
( |
|
$itemId | ) |
|
Remove quote item
- Parameters
-
- Returns
- $this
Definition at line 99 of file Sidebar.php.
101 $this->cart->removeItem($itemId);
◆ updateQuoteItem()
updateQuoteItem |
( |
|
$itemId, |
|
|
|
$itemQty |
|
) |
| |
Update quote item
- Parameters
-
- Exceptions
-
- Returns
- $this
Definition at line 114 of file Sidebar.php.
116 $itemData = [$itemId => [
'qty' => $this->
normalize($itemQty)]];
117 $this->cart->updateItems($itemData)->save();
◆ $cart
◆ $helperData
◆ $resolver
◆ $summaryQty
The documentation for this class was generated from the following file: