Hello, I would like to see the amount of each order in the list of orders in the Admin panel. I managed to create space in the title of the list by editing the template file / admin / order.php and inserting the following line:
In the listOrdersAdmin function directly under the "for" statement there is a line:
$aData = $this->aOrders[$aOrders[$i]];
Exactly under this line we will calculate the order-summary using the generateProducts function:
$this->generateProducts($aData['iOrder'])
This function writes the order-summary into the class-variable "$this->fProductsSummary". Now You can create a new "<td>" in the "content.=..." line and put as content this class-variable. Something like this:
<td>'.$this->fProductsSummary.'</td>
The title of the column You have already created in You first post. The fProductsSummary does NOT contain the payment and shipping costs.
Thank you boboo. It works perfectly. I thought that when an order was recorded, all data were stored in a file, and it sufficed to get them and post them where you want. Apparently this is not really the case. For example, if I wanted to display the order total with shipping would it be possible?
I ask this because I created a variable purchase price in the page products editing and I will try with a formula to calculate the total margin on each order. The display will also in the page orders editing and perhaps somewhere else.
So I would like to know a little more where the data is stored.
"So I would like to know a little more where the data is stored." Then look into _fields.php in database folder. There You can see where which variable is saved. Ordered products and their prices in orders_products; payments, shipping, comments in orders_ext.
The best way to calculate the total margin of order is to save the purchase price into the orders_products db, together with sales price. So You can avoid mistakes if the price has been changed by editing product.
And, if You really like the script, so trust me, it is a very good evening lecture in bed, instead of Harry Potter or sth else :-)
oh yes. I really like this script .I use it since version 3. I do not have your knowledge, but I am very proud and after many hours of work and research,copy, paste, use notepad+ ,i have managed to make some very nice sites. I do not like reading the harry potter style!!!!! Very soon if I can do what I said in the third post. Thank you also to those who share their knowledge. Dominique from France.
Hello to all. I come to you because I still can not get to run this function. I'm not a slacker, and you see that when I ask for help, it was after many try by myself. Please help me. This would allow me to know a little more of the structure of this wonderfull CMS. I still believe in helping others. Dominique
If I understand correctly, this piece of code I had created as described above in the file core/products-admin.php, in the public function saveProducts ,i must place it elsewhere too. Can you tell me where and if my second function public function calculmarginorder is the good?
This function is in my opinion unnecessary. If You save the fPurchasePrice into Products_DB and over the Basket into Orders_Products_DB, so instead of calling 2 functions in the loop (for($i=$aKeys...)):
just put the functionality into the generateProducts function. Analyse how this function fills the variables, and just add a new one e.g.:fMargin=fPrice-fPurchasePrice. This shall be faster, beacause generateProducts reads already the orders_products_db, so if you have saved the fPurchasePrice into this DB, you have the direct access to this value, without reading the file once more.