Pages:

New column

cachousam

Avatar: cachousam

2010-06-02 10:47

I would add a column in the Order Edit page(The summary of the order) .But I can not find the right value to insert

I tried this in template/admin/order.tpl:

<!-- BEGIN LIST -->
<tr class="l$aData[iStyle]">
<td class="id">
$aData[iOrder]
</td><td class="name">
<a href="?p=$aActions[f]-form&amp;iOrder=$aData[iOrder]">$aData[sFirstName] $aData[sLastName]</a>
</td><td class="email">
<a href="mailto:$aData[sEmail]">$aData[sEmail]</a>
</td><td class="phone">
$aData[sPhone]
</td><td class="company">
$aData[sCompanyName]&nbsp;
</td><td class="date">
$aData[sDate]
</td><td class="summary">
$aData[sOrderSummary]
</td><td class="status">

and


<td class="id">$lang['Id']</td>
<td class="name">$lang['First_and_last_name']</td>
<td class="email">$lang[Email]</td>
<td class="phone">$lang[Telephone]</td>
<td class="company">$lang[Company]</td>
<td class="date">$lang['Date']</td>
<td class="summary">$lang['Summary']</td>
<td class="status">$lang['Status']</td>
<td class="options">&nbsp;</td>
</tr>

But it not works

Thanks for your help

» Quick.Cart v3.x

beholder

Avatar: beholder

2010-06-02 12:37

How about changing the THEME for the page, you can find it in templates/themes/order.php
Also, not sure about it, but templates/container.tpl contains some order page template.

beholder

Avatar: beholder

2010-06-02 12:39

forget what I wrote, you want something else. Not sure what.

cachousam

Avatar: cachousam

2010-06-02 13:07

Here's what I want to do.

http://img143.imageshack.us/img143/8545/nouvellecolonne.jpg

I look on my side but I stumble on the right variable to put as I said above.

Thanks

cachousam

Avatar: cachousam

2010-06-02 15:53

If i put this variable in my new colomn:
$aData[sPhone] or $aData[iOrder] or $aData[sDate] or $aData[sPhone] ...... it is ok the display is good but not with $aData[sOrderSummary] ( no data are displayed)

Where is the problem

boboo

Avatar: boboo

2010-06-02 16:43

The $aData[sOrderSummary] is only temporary in the "$_session" variable for showing it during order process.
Additionally it is computed by clicking/opening OrderDetails for the Admin OrdersDetailsView. Temporary as well.
In this case, there is no possibility to show the Summary in the admins-list.
But, look here:
http://www.kimla.de/skupienie/forum_bilder/qc_kolumny.jpg
It is possible to do. Even more columns (like "poczta" - means delivery price).
Now, i go to holidays (few days), coming back on wednesday. If You are interested in the solution && spend some Euros, please contact me over:
http://skupienie.kimla.de/?kontakt,2

http://skupienie.kimla.de/?software-quickcart,106

beholder

Avatar: beholder

2010-06-02 20:31

Come on, Boboo, you want to charge for this? BTW, there is a 100% possibility to show summary price on the orders list. Cachousam, I have done that, it's an easy mod.


in core
/orders-admin.php under line:
$aData['sStatus'] = '<b>'.$aData['sStatus'].'</b>';
add:
$aData['sProductsList'] = $this->listProducts'orders.tpl'$aOrders[$i], 'PRODUCTS_' );
$aData['sOrderSummary'] = $this->aOrders[$aOrders[$i]]['sOrderSummary'];

in templates/admin/orders.tpl edit the template at block LIST and add the variable 
$aData

[sOrderSummary] (note - no apostrophes) anywhere you want in there.

And that's it. Thankfully, I have already tested something very similar and this should really work well.

boboo

Avatar: boboo

2010-06-02 21:22

Oh, Beholder, for this solution You presented here, i would not even think about a fee.
But did You already make a test with changing prices of products?
Let's say, we sold 10 pieces a 10 $ = 100$ (today).
The order value is 100$
So far, so good.
The question: what will show the OrderSummary after changing of price of products in the shop?

http://skupienie.kimla.de/?software-quickcart,106

cachousam

Avatar: cachousam

2010-06-02 21:39

Thanks beholder
i test it tomorrow

boboo

Avatar: boboo

2010-06-02 21:49

Upps,
excuse me, i was already with my mind in holidays.
The price in column doesn't change, when changing a product price.

In my solution i solved this (because of additional features) saving the orderSummary, weight and others in the database.

http://skupienie.kimla.de/?software-quickcart,106

cachousam

Avatar: cachousam

2010-06-02 22:46

The solution above dont work with me.
Where can i have made a mistake?

beholder

Avatar: beholder

2010-06-03 14:07

boboo: that's not the way to do it right in this case.

cachousam: you're right, one line was missing from my original patch. Here is the whole code once again:


in core
/orders-admin.php under line:
$aData['sStatus'] = '<b>'.$aData['sStatus'].'</b>';
add:
$this->aOrders[$aOrders[$i]]['fPaymentCarrierPrice'] = generatePrice$aData['fCarrierPrice'], $aData['sPaymentPrice'] );
$aData['sProductsList'] = $this->listProducts'orders.tpl'$aOrders[$i], 'PRODUCTS_' );
$aData['sOrderSummary'] = $this->aOrders[$aOrders[$i]]['sOrderSummary'];

in templates/admin/orders.tpl edit the template at block LIST and add the variable 
$aData
[sOrderSummary] (note no apostrophesanywhere you want in there.

cachousam

Avatar: cachousam

2010-06-04 08:05

Thank you beholder.
Now we have a display of result, but it is false.
Look at the picture. On all the page, there are only 3 or 4 different results.
I wish that my orders are to grosses!!!But is only the first line which is good.
It seems that the script uses the wrong variable.
Thank you for your help.

cachousam

Avatar: cachousam

2010-06-04 08:11

Excuse me, i have forget the links of the image.

http://img248.imageshack.us/img248/5830/20100604080708.jpg

beholder

Avatar: beholder

2010-06-04 18:44

you're right, one more line was missing. You wouldn't believe how difficult it is to approximate two sets of code that are very similar but still different from each-other. Here is the whole code once again:


in core
/orders-admin.php under line:
$aData['sStatus'] = '<b>'.$aData['sStatus'].'</b>';
add:

if (isset(
$this->aProducts )) unset($this->aProducts);
$this->aOrders[$aOrders[$i]]['fPaymentCarrierPrice'] = generatePrice$aData['fCarrierPrice'], $aData['sPaymentPrice'] );
$aData['sProductsList'] = $this->listProducts'orders.tpl'$aOrders[$i], 'PRODUCTS_' );
$aData['sOrderSummary'] = $this->aOrders[$aOrders[$i]]['sOrderSummary'];

in templates/admin/orders.tpl edit the template at block LIST and add the variable 
$aData
[sOrderSummary] (note no apostrophesanywhere you want in there.

cachousam

Avatar: cachousam

2010-06-05 09:01

Beholder.
I bow before you.All works perfectly.
I 'had tried a lot of copy and paste between different files, but without result.
The php is a science.
Cachousam as dominique

cachousam

Avatar: cachousam

2010-06-19 15:31

I wish to display this variable on the homepage of admin after the name of a new order.
I tried to paste this code everywhere in core/order-admin.php in the function listOrdersLastLog but without result.
Of course I put this variable in template/admin/container.tpl
Thanks for your help

boboo

Avatar: boboo

2010-06-19 16:03

Pasting the variable "sOrderSummary" in the admins-homepage will bring nothing.
Because it (variable: sOrderSummary) will be filled with any value, AFTER you called "listOrdersAdmin" in: orders-admin.php
But during the process of "log-in" the function "listOrdersLastLog" is responsible for checking last orders. And this function has no queries for Prices or OrderSummaries.

Try to change the "listOrdersLastLog"-function, putting into the procedure described by Beholder.

http://skupienie.kimla.de/?software-quickcart,106

cachousam

Avatar: cachousam

2010-06-19 19:53

Hi boboo.
In my post above i have said that i have try your solution without résult.
I have made a paste like this in files core/order-admin.php:

function listOrdersAdmin( $sFile, $iList = null ){
if( !isset( $this->aOrders ) )
$this->generateCache( );
$oTpl =& TplParser::getInstance( );
$oFile =& Files::getInstance( );
$content= null;
if (isset($this->aProducts )) unset($this->aProducts);
$this->aOrders[$aOrders[$i]]['fPaymentCarrierPrice'] = generatePrice( $aData['fCarrierPrice'], $aData['sPaymentPrice'] );
$aData['sProductsList'] = $this->listProducts( 'orders.tpl', $aOrders[$i], 'PRODUCTS_' );
$aData['sOrderSummary'] = $this->aOrders[$aOrders[$i]]['sOrderSummary'];

and many other tests but it dont works

boboo

Avatar: boboo

2010-06-20 10:25

OK,
I hope the function "listOrdersLastLog" in the /core/orders-admin.php
is as it was at the beginning.
Add:
global $config;
after global $lang;

Then add the lines (written by Beholder):
if (isset($this->aProducts )) unset($this->aProducts);
$this->aOrders[$aOrders[$i]]['fPaymentCarrierPrice'] = generatePrice( $aData['fCarrierPrice'], $aData['sPaymentPrice'] );
$aData['sProductsList'] = $this->listProducts( 'orders.tpl', $aOrders[$i], 'PRODUCTS_' );
$aData['sOrderSummary'] = $this->aOrders[$aOrders[$i]]['sOrderSummary'];

Under the line:
for( $i = 0; $i < $iCount; $i++ ){

(we still working in the "listOrdersLastLog"-function!)
Now expand the arguments in the "setVariables(.....)"
At the end in setVariables you have:
setVariables(... $aOrder['sFirstName'].' '.$aOrder['sLastName']))
change it to:
setVariables(... $aOrder['sFirstName'].' '.$aOrder['sLastName'].' --- '.$aData['sOrderSummary'].' '.$config['currency_symbol'] ) );

And now the line on admins-page with new order looks like (example):
2010-06-20 09:37 Id 142, Jonh MacEnroe --- 317.00 EUR

You don't need to change anything in container or another templates. Only the function "listOrdersLastLog" in core/orders-admin.php will be touched.

http://skupienie.kimla.de/?software-quickcart,106

Pages:
Back to top
about us | contact