A few things here:
Your opening tag is only <? instead of <?php
Magento recommends against injecting sessions into your constructors
You should not make a session available in a template. Whatever you need from the session should be wrapped up in block logic
Magento provides a cart helper class which provides both cart and quote. Rather than accessing ...
Use sales_quote_item_qty_set_after which will fire when Qty is update.
$this->_eventManager->dispatch('sales_quote_item_qty_set_after', ['item' => $this]);
I guess that you want to update cart item price.
sales_quote_item_qty_set_after event provide quote item as it parameter.So you don't need to inject cart object $this->cart here. Also, ...
By default, Magento 2 in API side does not provide any API for Merge guest cart with customer card when the customer is login.
But you can replace the guest cart with customer cart.
API : (/V1/carts/:cartId)
File : vendor/magento/module-quote/Model/QuoteManagement.php
Function : public function assignCustomer($cartId, $customerId, $storeId)
But if you ...
You need cart helper for this.
add this code
public function __construct(
$this->cartHelper = $cartHelper;
After this you can get items and product prices from this code:
Before your loop you can get product prices against items
The quote is set into super mode in
Essentially it is a flag on the quote that this quote has been created by an admin. The effect of this is in the locations you stated that an admin can for example create an order for an item that normally would be out of ...