Author Topic: Changing minicart  (Read 2352 times)

Helene

  • Beginner
  • *
  • Posts: 8
Changing minicart
« on: July 15, 2010, 11:34:14 am »
Hello everyone,

I would like to change the virtuemart minicart for it look like this one: http://terminal-outlet.com/index.php

I think the owner of this website is on the forum, I searched but I didn't find the solution.

So I tried different solutions, such as this here: http://forum.virtuemart.net/index.php?topic=65855.msg217826

I changed it to have the information of empty basket and got several problems:

The image of the minicart does not display, even when it is empty. And I would like a link on the "X products" that leads to the basket. I don't know where adding the code.

Here is my code :

Code: [Select]
<?php if( !defined'_VALID_MOS' ) && !defined'_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
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'?>

    </div>
<?php }
else {
if(!
$vmMinicart) { ?>

    <hr style="clear: both;" />
<?php ?>
<div style="float: left;" >
<?php echo $total_products ?>
</div>
<div style="float: right;color:#1052b4;font-weight:bold;">
<?php echo $total_price ?><br></br><?php echo $show_cart ?>
</div></br><br style="clear: both;" />
<?php }
?>

Thank you.

Helene

rb

  • Advanced
  • Full Member
  • *****
  • Posts: 1503
Re: Changing minicart
« Reply #1 on: July 15, 2010, 14:08:03 pm »
The site you referenced uses RocketTheme's Mynxx:
http://www.rockettheme.com/joomla-templates/mynxx

Helene

  • Beginner
  • *
  • Posts: 8
Re: Changing minicart
« Reply #2 on: July 15, 2010, 15:15:17 pm »
Thank you.

I have my own template, and I don't want to change it. Is it possible to use only the mynxx vw template to have something like this ?

mrmvm

  • Beginner
  • *
  • Posts: 1
Re: Changing minicart
« Reply #3 on: July 15, 2010, 17:31:39 pm »
Hi Helene,
You should be able to cheat the system into displaying the same minicart using the code you started with in minicart.tpl.php which will force the minicart even if you are the cart module (note this is super hacking):

Code: [Select]
<?php if( !defined'_VALID_MOS' ) && !defined'_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' ); 
$vmMinicart true//add this line after above line

Then change the following line:
Code: [Select]
<?php if (!$empty_cart && !$vmMinicart) { ?>
To this:
Code: [Select]
<?php if (!$empty_cart) { ?>

You will now have just the quantity of items in the basket (or empty) and the show cart link. To add the image and/or pretty it up, you can simply use CSS to style the div that has class="vmCartModule" and its contents. If you want to have the giant VM image, then remove the lines/characters indicated below:

Code: [Select]
<?php if( !defined'_VALID_MOS' ) && !defined'_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
$vmMinicart true;
if(
$empty_cart) { ?>


    <div style="margin: 0 auto;">
    <?php if(!$vmMinicart) { //remove this entire line ?>
        <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 // remove this curly brace only on this line
    
echo $VM_LANG->_('PHPSHOP_EMPTY_CART'?>

    </div>
<?php }