D
D
DenimTornado2013-02-08 13:55:45
Drupal
DenimTornado, 2013-02-08 13:55:45

How to display a variable that contains the value "Total:" from the cart Ubercart 3, Drupal 7?

You need to display a variable in the block on the /cart page, so that later you can perform mathematical operations with it. I broke my whole head, how to get it out?
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
DenimTornado, 2013-02-11
@DenimTornado

And the casket just opened:

$items = uc_cart_get_contents();
$item_price = 0;
foreach ($items as $item) $item_price += ($item->qty * $item->price);

Special thanks for the merged karma.

D
DenimTornado, 2013-02-08
@DenimTornado

Thanks for the minus and karma, it is desirable to understand what is the reason?
ps I can get the value

<?php
print $table[3]['total']['#price'];
?>

Given that there are 3 products in the cart, how to do it without depending on the number of products?

V
volocuga, 2013-02-14
@volocuga

Great! Also minusanul

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question