Woocommerce issues: sidebar, header, layout

Hi there
I have followed the various forum threads, but can’t find resolution.
The theme settings are correctly setup (sidebar left, content right). and I can confirm that the sidebar is appearing on other pages throughout the site, but the shop, product, and category pages are all not displaying the sidebar.

I tested setting up custom sidebars for the various product categories, and adding their own widgets, but that didn’t get me any further.

Additionally:

  • the header is displaying differently on shop pages to other pages, and dropdown menus aren’t displaying
  • the ‘sort by’ function isn’t working
  • individual products are displaying full width
  • related products are not displaying

Please advise on how to resolve these issues.

note - we are not running the latest version of WooCommerce, and are not prepared to upgrade at this point; there is a lot of customisation built into WC, and our efforts to upgrade resulted in a set of errors we’re not yet prepared to tackle; these issues appear to be unrelated, as they were still there post upgrade

Hello There,

Thanks for writing in! I have inspected the pages and it seems that there is a fatal error which is why the sidebar and the rest of the page elements were not loaded. Could you please enable the debug mode? You can do this by opening wp-config.php and adding


define('WP_DEBUG', true);

/* That's all, stop editing! Happy blogging. */

When you revisit the page, you should have some error output describing the fatal error issue in more detail.

Please let us know how it goes.

Hi there - debug mode is active, and we have installed the debug bar. Unfortunately, I cannot see any errors on the shop or category pages due to the theme not presenting the admin bar. I can confirm that when switching the site to the default 2017 theme that there are no bugs appearing in the debug bar. These are the three warnings I see from this URL https://soulsong.icologi.com/product/bolster-yoga-bundle/

Other products are showing only the latter two errors.

NOTICE: wp-content/plugins/woocommerce/includes/wc-template-functions.php:1146 - Function woocommerce_sort_product_tabs() expects an array as the first parameter. Defaulting to empty array.
require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(’/themes/pro/woocommerce.php’), x_get_view, X_View_Router::render, include(’/themes/pro/framework/views/integrity/woocommerce.php’), woocommerce_content, wc_get_template_part, load_template, require(’/plugins/woocommerce/templates/content-single-product.php’), do_action(‘woocommerce_after_single_product_summary’), WP_Hook->do_action, WP_Hook->apply_filters, woocommerce_output_product_data_tabs, wc_get_template, include(’/themes/pro/woocommerce/single-product/tabs/tabs.php’), apply_filters(‘woocommerce_product_tabs’), WP_Hook->apply_filters, woocommerce_sort_product_tabs, trigger_error

NOTICE: wp-content/themes/pro/woocommerce/single-product/related.php:13 - Undefined variable: related_products
require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(’/themes/pro/woocommerce.php’), x_get_view, X_View_Router::render, include(’/themes/pro/framework/views/integrity/woocommerce.php’), woocommerce_content, wc_get_template_part, load_template, require(’/plugins/woocommerce/templates/content-single-product.php’), do_action(‘woocommerce_after_single_product_summary’), WP_Hook->do_action, WP_Hook->apply_filters, x_woocommerce_output_related_products, woocommerce_related_products, wc_get_template, include(’/themes/pro/woocommerce/single-product/related.php’)

NOTICE: wp-content/themes/pro/woocommerce/single-product/up-sells.php:13 - Undefined variable: upsells
require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(’/themes/pro/woocommerce.php’), x_get_view, X_View_Router::render, include(’/themes/pro/framework/views/integrity/woocommerce.php’), woocommerce_content, wc_get_template_part, load_template, require(’/plugins/woocommerce/templates/content-single-product.php’), do_action(‘woocommerce_after_single_product_summary’), WP_Hook->do_action, WP_Hook->apply_filters, x_woocommerce_output_upsells, woocommerce_upsell_display, wc_get_template, include(’/themes/pro/woocommerce/single-product/up-sells.php’)

Hello There,

Please follow up the steps below:

  1. Test for a plugin conflict. You can do this by deactivating all third-party plugins, and see if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.
  2. Remove custom CSS and Javascript from the options or Child Theme and test the case.
  3. Increase the PHP Memory Limit of your server. Click here for more detailed information and how to increase the PHP memory limit.
  4. Provide us with your FTP account

Thank you.

Hi Thai,
As indicated, the problem appears to be the theme. There are zero bugs appearing when switched to the default Wordpress 2017 theme, and leaving all other settings, including plugins, active.

To each of your suggestions:

  1. If the site works in a default wordpress theme, without deactivating any plugin, it can’t be the plugins, can it?
  2. There is no custom css or javascript on the site that I am aware of; certainly nothing appearing within any of the theme locations, or on any of the pages
  3. The PHP Memory Limit is already set to 40m; how much higher do you want it to go?
  4. I will supply FTP details as soon as possible, but in the meantime, it would be helpful to get a response to the questions above. Your response doesn’t seem to answer the specific questions I’m asking, but more like a default set of actions one should take before reporting an issue.

I don’t have the expertise to read those errors effectively, but a plain english reading seems to indicate that there is an issue with some of the page templates calling an ‘undefined variable’. Which presumably means that the variable being called has no reference point in the theme files. Given that this bug doesn’t occur in a default wordpress theme, it seems reasonable to assume that the theme files are the issue.

Additional note: We have the WPIDE plugin installed, which will let you inspect the theme files from the wordpress admin

CSS Note:
The theme we have updated from - a Genesis Child Theme - has this custom css within it, but it doesn’t seem to be referenced anywhere that we can see:

/******************************************************************
Add your custom CSS here
******************************************************************/

.woocommerce ul.products li.product h3, .woocommerce-page ul.products li.product h3 {
line-height: 1.2em;
letter-spacing:-1px;
}

.woocommerce div.upsells li.product {
width: auto !important;
}
.woocommerce #footer-products li.product {
clear: none !important;
}
.footer-widgets div.wrap {
width: auto;
}
@media (max-width:1000px) and (min-width:960px) {
.footer-widgets div.wrap {
display: flex;
}
}
@media screen and (min-width:319px) and (max-width:425px){
.page-template-home-temp-php .content section#news-list article .more-link-wrap{
display:inline-block;
}
.page-template-home-temp-php .content section#news-list article .more-link-wrap:before, .page-template-home-temp-php .content section#news-list article .more-link-wrap:after{
right: 55% !important;
}
}
@media screen and (min-width:426px) and (max-width:768px){
.page-template-home-temp-php .content section#news-list article .more-link-wrap:before, .page-template-home-temp-php .content section#news-list article .more-link-wrap:after{
right: 77% !important;
}
}
@media screen and (min-width:769px) and (max-width:1024px){
.page-template-home-temp-php .content section#news-list article .more-link-wrap:before, .page-template-home-temp-php .content section#news-list article .more-link-wrap:after{
right: 35% !important;
}
}
@media screen and (min-width:1025px) and (max-width:1440px){
.page-template-home-temp-php .content section#news-list article .more-link-wrap:before, .page-template-home-temp-php .content section#news-list article .more-link-wrap:after{
right: 40% !important;
}
}
@media screen and (min-width:1920px) and (max-width:1441px){
.page-template-home-temp-php .content section#news-list article .more-link-wrap:before, .page-template-home-temp-php .content section#news-list article .more-link-wrap:after{
right: 25% !important;
}
}

Hi There,

The WP_MEMORY_LIMIT value should be 256M: https://docs.woocommerce.com/document/increasing-the-wordpress-memory-limit/.

Your custom CSS looks good.

May I disable some plugins on your website for testing?

Thank you very much!

The limit is set to 40M, with the maximum limit set to 256M

You can make any changes to the site that you wish for testing

Hi There,

I’ve upgraded the WooCommerce plugin to the latest version and the issue has gone.

Could you please go through your website and tell us what’s the issue you’re facing? I’ve already tried the latest version of WooCommerce at my local installation but couldn’t find any issues.

Many thanks.

This was stated in the very first post. Take a look at the debug bar now. While two warnings have gone away, they’ve been replaced by 14 others.

So in other words, this hasn’t solved anything for us, it’s just created a whole new, and already known, set of issues to respond to.

If you know how to address those 14 other warnings, we’re in good shape. Otherwise, I’m in a worse position than I was before.

Hey There,

Please try enabling the Related Products and Upsells options under Theme Options > WooCommerce and check if the values are blank like this:

If you see that, try setting them up then disable the options again.

Basically you can ignore PHP notices by disabling WordPress debug mode. Please refer to the following WordPress documentation handle on how to disable debugging mode (https://codex.wordpress.org/WP_DEBUG1).

Thanks.

I know how debug works. Why would I want to turn off warnings about issues that my adversely impact site performance?

As you can see when you look at the theme options yourself, these are already setup, and were when I handed the site over for review.

I have attached a screenshot showing the values.

You can actually see just by visiting a product page that the ‘related products’ are now showing up, and that for any product that has cross-sell and up-sell items enabled, they are showing up as well.

eg https://soulsong.icologi.com/product/aladdin-pants/
https://soulsong.icologi.com/product/cute-cardi/

So yes, we now have related products, and up-sells and cross sells appearing, but we now have an additional 14 warnings.

Ignoring these warnings is not best practise, and no developer would be satisfied with a response that says they’re safe to ignore. They’re not. They relate to the functionality of the site, and indicate that there are issues that require resolution. Frankly, if you haven’t analysed those warnings, or asked any questions about functionality that may have been adversely affected, you shouldn’t be advising that they’re safe to ignore.

As I said at the beginning of this thread, there is a lot of logic built into the original version of WooCommerce that we don’t have the time to tackle right now.

Additionally, since you upgraded WooCommerce, the product images are now shrunk to an absolutely useless size.

I need to get this site launched, without creating more issue than i Had when I began. Please advise

Hi All,
I can see that you uploaded the latest version of WooCommerce separately for testing thank you. However, it has now reverted to 3.4.4, instead of the earlier inactive version.
In short, I have lost the old version of WooCommerce that was made inactive, and need to get it back.
I have attempted to restore from Updraft Plus, but it was not successful. Please advise.

Hey Adam,

Upon checking your site, I see that WooCommerce is deactivated. I activated the it (3.4.4) and checked your pages and the sidebars are showing up. This is the core issue in this thread which can only be solved by updating. We understand you’re not ready to update but we can do nothing in this case. We could not fix version incompatibility.

You said there are 14 warnings but when I checked there are only 2.

You also said, that switching to the default WordPress theme, the notice is gone. Upon checking, it persists. You only see 1 warning in there because the 2017 theme does not use or WooCommerce features like Pro does. Based on what I saw, the notices come from WooCommerce itself. I also could not replicate the exact notices in my test site though I’m also using PHP 7.0.31 like in your setup. I only see 1 notice when going to WooCommerce related pages. But, please try downgrading and upgrading your PHP version.

We understand that ignoring warnings or notices is not a best practice. But, the first priority is for the theme features to function properly and notices are not critical to the site’s normal operation. That means PHP still allows the function to normally run. If PHP won’t support them anymore, the notice will become a Fatal Error.

Please also note the support staff’s role is not to fix theme issues. We’re here to report the issues in our issue tracker and it is our development team who prioritizes what issues to fix first. I’m going to post what I discovered. Just note that depending on the complexity of the issue, there might be no immediate solution so if you have a tight deadline, you should consult with a third party developer to fix the notices moreover that it’s coming from WooCommerce itself. The theme is only using WooCommerce functions.

Also, it is the user’s responsibility to keep track of WooCommerce updates like the image size. See https://woocommerce.wordpress.com/2017/12/11/wc-3-3-image-size-improvements/. You can fix your image size issue by re-configuring your image sizes. See https://theme.co/apex/forum/t/resizing-woocommerce-images/1706

Thanks.

Hi Christian,

Thanks for the helpful and detailed response. The warnings I reference are showing up on the product category pages, and individual product pages. If you are unable to replicate at your end, then perhaps there is an issue at ours. We will follow through on resolving what we can at our end.

And yes, I understand that it’s our responsibility to keep up to date on WC ourselves - I was simply calling out an issue that occurred post update by Themeco that we weren’t prepared for.

Cheers,
Cameron

Hopefully this is the final issue. In our plugins we now have two versions of WC installed.

Additionally, some of our plugins are calling out a reference to WC not being active.

How do we resolve this (note: we are currently running the database update in the background)

Hi There,

Please deactivate the active WooCommerce plugin(delete it after deactivated) then re-activate the one below:

It will solve this issue as well:

I’m ready to help you to install the correct WooCommerce plugin but your website is showing the 500 error now. Would you mind providing us with your FTP account?

Let us know how it goes!

Thanks Thai - we’re having a functions.php issue, and the lead dev is offline until tomorrow morning. Will update once we have the site restored.

On behalf of my colleague, you’re welcome. Cheers! :slight_smile: