[Resolved] WooCommerce archive not working upon creating layout for Pages
This thread is resolved. Here is a description of the problem and solution.
Problem:
The issue here is that the user's shop page Layout was not displaying the correct layout for the shop.
Solution:
The problem was that even though the shop should've been assigned to a default archive layout. The actual page that woocommerce uses for the archive was assigned to a different layout.
What was needed to be done was to edit that page and set the layout used to none.
This support ticket is created 6 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
I created WooCommerce shop archive, which was working, the url is: hidden link
The show archive is similar in layout as other archives, e.g.: hidden link
After that I set up layout for Pages (Layouts being used as templates for post types), and I noticed that the shop archive doesn't work any longer. Instead, a page with one product is shown. When I turn off the layout for Pages, the shop archive displays nothing... The single product pages works fine, e.g. hidden link
I've identified the issue. Its because of the Layouts for pages assigned to the offers page. What you need to do is to go to the backend and edit the offers page and set the layout for the page to none and then update the page.
I turned off the Layout for pages on the WooCommerce archive page, and:
1. on my live website (where I haven't downgraded WooCommerce) it didn't help, nothing except the header is shown: hidden link (even the admin top bar is not visible)
2. on my local website (with WooCommerce downgraded) it didn't help either, and I get the following error after this change:
Fatal error: Uncaught ArgumentCountError: Too few arguments to function Toolset_Compatibility_Theme_generatepress::remove_title(), 1 passed in xxx\wp-includes\class-wp-hook.php on line 286 and exactly 2 expected in xxx\wp-content\plugins\layouts\vendor\toolset\toolset-theme-settings\compatibility-modules\themes\wpddl.layouts-generate-press-theme.class.php:105 Stack trace: #0 xxx\wp-includes\class-wp-hook.php(286): Toolset_Compatibility_Theme_generatepress->remove_title('Offer') #1 xxx\wp-includes\plugin.php(203): WP_Hook->apply_filters('Offer', Array) #2 xxx\wp-content\plugins\wp-views\embedded\inc\wpv-shortcodes.php(2557): apply_filters('the_title', 'Offer') #3 xxx\wp-includes\shortcodes.php(319): wpv_shortcode_wpv_post_title(Array, '', 'wpv-post-title') #4 [internal function]: do_shortcode_tag(Array) #5 xxx\wp-includes\shortcodes.php(197): preg_replace_callback( in xxx\wp-content\plugins\layouts\vendor\toolset\toolset-theme-settings\compatibility-modules\themes\wpddl.layouts-generate-press-theme.class.php on line 105
Then I enabled Title in the Disable Elements of the layout Theme Options and it fixed the issue... (although the actual WooCommerce archive title comes from a layout row; the disable/enable option for the Title in the layout Theme Options doesn't hide/show this archive title).
I also noticed that when I enable Content Title for some CTP or Pages, and then disable it again, the Content Title is still there, e.g.: hidden link, hidden link (these pages have Content Title disabled in the Theme Options and a layout row displaying post title). I only could restore desired behavior that by creating new layout.
There's problem with displaying titles, as I mentioned earlier, the Theme Option > Disable Elements > Content Title doesn't seem to work for individual pages. E.g. take a look on the Layout for Pages layout > Disable Elements > Content Title and see, e.g. this page: hidden link
The page hidden link doesn't display the title too although the Disable Elements > Title is enabled, but I know that WooCommerce archive page title is some special case (so I use layout row to display the title there).
This probably would need separate ticket, but I continue it here as it resulted from my actions related to this topic.