News:

Looking for documentation? Take a look on our wiki

Main Menu

Display the total items in order

Started by tsimpouri, April 18, 2013, 15:30:56 PM

Previous topic - Next topic

tsimpouri

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

AH

You would need to create your own view
Regards
A

Joomla 4.4.5
php 8.1

Namit

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."
    } 
?>


tsimpouri

Thank you very much that was what i was looking for ;)