Magento 2.2 - Mobile_detect is not working [closed] Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar ManaraMagento2 apache rewrites not working on localRequirejs shim option not workingMagento 2 Active Mobile Menu width calc() issue being doubledjQuery css is not working for mobileMagento 2: setPageSize not working in blockHow to set 2 different themes for Mobile and Desktop in Magento 2.1.7 without changing the core fileObserver and event not workingMagento 2: Desktop css is loading while mobile css not loadingCron jobs not workingHow to use require_once in magento 2
Scheduling based problem
What is this word supposed to be?
Has a Nobel Peace laureate ever been accused of war crimes?
Retract an already submitted recommendation letter (written for an undergrad student)
As an international instructor, should I openly talk about my accent?
What makes accurate emulation of old systems a difficult task?
I preordered a game on my Xbox while on the home screen of my friend's account. Which of us owns the game?
Is Diceware more secure than a long passphrase?
Which big number is bigger?
Why doesn't the standard consider a template constructor as a copy constructor?
All ASCII characters with a given bit count
What is the ongoing value of the Kanban board to the developers as opposed to management
Protagonist's race is hidden - should I reveal it?
Air bladders in bat-like skin wings for better lift?
Co-worker works way more than he should
Multiple options vs single option UI
How exactly does Hawking radiation decrease the mass of black holes?
Will I lose my paid in full property
Why does Arg'[1. + I] return -0.5?
How to keep bees out of canned beverages?
What is it called when you ride around on your front wheel?
My admission is revoked after accepting the admission offer
How do I prove this combinatorial identity
How do I reattach a shelf to the wall when it ripped out of the wall?
Magento 2.2 - Mobile_detect is not working [closed]
Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar ManaraMagento2 apache rewrites not working on localRequirejs shim option not workingMagento 2 Active Mobile Menu width calc() issue being doubledjQuery css is not working for mobileMagento 2: setPageSize not working in blockHow to set 2 different themes for Mobile and Desktop in Magento 2.1.7 without changing the core fileObserver and event not workingMagento 2: Desktop css is loading while mobile css not loadingCron jobs not workingHow to use require_once in magento 2
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
require_once($directory->getRoot().'/Mobile_Detect.php');
$deviceDetect = new Mobile_Detect;
if ($deviceDetect->isMobile())
echo "<script>alert('MOBILE');</script>";
else
echo "<script>alert('WEB');</script>";
Always in all the device we get only "WEB".
magento2 mobile-device
closed as off-topic by Jai, Manashvi Birla, Sukumar Gorai, Teja Bhagavan Kollepara, Piyush Mar 22 at 5:34
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions describing a problem that can't be reproduced OR seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Jai, Manashvi Birla, Sukumar Gorai, Teja Bhagavan Kollepara, Piyush
add a comment |
require_once($directory->getRoot().'/Mobile_Detect.php');
$deviceDetect = new Mobile_Detect;
if ($deviceDetect->isMobile())
echo "<script>alert('MOBILE');</script>";
else
echo "<script>alert('WEB');</script>";
Always in all the device we get only "WEB".
magento2 mobile-device
closed as off-topic by Jai, Manashvi Birla, Sukumar Gorai, Teja Bhagavan Kollepara, Piyush Mar 22 at 5:34
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions describing a problem that can't be reproduced OR seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Jai, Manashvi Birla, Sukumar Gorai, Teja Bhagavan Kollepara, Piyush
add a comment |
require_once($directory->getRoot().'/Mobile_Detect.php');
$deviceDetect = new Mobile_Detect;
if ($deviceDetect->isMobile())
echo "<script>alert('MOBILE');</script>";
else
echo "<script>alert('WEB');</script>";
Always in all the device we get only "WEB".
magento2 mobile-device
require_once($directory->getRoot().'/Mobile_Detect.php');
$deviceDetect = new Mobile_Detect;
if ($deviceDetect->isMobile())
echo "<script>alert('MOBILE');</script>";
else
echo "<script>alert('WEB');</script>";
Always in all the device we get only "WEB".
magento2 mobile-device
magento2 mobile-device
asked Mar 20 at 15:27
AmyAmy
36610
36610
closed as off-topic by Jai, Manashvi Birla, Sukumar Gorai, Teja Bhagavan Kollepara, Piyush Mar 22 at 5:34
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions describing a problem that can't be reproduced OR seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Jai, Manashvi Birla, Sukumar Gorai, Teja Bhagavan Kollepara, Piyush
closed as off-topic by Jai, Manashvi Birla, Sukumar Gorai, Teja Bhagavan Kollepara, Piyush Mar 22 at 5:34
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions describing a problem that can't be reproduced OR seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Jai, Manashvi Birla, Sukumar Gorai, Teja Bhagavan Kollepara, Piyush
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Add a function in any helper:
public function isMobile()^bird
Then call this helper in your file:
if($this->helper('VendorModuleHelperData')->isMobile())
//Do mobile code
Thanks Shoaib, will check your answer and let you know.
– Amy
Mar 21 at 10:44
Have you resolve your issue?
– Shoaib Munir
Mar 22 at 9:47
No, still not..
– Amy
Mar 22 at 9:48
The same way I have called the helper class, but still not not able to achieve it..
– Amy
Mar 22 at 9:49
are you calling helper in phtml or in php? calling of helper is different for both files
– Shoaib Munir
Mar 22 at 9:50
|
show 4 more comments
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Add a function in any helper:
public function isMobile()^bird
Then call this helper in your file:
if($this->helper('VendorModuleHelperData')->isMobile())
//Do mobile code
Thanks Shoaib, will check your answer and let you know.
– Amy
Mar 21 at 10:44
Have you resolve your issue?
– Shoaib Munir
Mar 22 at 9:47
No, still not..
– Amy
Mar 22 at 9:48
The same way I have called the helper class, but still not not able to achieve it..
– Amy
Mar 22 at 9:49
are you calling helper in phtml or in php? calling of helper is different for both files
– Shoaib Munir
Mar 22 at 9:50
|
show 4 more comments
Add a function in any helper:
public function isMobile()^bird
Then call this helper in your file:
if($this->helper('VendorModuleHelperData')->isMobile())
//Do mobile code
Thanks Shoaib, will check your answer and let you know.
– Amy
Mar 21 at 10:44
Have you resolve your issue?
– Shoaib Munir
Mar 22 at 9:47
No, still not..
– Amy
Mar 22 at 9:48
The same way I have called the helper class, but still not not able to achieve it..
– Amy
Mar 22 at 9:49
are you calling helper in phtml or in php? calling of helper is different for both files
– Shoaib Munir
Mar 22 at 9:50
|
show 4 more comments
Add a function in any helper:
public function isMobile()^bird
Then call this helper in your file:
if($this->helper('VendorModuleHelperData')->isMobile())
//Do mobile code
Add a function in any helper:
public function isMobile()^bird
Then call this helper in your file:
if($this->helper('VendorModuleHelperData')->isMobile())
//Do mobile code
edited Mar 21 at 3:51
answered Mar 20 at 16:29
Shoaib MunirShoaib Munir
2,67421031
2,67421031
Thanks Shoaib, will check your answer and let you know.
– Amy
Mar 21 at 10:44
Have you resolve your issue?
– Shoaib Munir
Mar 22 at 9:47
No, still not..
– Amy
Mar 22 at 9:48
The same way I have called the helper class, but still not not able to achieve it..
– Amy
Mar 22 at 9:49
are you calling helper in phtml or in php? calling of helper is different for both files
– Shoaib Munir
Mar 22 at 9:50
|
show 4 more comments
Thanks Shoaib, will check your answer and let you know.
– Amy
Mar 21 at 10:44
Have you resolve your issue?
– Shoaib Munir
Mar 22 at 9:47
No, still not..
– Amy
Mar 22 at 9:48
The same way I have called the helper class, but still not not able to achieve it..
– Amy
Mar 22 at 9:49
are you calling helper in phtml or in php? calling of helper is different for both files
– Shoaib Munir
Mar 22 at 9:50
Thanks Shoaib, will check your answer and let you know.
– Amy
Mar 21 at 10:44
Thanks Shoaib, will check your answer and let you know.
– Amy
Mar 21 at 10:44
Have you resolve your issue?
– Shoaib Munir
Mar 22 at 9:47
Have you resolve your issue?
– Shoaib Munir
Mar 22 at 9:47
No, still not..
– Amy
Mar 22 at 9:48
No, still not..
– Amy
Mar 22 at 9:48
The same way I have called the helper class, but still not not able to achieve it..
– Amy
Mar 22 at 9:49
The same way I have called the helper class, but still not not able to achieve it..
– Amy
Mar 22 at 9:49
are you calling helper in phtml or in php? calling of helper is different for both files
– Shoaib Munir
Mar 22 at 9:50
are you calling helper in phtml or in php? calling of helper is different for both files
– Shoaib Munir
Mar 22 at 9:50
|
show 4 more comments