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

            Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

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

            Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form