Mookyl Posted June 8, 2016 Share Posted June 8, 2016 Bonjour J'aimerai faire moi même la page web pour mobile de mon site web J'ai une classe en php que j'utilise pour identifier si c'est un mobile ou un pc, elle marche très bien Mais j'ai besoin de savoir quel fichier ".php" prestashop lance t'il en premier. J'ai essayer avec "index.php" et ça ne marche pas pour info je rajoute que ces lignes la : require 'Mobile_Detect.php'; $detect = new Mobile_Detect(); if ($detect->isMobile()) { header('Location: adressedemonsite'); } Link to comment Share on other sites More sharing options...
Mookyl Posted June 9, 2016 Author Share Posted June 9, 2016 Merci de cette info, justement je cherche ou écrire cette ligne de code "require('tools/mobile_Detect/Mobile_Detect.php)';" Link to comment Share on other sites More sharing options...
Mookyl Posted June 9, 2016 Author Share Posted June 9, 2016 require('tools/mobile_Detect/Mobile_Detect.php'); $detect = new Mobile_Detect(); if ($detect->isMobile()) { header('Location: http://192.168.3.162/sitemobile/testmobile.php'); } J'ai donc mis ça comme ça et aucun résultat et merci de tes réponses rapides ! Link to comment Share on other sites More sharing options...
Mookyl Posted June 9, 2016 Author Share Posted June 9, 2016 Quand je le met avant il se passe ça : et je suis sur un xiaomi redmi note 2 mais je test aussi avec l'application Opera mobile pour être sur Link to comment Share on other sites More sharing options...
Mookyl Posted June 9, 2016 Author Share Posted June 9, 2016 (edited) <?php /* * 2007-2014 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <[email protected]> * @copyright 2007-2014 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ require('tools/mobile_Detect/Mobile_Detect.php'); $detect = new Mobile_Detect(); if ($detect->isMobile()) { header('Location: http://192.168.3.162/sitemobile/testmobile.php'); } require(dirname(__FILE__).'/config/config.inc.php'); Dispatcher::getInstance()->dispatch(); Edited June 9, 2016 by Mookyl (see edit history) Link to comment Share on other sites More sharing options...
Mookyl Posted June 9, 2016 Author Share Posted June 9, 2016 oups pardon ^-^ c'est juste une page de test pour voir si la redirection a marché <!DOCTYPE html> <html> <head> <title>mobile</title> </head> <body> <h1>TESSSSSSST</h1> </body> </html> Link to comment Share on other sites More sharing options...
Mookyl Posted June 9, 2016 Author Share Posted June 9, 2016 Problème résolue je me suis embrouillez dans les fichiers ,j'envoyez le mauvais sur le serveur vers les derniers changement mais mettre les lignes avant le "require(dirname(__FILE__).'/config/config.inc.php');" a très bien fonctionner du coup ! merci beaucoup beaucoup ! tu m'a beaucoup aidé ! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now