hi got it working now
do these changes in following files
add this code to header_php.php
in here
zen\includes\modules\pages\shopping_cart
afte line 162 with in the loop.
PHP Code:
$_SESSION['tip'][$i] = array('attributeHiddenField'=>$attributeHiddenField,
'flagStockCheck'=>$flagStockCheck,
'flagShowFixedQuantity'=>$showFixedQuantity,
'linkProductsImage'=>$linkProductsImage,
'linkProductsName'=>$linkProductsName,
'productsImage'=>$productsImage,
'productsName'=>$productsName,
'showFixedQuantity'=>$showFixedQuantity,
'showFixedQuantityAmount'=>$showFixedQuantityAmount,
'showMinUnits'=>$showMinUnits,
'quantityField'=>$quantityField,
'buttonUpdate'=>$buttonUpdate,
'productsPrice'=>$productsPrice,
'productsPriceEach'=>$productsPriceEach,
'rowClass'=>$rowClass,
'buttonDelete'=>$buttonDelete,
'checkBoxDelete'=>$checkBoxDelete,
'id'=>$products[$i]['id'],
'attributes'=>$attrArray);
by adding this code you will have whole product array in your session array and you can access this any where in the cart.
now you have to access this array in header so in tpl_header.php
zen\includes\templates\your_template_directory\common
if this file is not here then copy one from defalut template directory and create a common folder in your template diretory paste it in there and you can access this whole array there like this
PHP Code:
$tempProduct=$_SESSION['tip'];
foreach($tempProduct as $product)
{
$proName=$product['productsName'];
$proPriceEach=$product['productsPriceEach'];
$proImg=$product['productsImage'];
$proQty=$product['showFixedQuantityAmount'];
$proAttribs=$product['attributes'];
?>
<tr>
<td colspan="5"><?php echo $proName;?></td>
</tr>
<tr>
<td rowspan="2" id="balloonProImg">
<?php
$src=htmlentities($proImg,ENT_NOQUOTES);
$s = explode(" ", $src);
$s =explode ("=",$s[1]);
$img= $s[1];
$pat = '/(^"+|"+$)/';
$imgWOQ=preg_replace( $pat, '', $img );
$imgWH = getimagesize($imgWOQ);
$percent=0.10;//10%
$width=round($imgWH[0]*$percent);
$height=round($imgWH[1]*$percent);
echo "<img src=\"$imgWOQ\" width=\"$width\" height=\"$height\"/>";
?>
</td>
<td>Qty</td>
<td>Color</td>
<td>Size</td>
<td>Total</td>
</tr>
<tr>
<td><?php echo $proQty;?></td>
<?php
$count=count($proAttribs);
for($i=1; $i<=$count; $i++)
{
$allAttribs=$proAttribs[$i];
//print_r($indProduct);
$productOption=$allAttribs[products_options_name];
$productVal=$allAttribs[products_options_values_name];
//echo $productVal;
echo "<td >$productVal</td>";
}
?>
<td><?php echo $proPriceEach; ?></td>
</tr>
<tr><td> </td></tr>
<?php
}
?>
</table>
and this is my code of tooltip
<script type="text/javascript">
new Tip('bag',$('divText'), {
title : 'Your Shopping Bag Has</br><strong><?php echo sizeof($_SESSION['cart']->get_products()); ?> </strong> Item(s) <?php echo $currencies->format($_SESSION['cart']->show_total());?> ',
//ajax: { url: 'includes/templates/template_default/sideboxes/tpl_shopping_cart.php', options: { onComplete: function(transport) {/*write your code*/} } },
style:'darkgrey',
hideOn: { element: '.close', event: 'click'},
closeButton: true,
hook: { target: 'topMiddle', tip: 'bottomRight' },
stem: 'topRight',
offset: { x: -7, y: 135 }
});
</script>
for this you will need to read
http://www.nickstakenburg.com/projects/prototip2/
now as you are adding products to $_SESSION array and able to view it in virtually any where, what about if any product is deleted form shoppingcart then if wont refresh the $_SESSION array so for this you need an other change
in
zen\includes\classes
PHP Code:
after line no.553 after the if condition but in the remove fucntion
foreach ( $_SESSION['tip'] as $key => $value )
{
if ( in_array( $products_id, $value) )
{
unset( $_SESSION['tip'][$key] );
echo 'unseted//';
}
}
after this you will have a session arry $_SESSION['tip'] array which updates it self with all the changes.
ok guys this method works for me you can change it for you need
it might have any problem but non that i am aware of
hope this help any one out there
regards
salman sadiq