Author Topic: cart problem  (Read 682 times)

ener88

  • Beginner
  • *
  • Posts: 7
cart problem
« on: August 11, 2011, 10:57:13 am »
hi, im using virtuemart cart module and have a problem with "show cart" link. when cart is empty, it shows only "your cart is empty". And when there are items in cart, then its shows " 1x item = 10$ " and after that a link " show cart ".

Is it possible, that the link " show cart " is shown always, also when cart is empty?
Second question is that, can I  see that link " show cart" on top of the item list, that are in cart.
Like so:

With item:                       When empty:
 
1. " show cart "              1. " show cart "
2. " items in cart"           2. " your cart is empty"

MobiVM

  • Jr. Member
  • **
  • Posts: 267
    • Native Mobile Apps for VritueMart
Re: cart problem
« Reply #1 on: August 11, 2011, 11:34:35 am »
Hello,

You need to change in  file:-\components\com_virtuemart\themes\default\templates\common\minicart.tpl.

 <?php if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );

if (!$empty_cart && !$vmMinicart) { ?>
    <br/><br style="clear:both" /><div align="center">
    <?php echo $show_cart ?>
    </div><br/>

<?php }
if($empty_cart) { ?>
   
    <div style="margin: 0 auto;">
    <?php if(!$vmMinicart) { ?>
        <a href="http://virtuemart.net/" target="_blank">
        <img src="<?php echo $mm_action_url ?>components/com_virtuemart/shop_image/ps_image/menu_logo.gif" alt="VirtueMart" width="80" border="0" /></a>
        <br />
    <?php }
    //echo $VM_LANG->_('PHPSHOP_EMPTY_CART') ?>
    <?php echo $show_cart ?>
    </div>
<?php }
else {
    // Loop through each row and build the table
    foreach( $minicart as $cart ) {       

      foreach( $cart as $attr => $val ) {
         // Using this we make all the variables available in the template
         // translated example: $this->set( 'product_name', $product_name );
         $this->set( $attr, $val );
      }
        if(!$vmMinicart) { // Build Minicart
            ?>
            <div style="float: left;">
            <?php echo $cart['quantity'] ?>&nbsp;x&nbsp;<a href="<?php echo $cart['url'] ?>"><?php echo $cart['product_name'] ?></a>
            </div>
            <div style="float: right;">
            <?php echo $cart['price'] ?>
            </div>
            <br style="clear: both;" />
            <?php echo $cart['attributes'];
        }
    }
}
if(!$vmMinicart) { ?>
    <hr style="clear: both;" />
<?php } ?>
<div style="float: left;" >
<?php echo $total_products ?>
</div>
<div style="float: right;">
<?php echo $total_price ?>
</div>
<?php
echo $saved_cart;
?>

Let me know if any issue!

Best Regards,
Trivedi kartik.
Native mobile Apps for VirtueMart! Visit http://www.ivmstore.com

ener88

  • Beginner
  • *
  • Posts: 7
Re: cart problem
« Reply #2 on: August 11, 2011, 13:43:09 pm »
thx, I will try.