• Resolved alansnell

    (@alansnell)


    Hi Folks

    I have the latest wordpress, woo canvas theme and woocommerce running locally on xampp and trying to rebuild my woocommerce shop.

    What I’d like to do is:

    On the product shop and product category pages I’d like to hide the product title, the “add to cart” button and hide the price.

    On certain shop category pages I’d like to have 2 columns and on others 3 columns.

    I have this already working on my live website using code supplied by woo ninjas but this is on wordpress 3.4.2, canvas commerce child theme and woocommerce 1.6.5.2

    If I try to apply this code to the updated software I’m now running locally it breaks the site.

    My live site for reference of what I’m trying to replicate with the updates is at:
    http://kingclassics.com/product-category/panoramic-canvas/
    http://kingclassics.com/product-category/framed-prints/

    I’d appreciate your help with some updated code.

    Many thanks

    Al

    https://ww.wp.xz.cn/plugins/woocommerce/

Viewing 1 replies (of 1 total)
  • Thread Starter alansnell

    (@alansnell)

    Worked it out, 3 columns on the site then 2 columns for three of the categories, this worked in the functions.php

    // Change columns in product loop to 3
    function loop_columns() {
    if ( is_product_category( ‘panoramic-canvas’, ‘mousemats’, ‘mugs’ ) ) {
    return 2;
    } else {
    return 3;
    }
    }

    add_filter( ‘loop_shop_columns’, ‘loop_columns’ );

    function woocustom_ninja_hook() {
    remove_action( ‘woocommerce_after_shop_loop_item_title’, ‘woocommerce_template_loop_price’, 10);
    remove_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’, 10);
    }
    add_action(‘init’, ‘woocustom_ninja_hook’);

    ————————————————————–
    and something like this in the custom.css

    ul.products li.product {
    width: 31%;
    margin-right: 2.8%;
    }

    .term-mousemats ul.products li.product, .term-mugs ul.products li.product, .term-panoramic-canvas ul.products li.product {
    width:47% !important;
    margin-right: 2.8% !important;
    clear: none; !important
    }

Viewing 1 replies (of 1 total)

The topic ‘Product category modifications’ is closed to new replies.