Tagged: static block
Please note that this is custom modifications and lays beyond the scope of our theme basic support.
You may create child theme in wp-contents/themes/woo_child which comes with theme download package. Then copy and modify wp-content/themes/woocommerce/single-product.php after line 16 before woocommerce content and add additional widgetised sidebar area like it described in widgetised sidebar.
Add following code:
<?php dynamic_sidebar( 'yourcustomsidebar' ); ?>
then open fuctons.php of the chid theme and add next code to it as it decribed in article above:
/ See the __() WordPress function for valid values for $text_domain.
register_sidebar( array( 'id' => 'yourcustomsidebar', 'name' => __( 'Top Menu', $text_domain ), 'description' => __( 'This sidebar is located above the age logo.', $text_domain ), ) );
Then you will get new sidebar are which can be filled by static block.
Thank you! Did you mean content/themes/woopress/woocommerce/single-product.php? There’s no woocommerce under the themes. I’ve sent you the files I modified via wetransfer. Would you mind looking whether everything is correct. Thanks in advance! 🙂
1) Yes the pathes to the files are fine
2) Few minor chages i will suggest for sidebar additionally. The code in first file can be placed 1 or 2 lines higher the woocomerce plugin start rendering products: http://prntscr.com/f9p7nj.
3)The second file should contain double “//” before // See the __() WordPress function for valid values for $text_domain. or this line ca be removed completely and should like http://prntscr.com/f9p9tk
Hi Maks, I can see the custom sidebar under modules: https://prnt.sc/f9tjvq, but it doesn’t appear on single product pages. Any ideas? I really appreciate your help. I could give you access to my site. Maybe this is the fastest way to solve this?
Hello, for some reason it broke the front page layout generated by Woocommerce + Visual Composer. I’ve created a temporary user for you so you can log in and check it out. And there’s no static block on single product pages. The changes you made affected the front page only.
I have changed file to content-single-product whuch coressponds single product page but were no luck to login on your site with credentials you mentioned. Please clear your browser cache and check again.
Clearing cache didn’t help, the front page is still broken and there’s no block on single product pages. Please see the screenshot below (it should be a grid with pictures and everything not a row).
I’ve updated the password, would you please try again. Thanks for your help.
We have added code both in child and parent theme.
Please see appearance->widgets->customsidebar area and fill it with static block or else. See this link for example:
I saw also that a lot of links in shop are shortened and many product links are not working. Please disable all third pary plugins one by one as it seems that one of them is causing the issue. We have also updated woocommerce to the latest verson as it is fully compatible with our theme.
You may also use default widget area below description.
Hello, The sidebar is now visible, thank you. But, there’s another problem. I’m using a third party plugin for variables and it doesn’t work anymore, after the WooCommerce update. For many third party plugins, it takes time to get compatible with WooCommerce. Could you please switch it back to the previous version, I suspect plugins don’t work because of the update. This was also the case when 3.0 came out. The problem with products was caused by Yoast SEO, it’s disabled now.
The sidebar is okay, at the moment the problem is that none of the buttons/links/variations/galleries work on single product pages. All the clickable objects are broken. Obviously something happened and I don’t know what exactly. On May 18th everything worked flawlessly. I may have to roll back to previous version of the site, but I wouldn’t want to lose the custom sidebar you added. Or is there any other option?
UPDATE: Also, I just deactivated the variations plugin and they still don’t work, which makes me think the template itself is broken.
UPDATE1: I rolled back to version I had on 18th of May and everything worked fine. Then I copied/pasted the files, which where modified to add the custom sidebar and it broke the single product template again. So I guess, it happens because of the modifications on single product template?
Sorry , my bad. The problem were caused by woocommerce files incompitable with your wopress theme version. Please reenable child theme and check again. Please add the static block in the sidebar position “sidebar on single product page” you mentioned in previous creenshot. The method for creation custom sidebar areas is still avalible though i have removed its code for better sitespeed performance.
You must be logged in to reply to this topic.Log in/Sign up
One standard license is valid only for 1 project. Running multiple projects on a single license is a copyright violation.
The message was successfully sent
Your shopping cart is empty
Seems you did not register purchase code for WooPress WordPress Support Forum to be able to create a topic on this forum.