mdusamaansari Posted December 27, 2013 Share Posted December 27, 2013 Hi I need total amount of orders in bottom of the orders page in back office. I attached a screen shot for example. Its a feature of old version 1.2.4.0. I need it to be developed on version 1.5.6.0. Kindly help me having this feature enables on my prestashop store. Thanks in advance, mdusamaansari 1 Link to comment Share on other sites More sharing options...
Divyesh Prajapati Posted December 27, 2013 Share Posted December 27, 2013 Hi I need total amount of orders in bottom of the orders page in back office. I attached a screen shot for example. Its a feature of old version 1.2.4.0. I need it to be developed on version 1.5.6.0. Kindly help me having this feature enables on my prestashop store. Thanks in advance, mdusamaansari orders.jpg Hello Usmaan, Attaching 2 file here replace these files.. Here are path for that.. /classes/controller --> AdminController.php /classes/order --> Order.php open list_footer.tpl file from path /YOUR_ADMIN/themes/default/template/helpers/list and replace all code with code pasted below {* * 2007-2013 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 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/afl-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-2013 PrestaShop SA * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} </table> {if $bulk_actions} <p> {foreach $bulk_actions as $key => $params} <input type="submit" class="button" name="submitBulk{$key}{$table}" value="{$params.text}" {if isset($params.confirm)}onclick="return confirm('{$params.confirm}');"{/if} /> {/foreach} </p> {/if} </td> </tr> </table> {if !$simple_header} <input type="hidden" name="token" value="{$token}" /> </form> {/if} {hook h='displayAdminListAfter'} {if isset($name_controller)} {capture name=hookName assign=hookName}display{$name_controller|ucfirst}ListAfter{/capture} {hook h=$hookName} {elseif isset($smarty.get.controller)} {capture name=hookName assign=hookName}display{$smarty.get.controller|ucfirst|htmlentities}ListAfter{/capture} {hook h=$hookName} {/if} {block name="after"}{/block} {if $smarty.get.controller|ucfirst|htmlentities == 'AdminOrders'} <div style="float: right;padding: 10px 10px 0px;background: #CBCCBC;"> <h1>{l s='Total: '} {convertPrice price=$order_total}</h1> </div> {/if} Follow all this steps and Enjoy!! AdminController.php Order.php 1 Link to comment Share on other sites More sharing options...
tomekmo Posted January 8, 2014 Share Posted January 8, 2014 Hello Usmaan, Attaching 2 file here replace these files.. Here are path for that.. /classes/controller --> AdminController.php /classes/order --> Order.php open list_footer.tpl file from path /YOUR_ADMIN/themes/default/template/helpers/list and replace all code with code pasted below {* * 2007-2013 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 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/afl-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-2013 PrestaShop SA * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} </table> {if $bulk_actions} <p> {foreach $bulk_actions as $key => $params} <input type="submit" class="button" name="submitBulk{$key}{$table}" value="{$params.text}" {if isset($params.confirm)}onclick="return confirm('{$params.confirm}');"{/if} /> {/foreach} </p> {/if} </td> </tr> </table> {if !$simple_header} <input type="hidden" name="token" value="{$token}" /> </form> {/if} {hook h='displayAdminListAfter'} {if isset($name_controller)} {capture name=hookName assign=hookName}display{$name_controller|ucfirst}ListAfter{/capture} {hook h=$hookName} {elseif isset($smarty.get.controller)} {capture name=hookName assign=hookName}display{$smarty.get.controller|ucfirst|htmlentities}ListAfter{/capture} {hook h=$hookName} {/if} {block name="after"}{/block} {if $smarty.get.controller|ucfirst|htmlentities == 'AdminOrders'} <div style="float: right;padding: 10px 10px 0px;background: #CBCCBC;"> <h1>{l s='Total: '} {convertPrice price=$order_total}</h1> </div> {/if} Follow all this steps and Enjoy!! How to make an added only what displays? Link to comment Share on other sites More sharing options...
Divyesh Prajapati Posted January 9, 2014 Share Posted January 9, 2014 How to make an added only what displays? Sorry, not got your point. Can you please elaborate more.? Link to comment Share on other sites More sharing options...
mdusamaansari Posted January 9, 2014 Author Share Posted January 9, 2014 Sorry, not got your point. Can you please elaborate more.? Hi Divyesh, I think, he is in need of one page order total which displays 50 rows. Hope am right. Link to comment Share on other sites More sharing options...
gopeppy Posted January 9, 2014 Share Posted January 9, 2014 Hi Divyesh, He is asking for the added total of the orders that are displayed in that page. So if the page has 10 orders, so the total should display only the added values of the 10 orders only not including the orders in the next page and other pages beyond. It should take in account of the page count and pagination. Link to comment Share on other sites More sharing options...
Divyesh Prajapati Posted January 9, 2014 Share Posted January 9, 2014 Ok, Got the point, will try at my side and update soon. 2 Link to comment Share on other sites More sharing options...
tomekmo Posted January 10, 2014 Share Posted January 10, 2014 Ok, Got the point, will try at my side and update soon. Hi Divyesh, He is asking for the added total of the orders that are displayed in that page. So if the page has 10 orders, so the total should display only the added values of the 10 orders only not including the orders in the next page and other pages beyond. It should take in account of the page count and pagination. Exactly! I'm sorry for my english. Link to comment Share on other sites More sharing options...
tomekmo Posted February 1, 2014 Share Posted February 1, 2014 Exactly! I'm sorry for my english. did you do? Link to comment Share on other sites More sharing options...
netplayer Posted February 5, 2014 Share Posted February 5, 2014 Sounds like a javascript solution would fit better here than a server-side one, implemented in a seperate module preferably. After filtered AdminOrders listing is loaded, call a jquery function which performs as follows: <Pseudocode> -Iterates over all orders totals fields currently visible on page. -Adds up prices in a field at the bottom. </Pseudocode> Sorry i can't post any actual code here as it has takes some work . Link to comment Share on other sites More sharing options...
tomekmo Posted February 10, 2014 Share Posted February 10, 2014 Sounds like a javascript solution would fit better here than a server-side one, implemented in a seperate module preferably. After filtered AdminOrders listing is loaded, call a jquery function which performs as follows: <Pseudocode> -Iterates over all orders totals fields currently visible on page. -Adds up prices in a field at the bottom. </Pseudocode> Sorry i can't post any actual code here as it has takes some work . Maybe someone else can help? Link to comment Share on other sites More sharing options...
joaowizard Posted February 20, 2014 Share Posted February 20, 2014 (edited) Hi; First of all make a back up of these files: /classes/controller/AdminController.php /classes/order/Order.php /YOUR_ADMIN/themes/default/template/helpers/list/list_footer.tpl After that replace each one of them with the file I post. I had to change the name (and extension) to the fpl file, 'cause I cant upload a tpl file in this forum, just have to rename the file to list_footer.tpl That's it. AdminController.php Order.php list_footer.tpl.txt Edited February 20, 2014 by joaowizard (see edit history) Link to comment Share on other sites More sharing options...
tomekmo Posted February 25, 2014 Share Posted February 25, 2014 Hi; First of all make a back up of these files: /classes/controller/AdminController.php /classes/order/Order.php /YOUR_ADMIN/themes/default/template/helpers/list/list_footer.tpl After that replace each one of them with the file I post. I had to change the name (and extension) to the fpl file, 'cause I cant upload a tpl file in this forum, just have to rename the file to list_footer.tpl That's it. Thank you very much. It works!!! Link to comment Share on other sites More sharing options...
tomekmo Posted February 25, 2014 Share Posted February 25, 2014 Sorry does not work well, there is a problem with sorting. Link to comment Share on other sites More sharing options...
joaowizard Posted February 26, 2014 Share Posted February 26, 2014 Sorry does not work well, there is a problem with sorting. HI .. what kind of problem? Link to comment Share on other sites More sharing options...
tomekmo Posted February 27, 2014 Share Posted February 27, 2014 Did not work sort: - display 10,20,50,100,300 - customer Link to comment Share on other sites More sharing options...
joaowizard Posted February 28, 2014 Share Posted February 28, 2014 Did not work sort: - display 10,20,50,100,300 - customer Click short item and then filter ... 'cause the total is depending of the filter button ... Link to comment Share on other sites More sharing options...
tomekmo Posted March 8, 2014 Share Posted March 8, 2014 Click short item and then filter ... 'cause the total is depending of the filter button ... Display only 50 products Link to comment Share on other sites More sharing options...
Stefand Posted July 4, 2014 Share Posted July 4, 2014 (edited) divyeshp solved my problem for version 1.6.0.8 Edited July 8, 2014 by Stefand (see edit history) 1 Link to comment Share on other sites More sharing options...
__fito__ Posted December 16, 2014 Share Posted December 16, 2014 Any idea to solve it in 1.6.0.9? Thank you! Link to comment Share on other sites More sharing options...
hannes01 Posted December 18, 2014 Share Posted December 18, 2014 Any idea to solve it in 1.6.0.9? Thank you! Hello, I would also appreciate this info, thanks! Link to comment Share on other sites More sharing options...
mrkprod Posted October 1, 2015 Share Posted October 1, 2015 Hello i was searching a long time a solution for this.... Finally, I did a very simple script in Javascript for show the total amount on order back office.This only sum all green prices (badge class) of the active pagination... (you must put 1000 orders by page for sum the maximum of your orders... In pages with more of 1000 orders dont work... Im know is a very poor solution... but for me work for the moment... and I think that possibly to other people with same problem. Tested on 1.6.1.1... not elegant solution... but solution... If someone want contrib to make this litle script better... hehehe. Give your feedback... Thanks Can you put the code on footer.tpl or any. CODE: <script language="javascript"> if (document.getElementsByClassName("badge").length != 0) { var res = document.getElementsByClassName("badge"); var total = 0.00; for (var i=1; i< res.length; i++) { clean = res.innerText; clean = parseFloat(clean.replace(",",".")); texto = total + " / " + clean; total = total + clean; } var midiv = document.createElement("div"); midiv.setAttribute("class","totalventa"); midiv.innerHTML = "<strong>TOTAL:</strong> <big><strong>"+parseFloat(total)+"</strong></big> €<br><small>No incluye pedidos cancelados o con error en el pago. Recordad mostrar todos los pedidos por página.<small>"; document.body.appendChild(midiv); var sheet = window.document.styleSheets[0]; sheet.insertRule('div.totalventa { position:fixed; top:10px; z-index:999999; padding:10px; background-color:#d4ffce;border-color:grey; border:1px; margin:50px 400px;}', sheet.cssRules.length); sheet.insertRule('div.totalventa:active { display:none;}', sheet.cssRules.length); if (!document.getElementById("page-header-desc-order-new_order")) { sheet.insertRule('div.totalventa { display:none;}', sheet.cssRules.length); } //alert(parseFloat(total)+" €\n\nNo incluye pedidos cancelados o con error en el pago. Recordad mostrar todos los pedidos por página.\n----------------------\n\n") } </script> Link to comment Share on other sites More sharing options...
__fito__ Posted November 11, 2015 Share Posted November 11, 2015 (edited) Hello i was searching a long time a solution for this.... Finally, I did a very simple script in Javascript for show the total amount on order back office.This only sum all green prices (badge class) of the active pagination... (you must put 1000 orders by page for sum the maximum of your orders... In pages with more of 1000 orders dont work... Im know is a very poor solution... but for me work for the moment... and I think that possibly to other people with same problem. Tested on 1.6.1.1... not elegant solution... but solution... If someone want contrib to make this litle script better... hehehe. Give your feedback... Thanks Can you put the code on footer.tpl or any. CODE: <script language="javascript"> if (document.getElementsByClassName("badge").length != 0) { var res = document.getElementsByClassName("badge"); var total = 0.00; for (var i=1; i< res.length; i++) { clean = res.innerText; clean = parseFloat(clean.replace(",",".")); texto = total + " / " + clean; total = total + clean; } var midiv = document.createElement("div"); midiv.setAttribute("class","totalventa"); midiv.innerHTML = "<strong>TOTAL:</strong> <big><strong>"+parseFloat(total)+"</strong></big> €<br><small>No incluye pedidos cancelados o con error en el pago. Recordad mostrar todos los pedidos por página.<small>"; document.body.appendChild(midiv); var sheet = window.document.styleSheets[0]; sheet.insertRule('div.totalventa { position:fixed; top:10px; z-index:999999; padding:10px; background-color:#d4ffce;border-color:grey; border:1px; margin:50px 400px;}', sheet.cssRules.length); sheet.insertRule('div.totalventa:active { display:none;}', sheet.cssRules.length); if (!document.getElementById("page-header-desc-order-new_order")) { sheet.insertRule('div.totalventa { display:none;}', sheet.cssRules.length); } //alert(parseFloat(total)+" €\n\nNo incluye pedidos cancelados o con error en el pago. Recordad mostrar todos los pedidos por página.\n----------------------\n\n") } </script> Hola! He insertado tu código en el footer.tpl del admin/themes/default/template/ pero nada cambia, no puedo ver el total. ¿dónde exactamente se debe insertar el texto, dentro del body, fuera? mi versión es la 1.6.1.2 Gracias! Edited November 11, 2015 by __fito__ (see edit history) Link to comment Share on other sites More sharing options...
mrkprod Posted November 18, 2015 Share Posted November 18, 2015 Hola! He insertado tu código en el footer.tpl del admin/themes/default/template/ pero nada cambia, no puedo ver el total. ¿dónde exactamente se debe insertar el texto, dentro del body, fuera? mi versión es la 1.6.1.2 Gracias! Hola fito. Yo tengo el script insertado justo antes del cierre </body> Link to comment Share on other sites More sharing options...
PrestaShark Posted December 17, 2015 Share Posted December 17, 2015 (edited) Hi. Any idea how to show total amount of customer orders in my-account.tpl ? Like Total amount of Your orders: xx,xxx Edited December 17, 2015 by PrestaShark (see edit history) Link to comment Share on other sites More sharing options...
scolink Posted October 17, 2016 Share Posted October 17, 2016 I got version 1.6.0.14 and this is not working on backoffice, can anyone help with this please how can i put the total orders in backoffice workin please ? Thanks André Link to comment Share on other sites More sharing options...
ukbaz Posted June 11, 2018 Share Posted June 11, 2018 Hi - am using 1.6.1.16 version - is there a fix for this? Many thanks Baz 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