SJF

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
in reply to: Show Cart Quantity in Menu (like this site) #58268

SJF
Member

Thank you! This is exactly what I needed.

in reply to: Check if already downloaded or purchased? #58213

SJF
Member

@Shahriar — THANK YOU! This is exactly what I needed!

in reply to: Show Cart Quantity in Menu (like this site) #58128

SJF
Member

Sorry — the above code apparently does not work because $cart_data[#] has a different # each time. Anyway to fix this?

in reply to: Show Cart Quantity in Menu (like this site) #58121

SJF
Member

I have used the following code to accomplish this…

PHP:

$cart_data = wpdmpp_get_cart_data(); 
if($cart_data[4]['quantity'] >= 1){
    $cart_qty = $cart_data[4]['quantity'];
}else{
    $cart_qty = 0;
}

Script:

    jQuery(function($) {
        $(document).ready(function() {
            $('.cart-nav span').text('<?php echo($cart_qty); ?>')
        });
    });

And in my menu navigation link to the shopping cart I simply put <span> tags around a 0 for default. I would like a better way of doing this if possible.

Viewing 4 posts - 1 through 4 (of 4 total)