News:

Support the VirtueMart project and become a member

Main Menu

How/Hide remove the Cart if it empty

Started by julifx, April 11, 2013, 12:17:25 PM

Previous topic - Next topic

julifx

How/Hide  remove the Cart if it empty ?

i know this  isthe right module code:

but cant ennough php

<div class="vmCartModule <?php echo $params->get('moduleclass_sfx'); ?>" id="vmCartModule">
<?php
if ($show_product_list) {
   ?>
   <div id="hiddencontainer" style=" display: none; ">
      <div class="container">
         <?php if ($show_price) { ?>
           <div class="prices" style="float: right;"></div>
         <?php } ?>
         <div class="product_row">
            <span class="quantity"></span>&nbsp;x&nbsp;<span class="product_name"></span>
         </div>

         <div class="product_attributes"></div>
      </div>
   </div>
   <div class="vm_cart_products">
      <div class="container">

      <?php
         foreach ($data->products as $product)
      {
         if ($show_price) { ?>
              <div class="prices" style="float: right;"><?php echo  $product['prices'] ?></div>
            <?php } ?>
         <div class="product_row">
            <span class="quantity"><?php echo  $product['quantity'] ?></span>&nbsp;x&nbsp;<span class="product_name"><?php echo  $product['product_name'] ?></span>
         </div>
         <?php if ( !empty($product['product_attributes']) ) { ?>
            <div class="product_attributes"><?php echo $product['product_attributes'] ?></div>

         <?php }
      }
      ?>
      </div>
   </div>
<?php } ?>

<div class="total" style="float: right;">
   <?php if ($data->totalProduct and $show_price) echo  $data->billTotal; ?>
</div>
<div class="total_products"><?php echo  $data->totalProductTxt ?></div>
<div class="show_cart">
   <?php if ($data->totalProduct and $show_price) echo  $data->cart_show; ?>
</div>
<div style="clear:both;"></div>

<noscript>
<?php echo JText::_('MOD_VIRTUEMART_CART_AJAX_CART_PLZ_JAVASCRIPT') ?>
</noscript>
</div>





jeeberpow

#1
I've given up messing with the code, because upgrading becomes a pain.
Worst case, make sure you have jquery in your template, then put this somewhere in your template or custom module:
jQuery(document).ready(function(){
   jQuery('#vmCartModule:contains("Cart empty")').hide();
});


Quote from: julifx on April 11, 2013, 12:17:25 PM
How/Hide  remove the Cart if it empty ?