Can not place sidebar on Checkout page

Hi guys, I’m struggling to get a sidebar to display on my Checkout page. I’ve created a sidebar, assigned it to the checkout post, added widgets, but nothing. I’ve checked my global configuration and it’s set to …

Site Layout = full width (this is my preference)
Content Layout = Content Left, Sidebar Right.

Any advice? Here is the checkout page … https://prints.folioalbums.com/checkout/

Thanks

Hi there,

Please edit the checkout page and set its template to Layout - Content Left, Sidebar Right

Hope this helps.

Hi, thanks for coming back to me. The page is already set to “Layout - Content Left, Sidebar Right”, however still no sidebar.

Hello @stewartrandall,

Thanks for asking. :slight_smile:

Under Pro > Theme Options > Layout and Design > Content Layout make sure Fullwidth is not selected. https://cl.ly/3M3r3G3G0S3U

Thanks.

Hi Pransant … I’m confused … I already confirmed that Content Layout = Content Left, Sidebar Right in my very first message. Did someone read it?

Hey @stewartrandall,

Sorry for the confusion. Would you mind switching to Pro parent to check if the issue will persists. If it does, please give us WP Admin and access so we could check your setup and so we could try replicating it in our test site to see if this is a bug. If it’s fixed, there must be something in your child theme causing the issue.

Thanks.

Hi, I’ve copied my site on to a staging environment and activated the parent Pro theme. Still have the same issue. I’ll added a secure note with login details.

Hello There,

The given username is invalid. Please double check it.

Meanwhile, I have checked your checkout page and I can see the sidebar area. It is just blank at the moment. (http://prntscr.com/jd0ago). This could be because there are no widgets in the assigned sidebar or could be that the widgets assigned on this sidebar does not display anything.

We can confirm any of these once we will be able to log in and take a closer look at your sidebar settings.

Looking forward for the correct user credentials. Thanks.

Please try again, I managed to login with an annoymous browser without any issue.

Hi,

To assign sidebar to your checkout, you can add the codebelow in your child theme’s functions.php file


function assign_checkout_sidebar($sidebar){
 
        if (is_checkout()){
             return 'ups-sidebar-checkout-sidebar';        
         }
    
  return $sidebar;
}
add_filter( 'ups_sidebar', 'assign_checkout_sidebar');

Hope that helps.

Yes, that has worked … thanks!

So, due to the fact that we needed to added custom code to functions.php, is this considered a bug?

Hi stewartrandall,

I can get a sidebar on the Checkout page on my localhost demo, so this doesn’t sound like a bug for me, it could be either a plugin conflict on your site, or one of the codes added in child theme functions.php, if you want us to investigate further then please submit FTP access in a Secure Note as well.

Thanks.

Hi guys,

So here’s a strange things. I added the code above to my staging site’s functions.php and the sidebar appeared on the checkout page. Great!

I then added it to my live site and annoyingly the sidebar didn’t appear.

In an attempt to troubleshoot the issue I removed the code from both staging and live BUT interestingly the sidebar now continues to be displayed on my staging site (even without the code).

Any chance someone could check my live site to ensure the admin configuration is correct. I’ll re-add the code to functions.php. See private note for details.

Hope that all makes sense.

Thanks

Hello There,

Thanks for updating in! I have logged in and checked your site. Actually this isn’t a bug. The problem is that the sidebar did not displayed because you have assigned two sidebars for the check out page. Please only assign one sidebar to a page.

The code given by Paul is forcing the sidebar to display the “Checkout Sidebar” which has an ID of “ups-sidebar-checkout-sidebar”. The code may not work in your other site because it might not have the same ID for the sidebar or simply the sidebar did not exist in your other site.

Hope this explains your issue.

Thanks. I enabled that whilst troubleshooting the issue and forgot to uncheck after adding the code.

Cheers

You’re welcome!
We’re glad we were able to help you out.

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