How to create a Woo shop page, with a sidebar, displaying my categories

Hello Bengt,

I would suggest you please create two WooCommerce Archive layouts. You need to create one layout for the Shop and another one for the Product category. Now you need to assign the layout to the Shop and product category pages like this. Please have a look at the screenshot below.

Hope it helps
Thanks

Thanks
I have already tried this. For the category page it works perfect, but for the shop page I have problems displaying the 4 main categories. The shop page shows up with the sidebar, but there is no content in the area where it’s supposed to be the 4 categories. How do I assign this area? With a looper consumer or … ? I want to be able to design the appearance of the 4 main categories.

Hey @CyberBengt,

We would like to check your site settings if we can log in to your site. You can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
– Confirmation that we can access and make changes to your site

To know how to create a secure note, please check this out: How The Forum Works

imageYou can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
– Confirmation that we can access and make changes to your site

To know how to create a secure note, please check this out: How The Forum Works

image

Thanks.

Secure note is sent

Thank you for the info.

We tried to log in, but 2FA is enabled. Please provide the backup codes or disable 2FA temporarily.

Warm regards.

Codes are sent as secure note

Sorry for the confusion. I thought the backup codes would allow us to log in. Unfortunately, we don’t have access to the email support@theme.co , where 2FA is sending the login authentication code. Please disable 2FA temporarily.

OK, now the 2FA is disabled

Thank you for the update.

We adjusted the Looper Provider on the Webbutik page to display the product categories. We also modified the dynamic content templates to fetch the thumbnail_id and URL of the terms.

Please make sure to purge the cache before checking the page.

Best regards.

Hi

I noticed your changes: the looper provider in the row, the looper consumer set to All in the column 1 (in the row) and the dynamic content in the div’s below.

But something is not right. In Cornerstone I see two columns, with different content, both with the same name “column 1” inside the row. Has there been some kind of mix-up here?

And the display of my four main categories is not correct either. I want only these four categories to be visible, no others:

  • 1-fas transformatorer
  • Mättransformatorer
  • Tillbehör & Reservdelar
  • Övervakning & Kontroll

I want to reach the other subcategories through the widget in the sidebar, just as it works today. So I want my start page for my shop to contain the same as the default page for the store in WooCommerce (4 main categories), but with my design (with sidebar). Quite similar to what is on the old (current) website: https://unitrafo.se/butik/

Best regards
Bengt

Hello @CyberBengt,

You can change the Looper Provider from Current Terms to All Terms.

If you only want to display the parent categories, you might want to check out this old thread:

Or you might be interested on these threads as well:

Best Regards.

Hi,

I might have messed things up a bit. Could You please take a look and help me correct my settings, so I only see the 4 parent categories. I just want the page to look lige the old one: https://unitrafo.se/butik/

Best regards
Bengt

Thank you for the update.

Did you edit the functions.php file? We can’t login to the site because there’s an error generated in the file.

Parse error : Unclosed ‘{’ on line 31 in /home/xxxxx/test.xxxx.se/wp-content/themes/pro-child/functions.php on line 45

Please revert the site from a backup or post the FTP details in a secure note so we can correct the functions.php file.

Best regards.

Sorry for that. Now the functions.php is updated.

Best Regards
Bengt

Thank you for the update.

We adjusted the dynamic content in the elements, specifically the term thumbnail_id and term name.

Unfortunately, there is no option to select specific categories when using Looper Provider > All Terms. You may need to create a custom Looper Provider for this.

That’s a pity. I really like the possibilities in Pro, but it would be smooth to be able to filter out the top-level categories i the main shop page. I think many users would appreciate this function.

To achieve what I want, does it only require a change to the Looper Provider? Not the consumers or the dynamic content?
Is there a good instruction online for how to create a custom Looper Provider?

Best Regards

Yes, you only need to change the Looper Provider – the dynamic templates are already setup to consume category or term data.

We may alter the All Terms looper provider to allow users to select specific terms. Unfortunately, this has not been confirmed yet and is not available at the moment. If you want to learn more about custom loopers, please check this link: https://theme.co/docs/loopers#custom

Thank you for your patience.

Finally I’ve solved it.

I set the Looper Provider to “Custom”, the hook to “parent_cat” and left the params empty.

In the themes function.php I put this:

  add_filter('cs_looper_custom_parent_cat', function($result, $args) {
   
    $parent_cat_id = isset($args['parent_cat']);

    $parent_cat = cs_dynamic_content($parent_cat_id);
    $args = array(
        'parent'        => $parent_cat,
        'taxonomy'      => 'product_cat',
        'hide_empty'    => 1,
    );
    $categories = get_categories($args);
    return $categories;
}, 10, 2);

And now the page displays only my top level categories, just as I wanted it.

Best regards
Bengt

1 Like

Hello Bengt,

It is good to know that you have resolved your issue already. We really appreciate for sharing the information and the solution you have made.

Cheers.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.