News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

modify minichart layout

Started by The_nino, February 27, 2012, 16:56:38 PM

Previous topic - Next topic

The_nino

I know that this could sound a little bit silly but i can´t found the php file to modify the minicart.

I have found the file com_virtuemart\views\cart\tmpl\mini_cart.php but this only hava a pair of lines an not the info I want to edite:

x Products
Total X€
Show cart

Thank you very much in advance!

The_nino

I forgot to said that I am on Joomla 2.5 and VM 2.0.2

Thanks!

PRO

mod_virtuemart_cart/tmpl/default.php


The_nino


maxispin

I would like to see in the minicart shipping costs. I manually added them there because I didn't manage to figure out where the shipping cost value shown in the the Cart is stored or how to utilize that..

public_html/modules/mod_virtuemart_cart/tmpl/default.php

From row 27
<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>

[b]// SHIPPING COSTS[/b]

<div class="vm_cart_products">
<div class="container">
<?php foreach ($data->products as $product)
{
if ($show_price) { ?>

  <div class="prices" style="float: right;">1,85 €</div>
<?php ?>
<div class="product_row">
<span class="quantity">Shipping costs</span>
</div>
<?php if ( !empty($product['product_attributes']) ) { ?>
<div class="product_attributes"><?php echo  $product['product_attributes'?></div>

<?php }
}
?>

</div>
</div>


<?php ?>
VM 3.0.17.6 | VM 2.0.24c | VM 1.1.9

maxispin

Okey. I figured it out how to do that. A personal achievement for me.  ;D ;D ;D

public_html/modules/mod_virtuemart_cart/tmpl/default.php

This adds in the  mini-cart the shipment costs. Attached zipped default.php.

+Row 44

<?php if  ($data->totalProduct) { ?>
<div class="vm_cart_products">
<div class="container">
<div class="prices" style="float: right;"><?php echo $cart->prices ['shipmentValue']; ?>
</div>
<div class="product_row">
<span class="quantity"><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_SHIPPING'); ?></span>
</div>
<?php ?>
</div>
</div>


[attachment cleanup by admin]
VM 3.0.17.6 | VM 2.0.24c | VM 1.1.9

PRO

maxispin, this is good. BUT:::

It will not be updated via ajax.


maxispin

#7
Thanks for your comments BTp!

I have to say that I don't know ajax at all.
All, even tiny miny, hints / guidelines are welcomed from anyone.  I don't even know where ajax is stored (and what to modify where ever it is) :).


The below code improves the functionality of showing the shipping costs only when the stored shipmentValue is over 0.

Not using ajax.



<?php if  ($data->totalProduct) { ?>
<?php if  ($cart->prices['shipmentValue'] >0) { ?>


<div class="vm_cart_products">
<div class="container">
<div class="prices" style="float: right;"><?php echo $cart->prices ['shipmentValue']; ?>
</div>
<div class="product_row">
<span class="quantity"><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_SHIPPING'); ?></span>
</div>
</div>
</div>
<?php ?>
<?php ?>
VM 3.0.17.6 | VM 2.0.24c | VM 1.1.9

PRO


maxispin

I see. After inspecting the file quite extensively, I have to say that editing the vmprices.js is way over my skills at the moment. Let's see if I manage to figure out how that could be done.

# for the above code

Replace in the code shipmentValue with  salesPriceShipment

Thus it will show the shipping costs also with Tax.
VM 3.0.17.6 | VM 2.0.24c | VM 1.1.9