How to get session variable value in payment page?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
1
down vote

favorite












How to get session variable value from shipping page to payment page ?



enter image description here



enter image description here










share|improve this question























  • What you want to get from session variable?
    – Rohan Hapani
    2 hours ago











  • If we select length value in shipping page its length must be displayed under shipping method in payment page as i uploaded both image Rohan Hapani
    – trilok kumar
    2 hours ago










  • can you please update code which you have use for set the value
    – Rakesh Varma
    1 hour ago










  • protected $_checkoutSession; public function __construct( ........ MagentoCheckoutModelSession $checkoutSession, ........ ) ........ $this->_checkoutSession = $checkoutSession; ........ public function getCheckoutSession() return $this->_checkoutSession; this i used but its not working for me Rakesh Varma
    – trilok kumar
    1 hour ago
















up vote
1
down vote

favorite












How to get session variable value from shipping page to payment page ?



enter image description here



enter image description here










share|improve this question























  • What you want to get from session variable?
    – Rohan Hapani
    2 hours ago











  • If we select length value in shipping page its length must be displayed under shipping method in payment page as i uploaded both image Rohan Hapani
    – trilok kumar
    2 hours ago










  • can you please update code which you have use for set the value
    – Rakesh Varma
    1 hour ago










  • protected $_checkoutSession; public function __construct( ........ MagentoCheckoutModelSession $checkoutSession, ........ ) ........ $this->_checkoutSession = $checkoutSession; ........ public function getCheckoutSession() return $this->_checkoutSession; this i used but its not working for me Rakesh Varma
    – trilok kumar
    1 hour ago












up vote
1
down vote

favorite









up vote
1
down vote

favorite











How to get session variable value from shipping page to payment page ?



enter image description here



enter image description here










share|improve this question















How to get session variable value from shipping page to payment page ?



enter image description here



enter image description here







magento2 checkout payment magento-2.1.7






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 1 hour ago









PRINCE

6,6902935




6,6902935










asked 2 hours ago









trilok kumar

1268




1268











  • What you want to get from session variable?
    – Rohan Hapani
    2 hours ago











  • If we select length value in shipping page its length must be displayed under shipping method in payment page as i uploaded both image Rohan Hapani
    – trilok kumar
    2 hours ago










  • can you please update code which you have use for set the value
    – Rakesh Varma
    1 hour ago










  • protected $_checkoutSession; public function __construct( ........ MagentoCheckoutModelSession $checkoutSession, ........ ) ........ $this->_checkoutSession = $checkoutSession; ........ public function getCheckoutSession() return $this->_checkoutSession; this i used but its not working for me Rakesh Varma
    – trilok kumar
    1 hour ago
















  • What you want to get from session variable?
    – Rohan Hapani
    2 hours ago











  • If we select length value in shipping page its length must be displayed under shipping method in payment page as i uploaded both image Rohan Hapani
    – trilok kumar
    2 hours ago










  • can you please update code which you have use for set the value
    – Rakesh Varma
    1 hour ago










  • protected $_checkoutSession; public function __construct( ........ MagentoCheckoutModelSession $checkoutSession, ........ ) ........ $this->_checkoutSession = $checkoutSession; ........ public function getCheckoutSession() return $this->_checkoutSession; this i used but its not working for me Rakesh Varma
    – trilok kumar
    1 hour ago















What you want to get from session variable?
– Rohan Hapani
2 hours ago





What you want to get from session variable?
– Rohan Hapani
2 hours ago













If we select length value in shipping page its length must be displayed under shipping method in payment page as i uploaded both image Rohan Hapani
– trilok kumar
2 hours ago




If we select length value in shipping page its length must be displayed under shipping method in payment page as i uploaded both image Rohan Hapani
– trilok kumar
2 hours ago












can you please update code which you have use for set the value
– Rakesh Varma
1 hour ago




can you please update code which you have use for set the value
– Rakesh Varma
1 hour ago












protected $_checkoutSession; public function __construct( ........ MagentoCheckoutModelSession $checkoutSession, ........ ) ........ $this->_checkoutSession = $checkoutSession; ........ public function getCheckoutSession() return $this->_checkoutSession; this i used but its not working for me Rakesh Varma
– trilok kumar
1 hour ago




protected $_checkoutSession; public function __construct( ........ MagentoCheckoutModelSession $checkoutSession, ........ ) ........ $this->_checkoutSession = $checkoutSession; ........ public function getCheckoutSession() return $this->_checkoutSession; this i used but its not working for me Rakesh Varma
– trilok kumar
1 hour ago










2 Answers
2






active

oldest

votes

















up vote
1
down vote













I'm not sure this below code will be useful for you or not. But, you can use the below code in your custom module to set, unset session



protected $_checkoutSession;
public function __construct(
........
MagentoCheckoutModelSession $checkoutSession,
........
)

........
$this->_checkoutSession = $checkoutSession;
........



public function getCheckoutSession()

return $this->_checkoutSession;



By using getCheckoutSession() you can get value from session.






share|improve this answer




















  • Can you please elaborate the above code Rohan Hapani
    – trilok kumar
    1 hour ago










  • You can use this below code in your controller, block, helper etc. $this->_checkoutSession will be return object of checkoutSession data which is store in checkout page session
    – Rohan Hapani
    1 hour ago











  • No its not working for me Rohan Hapani
    – trilok kumar
    1 hour ago










  • It's whole object of checkout session. You need to get like this : $this->getCheckoutSession()->getCustomFunction(); //write your function which you want to get value from checkout session
    – Rohan Hapani
    31 mins ago

















up vote
1
down vote













protected $_checkoutSession;
public function __construct(
....
public function __construct(
MagentoCheckoutModelSession $checkoutSession
)

$this->_checkoutSession = $checkoutSession;


public function getCheckoutSession()

return $this->_checkoutSession;



Where you want set your value



$this->getCheckoutSession()->setShippingValue('someValueHere');


Where you want to get that value



$this->getCheckoutSession()->getShippingValue(); //someValueHere


Then you unset the value:



$this->getCheckoutSession()->unsShippingValue();





share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f246771%2fhow-to-get-session-variable-value-in-payment-page%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote













    I'm not sure this below code will be useful for you or not. But, you can use the below code in your custom module to set, unset session



    protected $_checkoutSession;
    public function __construct(
    ........
    MagentoCheckoutModelSession $checkoutSession,
    ........
    )

    ........
    $this->_checkoutSession = $checkoutSession;
    ........



    public function getCheckoutSession()

    return $this->_checkoutSession;



    By using getCheckoutSession() you can get value from session.






    share|improve this answer




















    • Can you please elaborate the above code Rohan Hapani
      – trilok kumar
      1 hour ago










    • You can use this below code in your controller, block, helper etc. $this->_checkoutSession will be return object of checkoutSession data which is store in checkout page session
      – Rohan Hapani
      1 hour ago











    • No its not working for me Rohan Hapani
      – trilok kumar
      1 hour ago










    • It's whole object of checkout session. You need to get like this : $this->getCheckoutSession()->getCustomFunction(); //write your function which you want to get value from checkout session
      – Rohan Hapani
      31 mins ago














    up vote
    1
    down vote













    I'm not sure this below code will be useful for you or not. But, you can use the below code in your custom module to set, unset session



    protected $_checkoutSession;
    public function __construct(
    ........
    MagentoCheckoutModelSession $checkoutSession,
    ........
    )

    ........
    $this->_checkoutSession = $checkoutSession;
    ........



    public function getCheckoutSession()

    return $this->_checkoutSession;



    By using getCheckoutSession() you can get value from session.






    share|improve this answer




















    • Can you please elaborate the above code Rohan Hapani
      – trilok kumar
      1 hour ago










    • You can use this below code in your controller, block, helper etc. $this->_checkoutSession will be return object of checkoutSession data which is store in checkout page session
      – Rohan Hapani
      1 hour ago











    • No its not working for me Rohan Hapani
      – trilok kumar
      1 hour ago










    • It's whole object of checkout session. You need to get like this : $this->getCheckoutSession()->getCustomFunction(); //write your function which you want to get value from checkout session
      – Rohan Hapani
      31 mins ago












    up vote
    1
    down vote










    up vote
    1
    down vote









    I'm not sure this below code will be useful for you or not. But, you can use the below code in your custom module to set, unset session



    protected $_checkoutSession;
    public function __construct(
    ........
    MagentoCheckoutModelSession $checkoutSession,
    ........
    )

    ........
    $this->_checkoutSession = $checkoutSession;
    ........



    public function getCheckoutSession()

    return $this->_checkoutSession;



    By using getCheckoutSession() you can get value from session.






    share|improve this answer












    I'm not sure this below code will be useful for you or not. But, you can use the below code in your custom module to set, unset session



    protected $_checkoutSession;
    public function __construct(
    ........
    MagentoCheckoutModelSession $checkoutSession,
    ........
    )

    ........
    $this->_checkoutSession = $checkoutSession;
    ........



    public function getCheckoutSession()

    return $this->_checkoutSession;



    By using getCheckoutSession() you can get value from session.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered 2 hours ago









    Rohan Hapani

    4,01821459




    4,01821459











    • Can you please elaborate the above code Rohan Hapani
      – trilok kumar
      1 hour ago










    • You can use this below code in your controller, block, helper etc. $this->_checkoutSession will be return object of checkoutSession data which is store in checkout page session
      – Rohan Hapani
      1 hour ago











    • No its not working for me Rohan Hapani
      – trilok kumar
      1 hour ago










    • It's whole object of checkout session. You need to get like this : $this->getCheckoutSession()->getCustomFunction(); //write your function which you want to get value from checkout session
      – Rohan Hapani
      31 mins ago
















    • Can you please elaborate the above code Rohan Hapani
      – trilok kumar
      1 hour ago










    • You can use this below code in your controller, block, helper etc. $this->_checkoutSession will be return object of checkoutSession data which is store in checkout page session
      – Rohan Hapani
      1 hour ago











    • No its not working for me Rohan Hapani
      – trilok kumar
      1 hour ago










    • It's whole object of checkout session. You need to get like this : $this->getCheckoutSession()->getCustomFunction(); //write your function which you want to get value from checkout session
      – Rohan Hapani
      31 mins ago















    Can you please elaborate the above code Rohan Hapani
    – trilok kumar
    1 hour ago




    Can you please elaborate the above code Rohan Hapani
    – trilok kumar
    1 hour ago












    You can use this below code in your controller, block, helper etc. $this->_checkoutSession will be return object of checkoutSession data which is store in checkout page session
    – Rohan Hapani
    1 hour ago





    You can use this below code in your controller, block, helper etc. $this->_checkoutSession will be return object of checkoutSession data which is store in checkout page session
    – Rohan Hapani
    1 hour ago













    No its not working for me Rohan Hapani
    – trilok kumar
    1 hour ago




    No its not working for me Rohan Hapani
    – trilok kumar
    1 hour ago












    It's whole object of checkout session. You need to get like this : $this->getCheckoutSession()->getCustomFunction(); //write your function which you want to get value from checkout session
    – Rohan Hapani
    31 mins ago




    It's whole object of checkout session. You need to get like this : $this->getCheckoutSession()->getCustomFunction(); //write your function which you want to get value from checkout session
    – Rohan Hapani
    31 mins ago












    up vote
    1
    down vote













    protected $_checkoutSession;
    public function __construct(
    ....
    public function __construct(
    MagentoCheckoutModelSession $checkoutSession
    )

    $this->_checkoutSession = $checkoutSession;


    public function getCheckoutSession()

    return $this->_checkoutSession;



    Where you want set your value



    $this->getCheckoutSession()->setShippingValue('someValueHere');


    Where you want to get that value



    $this->getCheckoutSession()->getShippingValue(); //someValueHere


    Then you unset the value:



    $this->getCheckoutSession()->unsShippingValue();





    share|improve this answer
























      up vote
      1
      down vote













      protected $_checkoutSession;
      public function __construct(
      ....
      public function __construct(
      MagentoCheckoutModelSession $checkoutSession
      )

      $this->_checkoutSession = $checkoutSession;


      public function getCheckoutSession()

      return $this->_checkoutSession;



      Where you want set your value



      $this->getCheckoutSession()->setShippingValue('someValueHere');


      Where you want to get that value



      $this->getCheckoutSession()->getShippingValue(); //someValueHere


      Then you unset the value:



      $this->getCheckoutSession()->unsShippingValue();





      share|improve this answer






















        up vote
        1
        down vote










        up vote
        1
        down vote









        protected $_checkoutSession;
        public function __construct(
        ....
        public function __construct(
        MagentoCheckoutModelSession $checkoutSession
        )

        $this->_checkoutSession = $checkoutSession;


        public function getCheckoutSession()

        return $this->_checkoutSession;



        Where you want set your value



        $this->getCheckoutSession()->setShippingValue('someValueHere');


        Where you want to get that value



        $this->getCheckoutSession()->getShippingValue(); //someValueHere


        Then you unset the value:



        $this->getCheckoutSession()->unsShippingValue();





        share|improve this answer












        protected $_checkoutSession;
        public function __construct(
        ....
        public function __construct(
        MagentoCheckoutModelSession $checkoutSession
        )

        $this->_checkoutSession = $checkoutSession;


        public function getCheckoutSession()

        return $this->_checkoutSession;



        Where you want set your value



        $this->getCheckoutSession()->setShippingValue('someValueHere');


        Where you want to get that value



        $this->getCheckoutSession()->getShippingValue(); //someValueHere


        Then you unset the value:



        $this->getCheckoutSession()->unsShippingValue();






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 33 mins ago









        PRINCE

        6,6902935




        6,6902935



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f246771%2fhow-to-get-session-variable-value-in-payment-page%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            What does second last employer means? [closed]

            List of Gilmore Girls characters

            Confectionery