SJF

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
May 25, 2017 at 1:03 pm
#58268
Member
SJF
OP

Thank you! This is exactly what I needed.

May 24, 2017 at 5:57 pm
#58213
Member
SJF
OP

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

May 22, 2017 at 6:35 pm
#58128
Member
SJF
OP

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

May 22, 2017 at 6:08 pm
#58121
Member
SJF
OP

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)