In magento 1 my code is,


How can I change this piece of code in magento 2?

I know I would need to do something like this:

However, what would be ('adminhtml/session_quote') in magento 2?

Please can anyone help?


You can use in Magento 2 similar to Magento 1 by below way,


use in class like below way,

public function __construct(
    \Magento\Backend\Model\Session\Quote $sessionQuote
) {
    $this->sessionQuote = $sessionQuote;

Use like below way after use above,


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.