Static block position - by fabregas - on WordPress WooCommerce support

This topic has 18 replies, 2 voices, and was last updated 7 years, 6 months ago ago by Max Mullins

  • Avatar: fabregas
    fabregas
    Participant
    May 18, 2017 at 10:57

    Hello, how can I add static block right below the menu (and above product info) on single product pages. As I understand I’d have to modify the page template, but exactly how? Please advise. Thank you!

    17 Answers
    Avatar: maxmullins
    Max Mullins
    Participant
    May 18, 2017 at 13:59

    Hello @fabregas

    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.

    Regards,
    Max Mullins

    Avatar: fabregas
    fabregas
    Participant
    May 18, 2017 at 20:54

    Hey!

    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! 🙂

    Please, contact administrator
    for this information.
    Avatar: maxmullins
    Max Mullins
    Participant
    May 19, 2017 at 15:10

    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

    Regards,
    Maks Mullins

    Avatar: fabregas
    fabregas
    Participant
    May 19, 2017 at 21:13

    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?

    Please, contact administrator
    for this information.
    Avatar: maxmullins
    Max Mullins
    Participant
    May 22, 2017 at 09:41

    @fabregas

    Please provide us with temporary ftp to your site in private content.

    Regards,
    Max Mullins

    Avatar: fabregas
    fabregas
    Participant
    May 22, 2017 at 12:21

    Hello,

    Thank you, I’ve sent you the details. The site is not published at this stage.

    Please, contact administrator
    for this information.
    Avatar: maxmullins
    Max Mullins
    Participant
    May 22, 2017 at 14:19

    Hello @fabregas
    Please check you site now.

    Regards,
    Max Mullins

    Avatar: fabregas
    fabregas
    Participant
    May 22, 2017 at 18:00

    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.

    Please, contact administrator
    for this information.
    Avatar: maxmullins
    Max Mullins
    Participant
    May 23, 2017 at 13:06

    Hello @fabregas.

    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.

    Regards,
    Max Mullins

    Avatar: fabregas
    fabregas
    Participant
    May 23, 2017 at 13:23

    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.

    Please, contact administrator
    for this information.
    Avatar: maxmullins
    Max Mullins
    Participant
    May 23, 2017 at 14:36

    Hello, @fabregas.

    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:
    link
    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.

    Regards,
    Max Mullins

    Avatar: fabregas
    fabregas
    Participant
    May 23, 2017 at 15:03

    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.

    Please, contact administrator
    for this information.
    Avatar: maxmullins
    Max Mullins
    Participant
    May 23, 2017 at 15:17

    Hello @fabregas.

    Ok. We have reinstalled the previous version.

    Regards,
    Max Mullins

    Avatar: fabregas
    fabregas
    Participant
    May 23, 2017 at 16:24

    Is it possible that the additional sidebar or changes you made broke the layout on single product pages? Variations/product gallery don’t work and there’s a horizontal line, which wasn’t there before.

    Avatar: maxmullins
    Max Mullins
    Participant
    May 23, 2017 at 17:12

    The changes we made is only sidebar adding. Please provide us with desired layout screnshot to make changes. You may discard them via deleting woocommerce file in child theme.

    Regards,
    Max Mullins

    Avatar: fabregas
    fabregas
    Participant
    May 23, 2017 at 17:32

    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?

    Please, contact administrator
    for this information.
    Avatar: maxmullins
    Max Mullins
    Participant
    May 24, 2017 at 22:43

    Hello @fabregas,

    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.

    Regards,
    Max Mullins

  • Viewing 18 results - 1 through 18 (of 18 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.