Superbegood31 Posted August 8, 2013 Share Posted August 8, 2013 (edited) Bonjour à tous, Je souhaites insérer le total des commandes en dessous de la liste des commandes. Voici la requête : SELECT SUM(total_paid) AS Total FROM '._DB_PREFIX_.'orders Comment et où puis-je intégrer cette vue ? Merci d'avance Edit: C'est pas très propre mais cela a le mérite de fonctionner. Le code ci-dessous va faire apparaître un tableau, sur la page d'accueil de votre back-office, contenant : - Toutes les ventes TTC - Toutes les ventes HT - Toutes les TVA Ce code est à placer dans controller/admin/AdminHomeController.php Juste au dessus de $results = array_merge($result, array_merge($result2, $result3)); Coller ceci $result4 = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' SELECT SUM(`total_paid_tax_incl`) as total_paid_tax_incl FROM `'._DB_PREFIX_.'orders` '); $result5 = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' SELECT SUM(`total_paid_tax_excl`) as total_paid_tax_excl FROM `'._DB_PREFIX_.'orders` '); $tva = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' SELECT SUM(`total_paid_tax_incl` - `total_paid_tax_excl`) as total_tva FROM `'._DB_PREFIX_.'orders` '); Et remplacer $content = '<div class="table_info"> Par $content = '<div class="table_info"> <h5>'.$this->l('RESULTATS').'</h5> <table class="table_info_details" style="width:100%"> <colgroup> <col width=""> <col width="80px"> </colgroup> <tr class="tr_odd"> <td class="td_align_left"> '.$this->l('Total ventes TTC').' </td> <td> ' .Tools::displayPrice((float)$result4['total_paid_tax_incl'], $currency) .' </td> </tr> <tr> <td class="td_align_left"> '.$this->l('Total ventes HT').' </td> <td> ' .Tools::displayPrice((float)$result5['total_paid_tax_excl'], $currency) .' </td> </tr> <tr class="tr_odd"> <td class="td_align_left"> '.$this->l('Total TVA').' </td> <td> ' .Tools::displayPrice((float)$tva['total_tva'], $currency) .' </td> </tr> </table> </div><br/><br/><br/><br/><br/><br/><br/><br/><br/> <div class="table_info"> Si ca peux aider certains Edited August 9, 2013 by SWITCHBOARD (see edit history) 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