undefined index in $cookie['test'] in Magento 2 checkout observerwhen i select custom shiping method my other shipping methods not working in magento 2Automatically select shipping method in Admin OrderMagento 2.0.2 Backend cms pages and blocks disappearedHow to add store_id column on ui_component grid Magento 2Internal Server Error (500) estimate-shipping-methodsMagento2 : Calculate shipping charge based on cart value in Store Pickup methodmagento 2 translate shipping method titleMagento 2: how to programatically set free shipping from an observer?How to add fixed handling fee for all active shipping methods in Magento 2?My Payment Methods not Showing for downloadable/virtual product when checkout?update shipping address for shipping method change

How would I stat a creature to be immune to everything but the Magic Missile spell? (just for fun)

What does “the session was packed” mean in this context?

Why is consensus so controversial in Britain?

Am I breaking OOP practice with this architecture?

Why can't we play rap on piano?

Why is this clock signal connected to a capacitor to gnd?

How do I deal with an unproductive colleague in a small company?

Should I cover my bicycle overnight while bikepacking?

Arrow those variables!

What do you call someone who asks many questions?

Why didn't Miles's spider sense work before?

What method can I use to design a dungeon difficult enough that the PCs can't make it through without killing them?

Venezuelan girlfriend wants to travel the USA to be with me. What is the process?

Would Slavery Reparations be considered Bills of Attainder and hence Illegal?

What mechanic is there to disable a threat instead of killing it?

Cursor Replacement for Newbies

Is it inappropriate for a student to attend their mentor's dissertation defense?

How do conventional missiles fly?

A friend helped me with a presentation – plagiarism or not?

Is the myth that if you can play one instrument, you can learn another instrument with ease true?

CAST throwing error when run in stored procedure but not when run as raw query

How do I gain back my faith in my PhD degree?

What reasons are there for a Capitalist to oppose a 100% inheritance tax?

What does the expression "A Mann!" means



undefined index in $cookie['test'] in Magento 2 checkout observer


when i select custom shiping method my other shipping methods not working in magento 2Automatically select shipping method in Admin OrderMagento 2.0.2 Backend cms pages and blocks disappearedHow to add store_id column on ui_component grid Magento 2Internal Server Error (500) estimate-shipping-methodsMagento2 : Calculate shipping charge based on cart value in Store Pickup methodmagento 2 translate shipping method titleMagento 2: how to programatically set free shipping from an observer?How to add fixed handling fee for all active shipping methods in Magento 2?My Payment Methods not Showing for downloadable/virtual product when checkout?update shipping address for shipping method change













0















The shipping method custom module's
observer shows error



checkoutobservershipping.php



 if ($_COOKIE['pickupStoreVal']) 

$id = $_COOKIE['pickupStoreVal'];
$collection = $this->_storeCollection->getCollection()->addFieldToFilter('store_id', $id);




undefined index : pickupStoreVal /checkoutobserver.php on line 54




I have two shipping methods




1)Free shipping



2)Store pickup - custom module




When I select free shipping it will be showing error



I also tried



if (isset($_COOKIE['pickupStoreVal'])) 


How I can resolve this?










share|improve this question
























  • please add full code

    – Ronak Rathod
    22 hours ago















0















The shipping method custom module's
observer shows error



checkoutobservershipping.php



 if ($_COOKIE['pickupStoreVal']) 

$id = $_COOKIE['pickupStoreVal'];
$collection = $this->_storeCollection->getCollection()->addFieldToFilter('store_id', $id);




undefined index : pickupStoreVal /checkoutobserver.php on line 54




I have two shipping methods




1)Free shipping



2)Store pickup - custom module




When I select free shipping it will be showing error



I also tried



if (isset($_COOKIE['pickupStoreVal'])) 


How I can resolve this?










share|improve this question
























  • please add full code

    – Ronak Rathod
    22 hours ago













0












0








0








The shipping method custom module's
observer shows error



checkoutobservershipping.php



 if ($_COOKIE['pickupStoreVal']) 

$id = $_COOKIE['pickupStoreVal'];
$collection = $this->_storeCollection->getCollection()->addFieldToFilter('store_id', $id);




undefined index : pickupStoreVal /checkoutobserver.php on line 54




I have two shipping methods




1)Free shipping



2)Store pickup - custom module




When I select free shipping it will be showing error



I also tried



if (isset($_COOKIE['pickupStoreVal'])) 


How I can resolve this?










share|improve this question
















The shipping method custom module's
observer shows error



checkoutobservershipping.php



 if ($_COOKIE['pickupStoreVal']) 

$id = $_COOKIE['pickupStoreVal'];
$collection = $this->_storeCollection->getCollection()->addFieldToFilter('store_id', $id);




undefined index : pickupStoreVal /checkoutobserver.php on line 54




I have two shipping methods




1)Free shipping



2)Store pickup - custom module




When I select free shipping it will be showing error



I also tried



if (isset($_COOKIE['pickupStoreVal'])) 


How I can resolve this?







magento2 checkout shipping-methods obsever






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 21 hours ago









magefms

2,3042426




2,3042426










asked 22 hours ago









prabhakaran7prabhakaran7

3039




3039












  • please add full code

    – Ronak Rathod
    22 hours ago

















  • please add full code

    – Ronak Rathod
    22 hours ago
















please add full code

– Ronak Rathod
22 hours ago





please add full code

– Ronak Rathod
22 hours ago










2 Answers
2






active

oldest

votes


















0














$id = $_COOKIE['pickupStoreVal'] ?? false;
if ($id)

$collection = $this->_storeCollection->getCollection()->addFieldToFilter('store_id', $id);






share|improve this answer























  • if $_COOKIE['pickupStoreVal'] has value what happen it would won't affect the code

    – prabhakaran7
    22 hours ago











  • if it will have value, it will execute the code inside condition, if not, it wont. ?? is just like isset as per php 7+.

    – Yash Shah
    22 hours ago











  • hooo superb............

    – prabhakaran7
    22 hours ago






  • 1





    this not working bro

    – prabhakaran7
    22 hours ago











  • what error it is showing ?

    – Yash Shah
    21 hours ago


















0














You should try using !isset function, check below sample:



if(!isset($_COOKIE['pickupStoreVal'])) 
$id = $_COOKIE['pickupStoreVal'];
$collection = $this->_storeCollection->getCollection()->addFieldToFilter('store_id', $id);
else
//your cookie is not set message






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',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    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%2f268480%2fundefined-index-in-cookietest-in-magento-2-checkout-observer%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    $id = $_COOKIE['pickupStoreVal'] ?? false;
    if ($id)

    $collection = $this->_storeCollection->getCollection()->addFieldToFilter('store_id', $id);






    share|improve this answer























    • if $_COOKIE['pickupStoreVal'] has value what happen it would won't affect the code

      – prabhakaran7
      22 hours ago











    • if it will have value, it will execute the code inside condition, if not, it wont. ?? is just like isset as per php 7+.

      – Yash Shah
      22 hours ago











    • hooo superb............

      – prabhakaran7
      22 hours ago






    • 1





      this not working bro

      – prabhakaran7
      22 hours ago











    • what error it is showing ?

      – Yash Shah
      21 hours ago















    0














    $id = $_COOKIE['pickupStoreVal'] ?? false;
    if ($id)

    $collection = $this->_storeCollection->getCollection()->addFieldToFilter('store_id', $id);






    share|improve this answer























    • if $_COOKIE['pickupStoreVal'] has value what happen it would won't affect the code

      – prabhakaran7
      22 hours ago











    • if it will have value, it will execute the code inside condition, if not, it wont. ?? is just like isset as per php 7+.

      – Yash Shah
      22 hours ago











    • hooo superb............

      – prabhakaran7
      22 hours ago






    • 1





      this not working bro

      – prabhakaran7
      22 hours ago











    • what error it is showing ?

      – Yash Shah
      21 hours ago













    0












    0








    0







    $id = $_COOKIE['pickupStoreVal'] ?? false;
    if ($id)

    $collection = $this->_storeCollection->getCollection()->addFieldToFilter('store_id', $id);






    share|improve this answer













    $id = $_COOKIE['pickupStoreVal'] ?? false;
    if ($id)

    $collection = $this->_storeCollection->getCollection()->addFieldToFilter('store_id', $id);







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered 22 hours ago









    Yash ShahYash Shah

    69618




    69618












    • if $_COOKIE['pickupStoreVal'] has value what happen it would won't affect the code

      – prabhakaran7
      22 hours ago











    • if it will have value, it will execute the code inside condition, if not, it wont. ?? is just like isset as per php 7+.

      – Yash Shah
      22 hours ago











    • hooo superb............

      – prabhakaran7
      22 hours ago






    • 1





      this not working bro

      – prabhakaran7
      22 hours ago











    • what error it is showing ?

      – Yash Shah
      21 hours ago

















    • if $_COOKIE['pickupStoreVal'] has value what happen it would won't affect the code

      – prabhakaran7
      22 hours ago











    • if it will have value, it will execute the code inside condition, if not, it wont. ?? is just like isset as per php 7+.

      – Yash Shah
      22 hours ago











    • hooo superb............

      – prabhakaran7
      22 hours ago






    • 1





      this not working bro

      – prabhakaran7
      22 hours ago











    • what error it is showing ?

      – Yash Shah
      21 hours ago
















    if $_COOKIE['pickupStoreVal'] has value what happen it would won't affect the code

    – prabhakaran7
    22 hours ago





    if $_COOKIE['pickupStoreVal'] has value what happen it would won't affect the code

    – prabhakaran7
    22 hours ago













    if it will have value, it will execute the code inside condition, if not, it wont. ?? is just like isset as per php 7+.

    – Yash Shah
    22 hours ago





    if it will have value, it will execute the code inside condition, if not, it wont. ?? is just like isset as per php 7+.

    – Yash Shah
    22 hours ago













    hooo superb............

    – prabhakaran7
    22 hours ago





    hooo superb............

    – prabhakaran7
    22 hours ago




    1




    1





    this not working bro

    – prabhakaran7
    22 hours ago





    this not working bro

    – prabhakaran7
    22 hours ago













    what error it is showing ?

    – Yash Shah
    21 hours ago





    what error it is showing ?

    – Yash Shah
    21 hours ago













    0














    You should try using !isset function, check below sample:



    if(!isset($_COOKIE['pickupStoreVal'])) 
    $id = $_COOKIE['pickupStoreVal'];
    $collection = $this->_storeCollection->getCollection()->addFieldToFilter('store_id', $id);
    else
    //your cookie is not set message






    share|improve this answer



























      0














      You should try using !isset function, check below sample:



      if(!isset($_COOKIE['pickupStoreVal'])) 
      $id = $_COOKIE['pickupStoreVal'];
      $collection = $this->_storeCollection->getCollection()->addFieldToFilter('store_id', $id);
      else
      //your cookie is not set message






      share|improve this answer

























        0












        0








        0







        You should try using !isset function, check below sample:



        if(!isset($_COOKIE['pickupStoreVal'])) 
        $id = $_COOKIE['pickupStoreVal'];
        $collection = $this->_storeCollection->getCollection()->addFieldToFilter('store_id', $id);
        else
        //your cookie is not set message






        share|improve this answer













        You should try using !isset function, check below sample:



        if(!isset($_COOKIE['pickupStoreVal'])) 
        $id = $_COOKIE['pickupStoreVal'];
        $collection = $this->_storeCollection->getCollection()->addFieldToFilter('store_id', $id);
        else
        //your cookie is not set message







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 21 hours ago









        magefmsmagefms

        2,3042426




        2,3042426



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f268480%2fundefined-index-in-cookietest-in-magento-2-checkout-observer%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

            Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

            Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?