Jump to content

rayrayrugby

Members
  • Posts

    26
  • Joined

  • Last visited

About rayrayrugby

  • Birthday 08/04/1995

Profile Information

  • Location
    France
  • Activity
    Other

Recent Profile Visitors

418 profile views

rayrayrugby's Achievements

Newbie

Newbie (1/14)

2

Reputation

  1. Hi, I'm currently trying to get some information about my test shop. I got all I needed except the daily income of the shop. Could somebody tell me how I can get it please ? Thank you in advance !
  2. Thanks for your reply cristic, I tried using Context but my variable $id_employee is still set to 0 instead of 1 ...
  3. Hi everybody, I'm currently trying to get the id of the current employee from an outside php file. I did it like that but it doesn't work : <?php require_once(dirname(__FILE__).'/../../config/config.inc.php'); require_once(dirname(__FILE__).'/../../config/settings.inc.php'); require_once(dirname(__FILE__).'/../../classes/Cookie.php'); $cookie = new Cookie('psAdmin'); $id_employee = $cookie->id_employee; $profile = $cookie->profile; echo $id_employee; echo $profile; die(); ?> Could somebody help me please ?
  4. I did it like that : <script type="text/javascript"> function getXMLHttp() { var xmlHttp try { //Firefox, Opera 8.0+, Safari xmlHttp = new XMLHttpRequest(); } catch(e) { //Internet Explorer try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { alert("Your browser does not support AJAX!") return false; } } } return xmlHttp; } function MakeRequest() { var xmlHttp = getXMLHttp(); xmlHttp.onreadystatechange = function() { if(xmlHttp.readyState == 4) { HandleResponse(xhr.responseText); } } xmlHttp.open("GET", "/prestashop/modules/script/my_script.php", true); xmlHttp.send(null); } function HandleResponse(response) { document.getElementById('#scr').innerHTML = response; /*response contains the script I want to run in BO */ } </script> The problem now is that the script is not executed in the div '#scr'. What am I doing wrong ?
  5. Thank you for your reply @vekia, I'm gonna try this, I think I have to call my php file using this in the head of my .tpl : <script type="text/javascript"> $.ajax({ url: 'my_file.php', success: function (data) { alert('content of the executed page: ' + data); }, error: function (xhr, status, error) { if (xhr.status > 0) alert('got error: ' + status); } }); </script> If I understand it, this will execute inside my div 'my_file.php' which contains this : <?php //some sql requests if (condition) { echo ' here is the js which must be executed in BO '; } ?> And I think I have to add a setinterval() in the script which run the AJAX call to make it runs every 10 seconds. Could you please tell me if it is the good way ? Thanks !
  6. Hi, I want to run every 10 seconds a php code wich executes a js script in BO. This php code is a part of one of my .tpl div. I know I have to do this using AJAX but I don't really know how to use AJAX in Ps . Could somebody help me please ?
  7. Hi, I want to run every 10 seconds a php code wich executes a js script in BO. This php code is a part of one of my .tpl div. I know I have to do this using AJAX but I don't really know how to use AJAX in Ps . Could somebody help me please ?
  8. Should I in this case used the AJAX calls in the hookactionValidateOrder, to make sure the calls are made if orders has been placed ?
  9. To be more exact, for the moment what I want is display on backoffice pages a simple js alert that I've created inside of a tpl file. So to do this i used the hooks "actionvalidateorder" and "displaybackofficefooter" like that : public function hookactionValidateOrder($params) { Hook::exec('displayBackOfficeFooter', array()); } public function hookdisplayBackOfficeFooter($params) { return $this->display(__FILE__, 'test.tpl'); } But when I make an order nothing happens, I really don't know why..
  10. Bonjour, J'aimerais savoir pourquoi lorsque j' exécute le hook "backofficefooter" lors de la validation d'une commande via le hook "actionValidateOrder" cela ne fonctionne t'il pas ... voici mon code : public function hookactionValidateOrder($params) { Hook::exec('displayBackOfficeFooter', array()); } public function hookdisplayBackOfficeFooter($params) { return $this->display(__FILE__, 'test.tpl'); } L’exécution du hook "backofficefooter" est censée m'afficher un alert() (js) placé dans test.tpl . Merci !
  11. it seems to work except for the .tpl of my module, wich should be displayed when the hook backofficefooter is executing. Maybe because I don't use this method ? : (And sorry the Hook is "displaybackofficefooter")
  12. Thanks for your reply cristic, if I try this method, will all the transplanted module of the hook run ? thanks.
×
×
  • Create New...