Jump to content

IBACK

Members
  • Posts

    9
  • Joined

  • Last visited

Profile Information

  • First Name
    Fabrice
  • Last Name
    MAUPIN

IBACK's Achievements

Newbie

Newbie (1/14)

0

Reputation

1

Community Answers

  1. Bonjour rololo88, j'ai aussi le même problème sous PS 1.6 j'ai modifié les fichiers PHP adéquats : sans succès. as tu STP modifié ton fichier php.ini ? si oui quels sont les paramètres qui ont été modifiés ? merci par avance
  2. Hello everybody, i would like to add a new field for customers in prestashop 1.6 1/ i add a new field in Customer table (for example : my_date - Date type of course) 2/ i have to override the Customer Class i found this example : class Customer extends CustomerCore{ public function __construct($id = null) { parent::__construct($id); } //Overriding method customerExists public static function customerExists($email, $return_id = false, $ignore_guest = true) { $result = FALSE; //Write custom your code here return $result; } } ?> what is the custom code for adding my field "my_date" ? 3/ i have to modify the back office view too this is the tree of files for /themes/default/template/controllers/customers : required_fields.tpl index.php helpers/list/list_header.tpl and index.php helpers/view/view.tpl and index.php What are the files to modify ? what are the modifications to apply ? 4/ i don't want that my new field appears in front office, only on back office Any ideas ? Thanks you in advance FM
  3. Hello, I added a new tab in my BACK-OFFICE. This tab is not associated with a particular module. I would like just to select and view data in this tab. ******** Having consulted the prestashop documentation (which is reduced enough I find) and makes some searches, I do not manage to know the exact role of AdminTab ! AdminTab is not a kind of controller ? Whare are his limits ? ******** Have to I pass by an AdminController to select and view data either my AdminTab can make these tasks ? AdminController is not rather attached to a module ? ********* What are the links and differences between AdminTab and AdminController ? thanks you in advance Fabrice
  4. Hello, The Tab constructor in BACK-OFFICE is often initialize with one table. Example : public function __construct() { $this->table = 'belvg_CA_customerattributes_customer'; $this->identifier = 'id_belvg_customerattributes'; $this->_defaultOrderBy = 'id_belvg_customerattributes'; parent::__construct(); } Is it possible to associate the Tab constructor with a query ? Example of a query : $sql = "SELECT count(*) as nb FROM `" . _DB_PREFIX_ . "belvg_CA_customerattributes_customer` WHERE id_belvg_customerattributes = 1"; $this->results = (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql); I would like to show results from this query in List in my Tab. Any ideas ? Thanks you in advance, Fabrice
  5. ok thanks it's ok no message "BAD QUERY SQL"
  6. This is the debug message : Fatal error: Uncaught Table 'mybase.ps_' doesn't exist SELECT SQL_CALC_FOUND_ROWS a.* FROM `ps_` a WHERE 1 ORDER BY a.`id_` ASC LIMIT 0,50 thrown in /home/xxxxxx/classes/db/Db.php on line 639 very strange ! The name of the table is supplied in my query ! ('ps_belvg_CA_customerattributes_customer')
  7. I move date calculation in displayForm (of course) but i have always the same problem : BAD SQL QUERY ! Just a precision : i work with Prestashop 1.6
  8. Hello, I added a tab to BACK-OFFICE with a associated PHP page (AdminMyPage.php). This is the source of the page : <?php include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php'); class AdminMyPage extends AdminTab { private $results; public function __construct() { parent::__construct(); // date of the day $today = getdate(); if ($today['mday'] < 10) $day = "0" .$today['mday']; else $day = $today['mday']; if ($today['mon'] < 10) $month = "0" .$today['mon']; else $month = $today['mon']; $dateJour = $day . "/" . $month . "/" . $today['year']; } public function displayForm() { $defaultLanguage = intval(Configuration::get('PS_LANG_DEFAULT')); $sql = "SELECT count(*) as nb FROM `" . _DB_PREFIX_ . "belvg_CA_customerattributes_customer` WHERE id_belvg_customerattributes = 1 and value = '" . $dateJour . "' "; $this->results = Db::getInstance()->ExecuteS($sql); if ($this->results) { foreach ($this->results as $row) echo $row['dt_rdv'].' :: '.$row['nb'].'<br />'; } else echo "no data !"; } } ?> When i execute this page (click on my tab / BACK_OFFICE), i have this message : BAD SQL QUERY The query is correct (tested with phpMyAdmin). Any ideas ? thanks you in advance Fabrice
  9. Bonjour à tous, j'ai ajouté un onglet dans le BACK-OFFICE associé à une page PHP (AdminMyPage.php). Voici le code de la page : <?php include_once(PS_ADMIN_DIR.'/../classes/AdminTab.php'); class AdminMyPage extends AdminTab { private $results; public function __construct() { parent::__construct(); // date du jour $today = getdate(); if ($today['mday'] < 10) $day = "0" .$today['mday']; else $day = $today['mday']; if ($today['mon'] < 10) $month = "0" .$today['mon']; else $month = $today['mon']; $dateJour = $day . "/" . $month . "/" . $today['year']; } public function displayForm() { $defaultLanguage = intval(Configuration::get('PS_LANG_DEFAULT')); $sql = "SELECT count(*) as nb FROM `" . _DB_PREFIX_ . "belvg_CA_customerattributes_customer` WHERE id_belvg_customerattributes = 1 and value = '" . $dateJour . "' "; $this->results = Db::getInstance()->ExecuteS($sql); if ($this->results) { foreach ($this->results as $row) echo $row['dt_rdv'].' :: '.$row['nb'].'<br />'; } else echo "pas de data !"; } } ?> Lors de l'exécution de cette page (click sur mon onglet dans BACK-OFFICE), j'ai le message suivant : BAD SQL QUERY La requête est correcte (testée sous phpMyAdmin). si vous avez une idée, je suis preneur !!! merci par avance Fabrice
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More