Firstly i have created an partials at
themes/theme-name/_patials/cartBox/updateItem.php
and my Code:
<?php
if ($cart->count()) {
foreach ($cart->content()->reverse() as $cartItem) { ?>
<div class="updateItem">
<?php
if ($cartItem->qty > 0) { ?>
<span class="btn btn-sm rounded-pill btn-add"><a role="button" aria-label="remove-item" class="mr-1 cursor-pointer"><i class="fa fa-minus"></i></a> <a role="button" class="text-muted" aria-lable="item-qty"><?= $cartItem->qty; ?></a> <a role="button" aria-label="add-more-item" class="ml-1 cursor-pointer"
<?php if ($menuHasOptions) { ?>
data-cart-control="load-item"
data-menu-id="<?= $menuItem->menu_id; ?>"
data-quantity="<?= $menuItem->minimum_qty; ?>"
<?php } else { ?>
data-request="<?= $updateCartItemEventHandler; ?>"
data-request-data="menuId: '<?= $menuItem->menu_id; ?>', quantity: '<?= $menuItem->minimum_qty; ?>'"
data-replace-loading="fa fa-spinner fa-spin"
<?php } ?>
> <i class="fa fa-plus"></i></a> </span>
<?php } else { ?>
<button title="Add to Bag"
class="btn btn-sm rounded-pill btn-add btn-cart<?= $mealtimeNotAvailable ? ' disabled' : '' ?>"
<?php if (!$mealtimeNotAvailable) { ?>
cursor: pointer;
<?php if ($menuHasOptions) { ?>
data-cart-control="load-item"
data-menu-id="<?= $menuItem->menu_id; ?>"
data-quantity="<?= $menuItem->minimum_qty; ?>"
<?php } else { ?>
data-request="<?= $updateCartItemEventHandler; ?>"
data-request-data="menuId: '<?= $menuItem->menu_id; ?>', quantity: '<?= $menuItem->minimum_qty; ?>'"
data-replace-loading="fa fa-spinner fa-spin"
<?php } ?>
<?php } else { ?>
title="<?= implode("\r\n", $mealtimeTitles); ?>"
<?php } ?>
>
<i class="fa fa-<?= $mealtimeNotAvailable ? 'clock-o' : 'plus' ?>"></i> ADD
</button>
<?php } ?>
</div>
<?php
}
}
?>
and added a parameter at
extension/igniter/cart/component/CartBox.php
within
public function fetchPartials() {
$this->prepareVars();
return [
........
'.updateItem' => $this->renderPartial('@updateItem')
}
}
next try to call the partial in the place of button (add to cart) at
/theme/_partials/localMenu/item.php.
<?= partial('cartBox::updateItem');?>
that is throwing exception:
The partial [::item] is not found. (View: /themes/my-theme/partials/localMenu/items.php) (View: /themes/my-theme/partials/localMenu/grouped.php) (View: /themes/my-theme/partials/localMenu/default.php) (View: /themes/fresh-fruits/pages/local/menus.php)