VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: tsimpouri on April 18, 2013, 15:30:56 PM

Title: Display the total items in order
Post by: tsimpouri on April 18, 2013, 15:30:56 PM
Hello is it possible to display the total number of the products that someone order in cart page and in the order details?

For example:

Product 1  5       quantity
Product 2  10     quantity
Product3   5       quantity

The number will be 20

Thanks
Title: Re: Display the total items in order
Post by: AH on April 19, 2013, 09:58:49 AM
You would need to create your own view
Title: Re: Display the total items in order
Post by: Namit on April 20, 2013, 13:00:41 PM
You should use this code in place where you want to display it.
It shows number of items in cart or information "You don't have any items in the cart."


<?php 
    $array 
unserialize($_SESSION['__vm']['vmcart']); 
    if (
count($array->products) > 0) {
      foreach(
$array->products as $product){
          
$amount $product->amount;
          echo 
"You have $amount item(s) in the cart."
      }
    } else { 
     echo 
"You don't have any items in the cart."
    } 
?>

Title: Re: Display the total items in order
Post by: tsimpouri on April 21, 2013, 17:51:15 PM
Thank you very much that was what i was looking for ;)