merlucinodelespacio Posted September 20, 2014 Share Posted September 20, 2014 Hola, buenas tardes! Me gustaría saber si alguien sabe cómo puedo ocultar el chat de Zopim en la versíon móvil;he introducido el código del script de la apllicación en el footer.tpl de mi web y se ve perfecto en ordenadores pero en algunos teléfonos móviles me da problemas y quiero ocultarlo. El código que tengo en el footer es éste: <!--Start of Zopim Live Chat Script--> <div class="search_and_share"> <script type="text/javascript"> window.$zopim||(function(d,s){var z=$zopim=function(c){z._.push(c)},$=z.s= d.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set. _.push(o)};z._=[];z.set._=[];$.async=!0;$.setAttribute('charset','utf-8'); $.src='//cdn.zopim.com/?ITPxLe9ddIoxSVtSqovxc2l7rtOO4zd8';z.t=+new Date;$. type='text/javascript';e.parentNode.insertBefore($,e)})(document,'script'); </script></div> <!--End of Zopim Live Chat Script--> <script type="text/javascript"> $ Zopim (function () { $ zopim.livechat.setLanguage ('es'); }); </ script> {/literal} </body> Link to comment Share on other sites More sharing options...
galindogadea Posted September 20, 2014 Share Posted September 20, 2014 Aquí: http://www.prestashop.com/forums/topic/240024-if-variable-for-mobile-theme/ comentan el poder hacer un condicional. (Revisa el tema, para ver si te puede ayudar) Link to comment Share on other sites More sharing options...
JuDrYa Posted September 20, 2014 Share Posted September 20, 2014 Mira he encontrado esto.... I couldn't find any built-in Prestashop Smarty variable that will determine if a user is on a Mobile device or a desktop device, I decided to assign my own variable in FrontController.php at the end of the __construct() method. $this->context->smarty->assign('isMobile', $this->context->getMobileDevice()); and then in your template you can use it like this: {if $isMobile} AQUI TU CODIGO {/if} Espero te sea de ayuda... Se adelanto "galindogadea". Link to comment Share on other sites More sharing options...
merlucinodelespacio Posted September 20, 2014 Author Share Posted September 20, 2014 Gracias por responder, pero no he tenido éxito.. :S he probado lo de ese hilo pero no me ha funcionado. Saludos! Link to comment Share on other sites More sharing options...
JuDrYa Posted September 20, 2014 Share Posted September 20, 2014 Que versión de presta usas? Link to comment Share on other sites More sharing options...
JuDrYa Posted September 20, 2014 Share Posted September 20, 2014 Mira esto... http://www.prestashop.com/forums/topic/305738-show-picture-only-on-desktop-devices/ Link to comment Share on other sites More sharing options...
merlucinodelespacio Posted September 20, 2014 Author Share Posted September 20, 2014 Uso la 1.6.0.8 Link to comment Share on other sites More sharing options...
merlucinodelespacio Posted September 20, 2014 Author Share Posted September 20, 2014 alguna idea de como introducir esto? $isMobile = (bool)preg_match('#\b(ip(hone|od|ad)|android|opera m(ob|in)i|windows (phone|ce)|blackberry|tablet'.'|s(ymbian|eries60|amsung)|p(laybook|alm|rofile/midp|laystation portable)|nokia|fennec|htc[\-_]'.'|mobile|up\.browser|[1-4][0-9]{2}x[1-4][0-9]{2})\b#i', $_SERVER['HTTP_USER_AGENT'] ); + if ($isMobile==true){return true;} else {return false;} la primera parte supongo que en el FrontController pero cómo pongo la segunda? Link to comment Share on other sites More sharing options...
merlucinodelespacio Posted September 20, 2014 Author Share Posted September 20, 2014 Habría alguna manera de conseguirlo mediante css? Supongo que será una tontería.. Link to comment Share on other sites More sharing options...
Recommended Posts