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