add product number to orders on admin

askadmin

No avatar

2009-01-13 22:29

We are using the short description section for the product number of our products. I want to have it displayed on the ordersMore section of the admin panel. Anyone able to point me in the right direction?

» Quick.Cart v2.x

David

treewood (OpenSolution)

Avatar: treewood

2009-01-14 08:26

You should edit core/orders.php and find function listBasket(). After this:
$aData = dbListBasket( $iOrder );
add:

if( !defined'CUSTOMER_PAGE' ) ){
  
$aProductsDesc $GLOBALS['oFF']->throwFileArraySmallDB_PRODUCTSnull0);      
}


After find this in listBasket() function:
$aList['iStyle'] = ( $i % 2 ) ? 0: 1;
add this code:

$aList['sDescription'] = !empty( $aProductsDesc[$aList['iProduct']] ) ? $aProductsDesc[$aList['iProduct']] : null;


Now you have to add variable: $aList['sDescription'] to templates/admin/orders_details.tpl somewhere in block: LIST_LIST

Works ok?

askadmin

No avatar

2009-01-15 18:20

not working yet.... here is my listBasket().. sDescription comes out blank so far.


function listBasket$iOrder$sFile 'orders_basket.tpl' ){
    global 
$tpl$aList;
    
    
$aData      dbListBasket$iOrder );
    
    if( !
defined'CUSTOMER_PAGE' ) ){
  
$aProductsDesc $GLOBALS['OFF']->throwFileArraySmallDB_PRODUCTSnull0);      
}

    if( isset( 
$aData ) ){
      
$iCount   count$aData );
      
$fSummary 0;
      
$content  null;

      for( 
$i 0$i $iCount$i++ ){
        list( 
$aList['iElement'], $aList['iOrder'], $aList['iProduct'], $aList['iQuantity'], $aList['fPrice'], $aList['sProduct'] ) = $aData[$i];
        
        if( 
$i )
          
$aList['iStyle'] = 0;
        else
          
$aList['iStyle'] = 1;
          
        
$aList['sDescription'] = !empty( $aProductsDesc[$aList['iProduct']] ) ? $aProductsDesc[$aList['iProduct']] : null;

        
$aList['fSummary']  = tPrice$aList['iQuantity'] * $aList['fPrice'] );

        
$fSummary +=  $aList['fSummary'];
        
$content  .= $tpl->tbHtml$sFile'LIST_LIST' );
      } 
// end for

      
$aList['fSummary'] = tPrice$fSummary );

      return 
$tpl->tbHtml$sFile'LIST_HEAD' ).$content.$tpl->tbHtml$sFile'LIST_FOOTER' );
    }
    else
      return 
$tpl->tbHtml$sFile'NOT_FOUND' );
  } 
// end function listBasket
}

David

askadmin

No avatar

2009-01-15 19:13

also, this is my LIST_LIST section in orders_more.tpl under templates/admin


<tr class="listbody_0">
  <
td>
    
$aList[sDescription]
  </
td>
  <
td class="label">
    
$aList[fPrice]
  </
td>
  <
td class="label">
    
$aList[iQuantity]
  </
td>
  <
td class="label">
    
$aList[fSummary]
  </
td>
</
tr>

David

askadmin

No avatar

2009-01-15 19:14

undid the top line back to

<tr class="listbody_$aList[iStyle]">




still no go

David

Back to top
about us | contact