Hi all,
Just wondering if there is an easy way to call wp e-commerce session variables.
I basically want to have a real basic cart that only shows qty and total if the user isn't on a shop page.
cheers,
d
Hi all,
Just wondering if there is an easy way to call wp e-commerce session variables.
I basically want to have a real basic cart that only shows qty and total if the user isn't on a shop page.
cheers,
d
Never mind I solved it. Just had to find the right bits of the shopping_cart_functions.php file
D
FYI (note i haven't added shipping)
To get QTY
$cart = $_SESSION['nzshpcrt_cart'];
$cart_count = 0;
foreach((array)$cart as $item) {
$cart_count += $item->quantity;
}
echo $cart_count;
To get sub total
foreach($cart as $cart_item) {
$product_id = $cart_item->product_id;
$quantity = $cart_item->quantity;
$price = $quantity * calculate_product_price($product_id, $cart_item->product_variations,'stay',$cart_item->extras);
$total += $price;
}
echo nzshpcrt_currency_display(($total), 1);
I'm trying to the the same thing but I'm not fully following your code above, can someone help with the details? Thanks!
I believe this will give you what your looking for:
<?php echo(wpsc_cart_total()); ?>
<?php echo(wpsc_cart_item_count()); ?>
This topic has been closed to new replies.