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

Back to top
about us | contact