This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

Change Category Widget default text “Select a Category”

Resolved 6 replies pluginplugin-page-builder

Refer to thread tile subject, appreciate you can offer a snippets/solution to workaround for mobile and desktop view.

Lots WooCommerce user was struggle around have split/exclude/specific category on each WC Product Category Widget (not to using custome menu) at non-WC pages. With Page Builder I had success hided selective product category with page builder to builder landing page BUT I am stuck at the widget default text “select a category”.

How to I change the default text for EACH WC Product Category Widget. Attached photo for you perusal http://awesomescreenshot.com/0bf3669fcb

This is our free support forum. Replies can take several days.

Need fast email support? Get SiteOrigin Premium

Replies

6
  1. Andrew Misplon Staff 11 years, 7 months ago

    Hi Kingston

    Please can you confirm for me which widget/s you’re running in that screenshot.

    It unfortunately wouldn’t be possible to edit a widget without custom development – the only solution I can think of here is to run another widget that perhaps has different behaviour.

  2. Kingston Tan (Watch Teller) 11 years, 7 months ago

    Use WooCommerce Product Category Widget.

    I have snippets to change WordPress default category widget “Select a Category” text. I had modify with WooCommerce hook & filter but not work (may be was non-WooCommerce Pages).

    If not I have abandon WC Product Category Widget, to custom menu but I need dropdown effect to make it like zappos[.]com mobile site.

    Appreciate you have any workaround/suggestions?

  3. Andrew Misplon Staff 11 years, 7 months ago

    Can you perhaps paste in your child theme functions.php file so I can see how you’ve attempted to change the text of the WooCommerce widget?

    Please see the note below the comment box regarding wrapping code.

    Thanks

  4. Kingston Tan (Watch Teller) 11 years, 7 months ago
    function _category_dropdown_filter( $cat_args ) {
            $cat_args['show_option_none'] = __('My Category');
            return $cat_args;
    }
    add_filter( 'widget_categories_dropdown_args', '_category_dropdown_filter' );

    chnage the WC hook & filter as below:

    if(!is_admin() && is_page(3061) && is_active_widget(panel-3061-0-0-0)){
    function art_architecture_textbooks( $cat_args ) {
            $cat_args['show_option_none'] = __('Art & Architecture');
            return $cat_args;
    }}
    add_filter( 'woocommerce_product_categories_widget_args', 'art_architecture_textbooks' );
    apply_filters( 'woocommerce_product_categories_widget_args','art_architecture_textbooks' );
    function art_architecture_textbooks( $list_args ) {
            $list_args['show_option_none'] = __('Art & Architecture');
            return $list_args;
    }
    apply_filters( 'woocommerce_product_categories_widget_args','art_architecture_textbooks' );
    function art_architecture_textbooks( $cat_args ) {
            $cat_args['show_option_none'] = __('Art & Architecture');
            return $cat_args;
    }

    Any suggestion of plugin and snippets welcome.

  5. Andrew Misplon Staff 11 years, 7 months ago

    Hi Kingston

    Sorry, I had a look at this and couldn’t see a way through. Perhaps posting on the WooCommerce forum might be helpful.

    Wish I had more here.

    Good luck.

  6. Kingston Tan (Watch Teller) 11 years, 7 months ago

    Thanks.

Replies on this thread are closed.

Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Have a different question or issue?

Start New Thread