Images in Basket ???

juhasz.jozsef

No avatar

2006-09-15 17:09

How can I place product images in the basket ???
I have the variable $aBasket[iProduct] the product id number right ? in file orders_basket.tpl
What is the varible name I can use as filename of product image (small)
QC 0.3

Thanks for the help.

treewood (OpenSolution)

Avatar: treewood

2006-09-16 09:56

juhasz.jozsef - this will be big modification. You need to open core/products.php and check throwProductsData() function. Check for part where is $aProducts['fotoSmall'] etc. and where is $aFoto = throwFirstPhoto( 1 );
You need to include files.php and files-ff.php in actions_client/orders.php and add part of code from throwProductsData() to listBasket().

jozsi

No avatar

2006-09-20 20:46

Ok found the parts you've mentioned...
but i've found the listBasket() function in /core/orders.php
trying to get $aBasket[fotoSmall]...$aBasket[fotoSmall]
am I going the right way ?
THX for you help.

added:
--at the top :
require_once DIR_CORE.'files.php';
require_once DIR_CORE.'files-ff.php';

--plus:
if( !function_exists( 'listBasket' ) ){
/**
* Wyswietlanie zawartosci basketa
* @return string
* @param int $iOrder
* @param string $sFile
*/
function listBasket( $iOrder, $sFile = 'orders_basket.tpl' ){
global $tpl, $aBasket;

$aData = dbListBasket( $iOrder );

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

$aProducts = throwProducts( );
$aFoto = throwFirstPhoto( 1 );

for( $i = 0; $i < $iCount; $i++ ){
list( $aBasket['fotoSmall'], $aBasket['iElement'], $aBasket['iOrder'], $aBasket['iProduct'], $aBasket['iQuantity'], $aBasket['fPrice'] ) = $aData[$i];

if( $i % 2 )
$aBasket['style'] = 'order_table_data_even';
else
$aBasket['style'] = 'order_table_data_odd';

if( isset( $aProducts[$aBasket['iProduct']] ) )
$aBasket['sName'] = $aProducts[$aBasket['iProduct']];
else
$aBasket['sName'] = null;

$aBasket['fotoSmall'] = $aFoto['iProduct'];

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

$fSummary += $aBasket['fSummary'];

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

$aBasket['fSummary'] = tPrice( $fSummary );

return $tpl->tbHtml( $sFile, 'LIST_HEAD' ).$content.$tpl->tbHtml( $sFile, 'LIST_FOOTER' );
}
else
return $tpl->tbHtml( $sFile, 'NOT_FOUND' );

Thx for your help...

Mike001

No avatar

2007-11-28 13:13

Jozsi, is your modification above working? I would like to show product pictures in the basket.
THX

stephano6

No avatar

2007-11-30 19:40

Hello

if you do not use the plug ATTRIBUTE you can use the code this address:
http://opensolution.org/Quick.Cart/forum/?p=readTopic&nr=4616

it works very well ....

stephano6

Back to top
about us | contact