Forum Replies Created
Viewing 4 posts - 1 through 4 (of 4 total)
Sorry — the above code apparently does not work because $cart_data[#] has a different # each time. Anyway to fix this?
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)