Modify basket summary to display total items?

djvern

Avatar: djvern

2008-05-21 12:54

Hi!

Is it possible to have the total number of items in the basket displayed in the basket summary, along with the total price? I know in Quickcart 1.x I just needed to include the $iCount variable and in Quickcart 3.x it's $iOrderProducts. Is there an equivalent variable in 2.2 as I've tried both of these and it doesn't work?

» Quick.Cart v2.x

Makaron

Avatar: Makaron

2008-05-22 09:55

Here is my updated function listBasket in core\orders.php

if( !function_exists'listBasket' ) ){
  
/**
  * Generate basket list
  * @return string
  * @param int    $iOrder
  * @param string $sFile
  */
  
function listBasket$iOrder$sFile 'orders_basket.tpl' ){
    global 
$tpl$aList;
    
    
$aData dbListBasket$iOrder );

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

      for( 
$i 0$i $iCount$i++ ){
        list( 
$aList['iElement'], $aList['iOrder'], $aList['iProduct'], $aList['iQuantity'], $aList['fPrice'], $aList['sProduct'] ) = $aData[$i];
        
        
$aList['iStyle'] = ( $i ) ? 01;
        
$aList['sStyle'] = ( $i == ( $iCount ) ) ? 'L'$i 1;

        
$aList['fSummary']  = tPrice$aList['iQuantity'] * $aList['fPrice'] );
        
$aList['iOrderProducts']  = $aList['iQuantity'];
        
$aList['sPrice']    = changePriceFormat$aList['fPrice'] );
        
$aList['sSummary']  = changePriceFormat$aList['fSummary'] );
        
        
$fSummary += $aList['fSummary'];
        
$iOrderProducts += $aList['iOrderProducts'];

        
$content  .= $tpl->tbHtml$sFile'LIST_LIST' );
      } 
// end for

      
$aList['iOrderProducts']  = $iOrderProducts;
      
$aList['fSummary'] = tPrice$fSummary );
      
$aList['sSummary'] = changePriceFormat$aList['fSummary'] );

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


It generate variable $aList[iOrderProducts] which You can display somwhere near the $aList[sSummary] in file temlates/orders_basket.tpl. Should work for me it's ok :)

FoTam74

No avatar

2008-05-22 10:22

Makaron says:

"somewhere near the $aList[sSummary]"

there's no such thing in the whole project: $aList[sSummary]. Where to put that variable you mentioned?

Q.C v3 - toyadesign.com/webshop

FoTam74

No avatar

2008-05-22 10:58

Sorry, I noticed it's about 2.x not 3.x!

Q.C v3 - toyadesign.com/webshop

djvern

Avatar: djvern

2008-05-22 17:38

That was just what I needed - works great, thanks Makaron!

Putta

Avatar: Putta

2010-09-01 13:12

Hi!

Same Questiong but I want version 3.6 Quick Cart
anybody help

Makaron

Avatar: Makaron

2010-09-01 15:43

In first post You have answer. In version Quick.Cart 3.x You have variable $iOrderProducts which You can use for example in file templates/menu_1.tpl in block LIST_BASKET.

Mak-Web.pl - Modyfikacje skryptów Q.Cart i Q.Cms

Putta

Avatar: Putta

2011-01-08 22:19

In first post You have answer. In version Quick.Cart 3.x You have variable $iOrderProducts which You can use for example in file templates/menu_1.tpl in block LIST_BASKET.

Hi Makaron from your answer i didn't get it on qc 3.6 , I'm blank right now!!! I not understand where I can insert your code and which file name should I modify
(I must update cod core/order.php? or how I have to do witn file templates/menu_1.tpl)

my website www.bemytrader.com

Back to top
about us | contact