Showing Attributes on the Archives Page

Hello, I’m using a Wooswatch plugin and I want to show the colors attribute on the product archive page, but no matter what options I choose, before or after the price and title, the attributes are not displayed. Are there any solutions?

Hi Hasan,

I cannot say anything about WooSwatches, because I haven’t used it yet.
How did you build your archive? With the products element or the query loop? In both cases, you can (theoretically) use shortcodes to display the fields you want. As far as I can see WooSwatches supports shortcodes. Have you tried it using shortcodes?

Best regards,
timmse

Hi, @timmse ,

I display product attributes through fields. I output {post_terms_pa_color} but all I see on the archives page is just text attribute names, but I would like to see colored buttons.

Also, wooswatches doesn’t have a shortcode. When you add a new product, you have a tab where for each product you individually select which attribute you want to show on the product archive page. In my case, I wanted to show a selection of colors.

And I also didn’t find an option where you could customize the badges, color, background, etc.
You need more options to make under woocommerce, because you understand that people mainly install wordpress for the sake of woocommerce, but current themes are very large and slow, though because there is a lot of functionality and not always good code, but you have excellent chances to hit the jackpot with your builder on vue.js, which is damn good and very finely tuned for different devices. Why am I saying this?

Why is there still no off-canvas sidebar for product filters for example? After all, you well understand the share of the mobile market and there is growth. You need to sharpen your project for real needs.
You can tell me to install plugins for such needs, etc., but why should I install a plugin for the sake of a plugin? People came to you not to install a bunch of plugins, but to get the maximum tool where you can implement a store of any complexity that will also be well optimized.

Thank you and sorry for my English.

Hi Hasan,

just to make sure we’re talking about the same plugin: WooSwatches – WooCommerce Color or Image Variation Swatches by WooMatrix ?

The Plugin uses a hook to “inject” its functionality into the woocommerce archive template. It works using the default archive template, but it doesn’t work when using a custom template and I don’t know why yet :thinking:

I’ll reach out to our developers tomorrow and get back to you as soon as I know more.

Hi @timmse,

You are absolutely right, this is same plugin, and it works almost with all themes and bilders, and I was surprised why does not working with bricks.

Thank you. We will wait.

Hello @XaSs,

The plugin might be using one of the WooCommerce hooks to inject its content.

If you want to use the Bricks Products element, you need to add the WooCommerce hook to the fields, using a shortcode like this:

And then you would need to add to your child theme’s functions.php the following code, which will enable the shortcode [my_after_shop_loop_item_title] :

add_shortcode( 'my_after_shop_loop_item_title', function() {
    ob_start();
    do_action( 'woocommerce_after_shop_loop_item_title' );
    return ob_get_clean();
});

I don’t know exactly if the hook used by the plugin is the woocommerce_after_shop_loop_item_title but if not, you could easily adjust.

1 Like