Tutorial - how to display products images in the basket in Quick.Cart v5.0

treewood (OpenSolution)

Avatar: treewood

2012-03-31 08:15

1. Edit core/orders.php and find function listProducts()

a)
find: $oTpl = TplParser::getInstance( );
add code in next line: $oFile = Files::getInstance( );

b)
find: $aData['sPrice'] = displayPrice( $aData['fPrice'] );
add code in next line:

if( isset( $oFile->aImagesDefault[2][$aData['iProduct']] ) ){
  
$aDataImage $oFile->aFilesImages[2][$oFile->aImagesDefault[2][$aData['iProduct']]];
  
$oTpl->setVariables'aDataImage'$aDataImage );
  
$oTpl->setIf'IMAGE' );
}
else
  
$oTpl->setIf'NO-IMAGE' );


2. Edit templates/default/orders_step-1.tpl and in block PRODUCTS
find: <tr class="l$aData[sStyle]">
add code in next line:

<td class="image"><!-- IF:START IMAGE -->
  <
a href="$aData[sLinkName]"><img src="$config[dir_files]$aDataImage[iSizeValue1]/$aDataImage[sFileName]" alt="$aDataImage[sDescription]" /></a><!-- IF:END IMAGE --><!-- IF:START NO-IMAGE -->&nbsp;<!-- IF:END NO-IMAGE -->
</
td>


3. Edit templates/default/style.css
find: /* PLUGINS */
add code in next line:

#basket .image img{padding:1px;border:4px solid #e0e0e0;max-height:75px;}
#basket .image img:hover{border:4px solid #d5d5d2;}


Now you should see products images in basket. In the next step you need to add cells (<td></td>) in <thead> and <tfoot> that table look nice.

treewood (OpenSolution)

Avatar: treewood

2012-12-19 15:28

Tutorial "how to display products images in the basket" to Quick.Cart v6.0 is moved to plugin:
http://opensolution.org/download,en,18.html?sDir=Quick.Cart/plugins#imagesInBasket

arwena

Avatar: arwena

2023-09-12 09:57

For Quick.Cart v6+
In Orders.php you need to add this line:
<th>
<img src="'.DIR_FILES.'75/'.$aData['sName'].'.jpg">
</th>
before:
<th>
<a href="'.$aData['sLinkName'].'">'.$aData['sName'].'</a>
</th>
in function listProducts()
I know is not elegant and you need to names products in lowcase but im not a php programet, I just need this solution and i find a way like this.

Spider A.J.

Back to top
about us | contact