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

Should I cover my bicycle overnight while bikepacking?

I would say: "You are another teacher", but she is a woman and I am a man

Solving a recurrence relation (poker chips)

Why do bosons tend to occupy the same state?

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

What is the difference between 仮定 and 想定?

Why are the 737's rear doors unusable in a water landing?

How badly should I try to prevent a user from XSSing themselves?

ssTTsSTtRrriinInnnnNNNIiinngg

Avoiding direct proof while writing proof by induction

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

One verb to replace 'be a member of' a club

Are there any examples of a variable being normally distributed that is *not* due to the Central Limit Theorem?

Short story with a alien planet, government officials must wear exploding medallions

iPad being using in wall mount battery swollen

Alternative to sending password over mail?

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

Is there a hemisphere-neutral way of specifying a season?

What does the expression "A Mann!" means

Why do I get two different answers for this counting problem?

How can I deal with my CEO asking me to hire someone with a higher salary than me, a co-founder?

Dreadful Dastardly Diseases, or Always Atrocious Ailments

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

How can I prevent hyper evolved versions of regular creatures from wiping out their cousins?



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 22 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 22 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?