VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: Engholm on March 15, 2013, 03:18:52 AM

Title: Cart Items Counter
Post by: Engholm on March 15, 2013, 03:18:52 AM
Hi,

I need to show the quantity of items of the cart (0 - xx) next to a cart Icon (as shown on the attached image). My PHP-knowledge unfortunately very limited  :-\ .

Has anybody a clue, for the relevant PHP parts, what exactly to include into the template?

Cheers,
Engholm

edit: Joomla 2.5.9/ VM 2.0.18a

[attachment cleanup by admin]
Title: Re: Cart Items Counter
Post by: PRO on March 15, 2013, 04:02:05 AM
you need to modify the

mod_virtuemart_cart


tmpl/default.php

this is my complete file

<?php 
//no direct access
defined('_JEXEC') or die('Restricted access');
?>
<div class="vmCartModule" id="vmCartModule"><div id="carticon" class="inline"></div><div class="total_products width59 inline"><?php echo  $data->totalProductTxt ?></div><div class="show_cart floatRight width40 bold"><?php if ($data->totalProduct) echo '<div class="floatRight">'. $data->cart_show .'</div>';?></div><div class="wrap"></div></div>


YOu can modify it with your css
http://forum.virtuemart.net/index.php?topic=90935.0

My code ONLY shows
1 icon
Total Products
The checkout link
Title: Re: Cart Items Counter
Post by: PRO on March 15, 2013, 04:02:45 AM
<?php echo  $data->totalProductTxt ?>

is the # of products
Title: Re: Cart Items Counter
Post by: Engholm on March 16, 2013, 00:11:54 AM
Thanks a lot! I'll try that next week.