Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Forum: Plugins
    In reply to: WooCommerce Cart Total

    I suggest you don’t put Cart with wordpress menu, you put the native menu items, and code the menu item “cart” after that…

    Forum: Plugins
    In reply to: WooCommerce Cart Total

    you declare it where ever you want, just make sure it’s first before any code that depends on it… i.e : <?php echo sprintf(_n(‘%d item’, ‘%d items’, $woocommerce->cart->cart_contents_count, ‘woothemes’), $woocommerce->cart->cart_contents_count);?>

    Forum: Plugins
    In reply to: WooCommerce Cart Total

    I got here from google, and found your link ( THANK YOU )

    in case you didn’t get it to work, or anyone came from google, here is how :

    you have to declar this first : <?php global $woocommerce; ?> //required !!!!

    And then put this wherever you want the total number of items to appear :

    <?php echo sprintf(_n(‘%d item’, ‘%d items’, $woocommerce->cart->cart_contents_count, ‘woothemes’), $woocommerce->cart->cart_contents_count);?>

    if someone want to print the total ( $ ) like me you can put this code :

    <?php echo $woocommerce->cart->get_cart_total(); ?>

    and here is the cart url too :
    <?php echo $woocommerce->cart->get_cart_url(); ?>

    So play with this as you see fit , any questions please do ask 🙂

    Thank you again croberts1

Viewing 3 replies - 1 through 3 (of 3 total)