Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!----------Woocommerce Code snippet----------->
- 1. At First Declare Global Woocommerce
- <?php global $woocommerce;?>
- 2. Iteams Dynamic:
- <?php echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count); ?> - <?php echo $woocommerce->cart->get_cart_total(); ?>
- 3. Get cart page link:<?php echo $woocommerce->cart->get_cart_url(); ?>
- 4. Get Checkout page link:<?php echo $woocommerce->cart->get_checkout_url()?>
- 5. Get my account page link:
- <!--My account page link-->
- <?php if ( is_user_logged_in() ) { ?>
- <a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php _e('My Account','woothemes'); ?>"><?php _e('My Account','woothemes'); ?></a>
- <?php }
- else { ?>
- <a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php _e('Login / Register','woothemes'); ?>"><?php _e('Login / Register','woothemes'); ?></a>
- <?php } ?>
- <!--End of my account page -->
- 6.Get Wishlist URL woocommerce:
- Must declared:<?php global $yith_wcwl;?>
- <?php $wishlist_name = get_option('yith_wcwl_wishlist_title');
- echo '<a href="' . $yith_wcwl->get_wishlist_url() . '" class="mpcth-wc-wishlist">' . $wishlist_name . '</a>';?>
- <!--- Various page URL on woocommerce-->
- http://www.skyverge.com/blog/get-woocommerce-page-urls/
- <!--Add to wishlist button--->
- http://www.remicorson.com/woocommerce-display-add-to-wishlist-button-on-shop-page/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement