• Resolved bt_dev

    (@biotrace)


    Hello, in a recent Woocommerce update, “quotes” are now added to the Attributes product filter widget placeholder.

    Is there a code snippet we can use to remove these “unnecessary” quotes?

    Thanks in advance!

Viewing 7 replies - 1 through 7 (of 7 total)
  • dougaitken

    (@dougaitken)

    Automattic Happiness Engineer

    Hi @biotrace

    “quotes” are now added to the Attributes product filter widget placeholder.

    I’ve tried to replicate what you’ve mentioned here but I’m unable to. Can you include a screenshot showing what you mean by quotes on the placeholder, please?

    Is it possible this is coming from your theme? Have you tried by using Live Preview of a default theme like Storefront?

    Let me know how you get on!

    Thanks,

    Thread Starter bt_dev

    (@biotrace)

    Hi Doug, thanks for your reply. I have attached a screenshot with the product filter widget circled, and you can see the “any indications” in quotes.

    Screenshot

    While using Woocommerce 3.46, the quotes did not display. Immediately after updating to 3.51 the quotes appeared in the widget.

    We are currently using BeTheme. I will test if the same behavior occurs with another default theme and report back.

    Best regards

    EDIT: The quotes do not appear when using Storefront theme, so BeTheme must have a different template depending on Woocommerce version. I will have to dig a little deeper and most likely have to edit the theme.

    Thanks for your help!

    • This reply was modified 6 years, 4 months ago by bt_dev.
    Plugin Support Hannah S.L.

    (@fernashes)

    Automattic Happiness Engineer

    Hey there!

    We’ve identified this as a bug and expect to see a fix in WooCommerce 3.5.2:
    https://github.com/woocommerce/woocommerce/issues/21935

    Thread Starter bt_dev

    (@biotrace)

    Good to know. Thanks for the update, Hannah!

    How can we manually override the Placeholder text? I’d also like to do this for the Product Categories widget, just for consistency.

    • This reply was modified 6 years, 1 month ago by JeffreyPia.
    Thread Starter bt_dev

    (@biotrace)

    Hi Jeffrey – I haven’t tested this personally, but give this filter a try:

    /**
     * Change product category dropdown placeholder text.
     *
     * Product category dropdown uses selectWoo/select2
     * that's why it's not possible to change the placeholder text using
     * woocommerce_product_categories_widget_dropdown_args filter hook.
     *
     * data-placeholder="" is select2 standard data api.
     *
     * @param string $html Dropdown html
     * @param array $args Dropdown setup arguments
     *
     * @return string Updated $html
     */
    add_filter( 'wp_dropdown_cats', function( $html, $args ) {
        if ( $args['taxonomy'] === 'product_cat' ) {
            $html = str_replace( '<select', '<select data-placeholder="Custom placeholder"', $html );
        }
        return $html;
    }, 10, 2);

    Hello,
    can you give me a code sample for the filter by attribute (not category) widget, please? I need to change the placeholder for the dropdown and I cannot find it anywhere. For instance if my attribute is color the placeholder is “Any color” and that’s not good for my case.

    Thanks

    Franco

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Attributes product filter widget: Placeholder “quotes”’ is closed to new replies.