Home>Support>Change Category Widget default text “Select a Category”

Change Category Widget default text “Select a Category”

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. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 7 years, 6 months ago Andrew Misplon Hi, I Work Here

    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. 7 years, 6 months ago Kingston Tan (Watch Teller)

    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. 7 years, 6 months ago Andrew Misplon Hi, I Work Here

    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. 7 years, 6 months ago Kingston Tan (Watch Teller)
    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. 7 years, 5 months ago Andrew Misplon Hi, I Work Here

    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. 7 years, 5 months ago Kingston Tan (Watch Teller)

    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.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More