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
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
add a comment |
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
please add full code
– Ronak Rathod
22 hours ago
add a comment |
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
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
magento2 checkout shipping-methods obsever
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
add a comment |
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
add a comment |
2 Answers
2
active
oldest
votes
$id = $_COOKIE['pickupStoreVal'] ?? false;
if ($id)
$collection = $this->_storeCollection->getCollection()->addFieldToFilter('store_id', $id);
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
|
show 3 more comments
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
$id = $_COOKIE['pickupStoreVal'] ?? false;
if ($id)
$collection = $this->_storeCollection->getCollection()->addFieldToFilter('store_id', $id);
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
|
show 3 more comments
$id = $_COOKIE['pickupStoreVal'] ?? false;
if ($id)
$collection = $this->_storeCollection->getCollection()->addFieldToFilter('store_id', $id);
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
|
show 3 more comments
$id = $_COOKIE['pickupStoreVal'] ?? false;
if ($id)
$collection = $this->_storeCollection->getCollection()->addFieldToFilter('store_id', $id);
$id = $_COOKIE['pickupStoreVal'] ?? false;
if ($id)
$collection = $this->_storeCollection->getCollection()->addFieldToFilter('store_id', $id);
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
|
show 3 more comments
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
|
show 3 more comments
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
add a comment |
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
add a comment |
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
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
answered 21 hours ago
magefmsmagefms
2,3042426
2,3042426
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
please add full code
– Ronak Rathod
22 hours ago