Woocommerce new shop page

Personally i would create a custom template and not use page.php and add a simply product loop Quick break down create new template called customshop.php <?php /* Template Name: Custom Shop */ ?> add your shop loop <ul class=”products”> <?php $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => 12 ); $loop = new WP_Query( $args … Read more

Add addtional page parameter before loading the page

Set a variable $product_view=isset($_GET[‘product_view’]) ? $_GET[‘product_view’] : ‘grid’; Now, how to keep it like this with pagination URL’s. echo paginate_links(array( ‘base’ => add_query_arg(‘product_view’, $product_view), ‘format’ => ”, ‘prev_text’ => __(‘&laquo;’), ‘next_text’ => __(‘&raquo;’), ‘total’ => ceil($total / $items_per_page), ‘current’ => $page, ‘add_args’ => array( ‘category’ => ‘fruit’, ‘color’ => ‘red’ ) )); I hope this … Read more

How to distinguish pages created by woocommerce?

You can use conditional tags or function wc_get_page_id(‘page_name’), where page_name can be: ‘myaccount‘, ‘shop‘, ‘cart‘, ‘checkout‘, etc. For example: Using is_cart() you can check whether the current page is a cart page. Using wc_get_page_id( ‘cart’ ); you will receive ID of cart page. Which way is more suitable for your code you have to decide … Read more