[Resolved] Blog vs. WooCommerce conflict again?

Home Forums Support [Resolved] Blog vs. WooCommerce conflict again?

Home Forums Support Blog vs. WooCommerce conflict again?

  • This topic has 23 replies, 3 voices, and was last updated 6 years ago by Tom.
Viewing 15 posts - 1 through 15 (of 24 total)
  • Author
    Posts
  • #530343
    Peter Duggan

    Just updated various plugins including GeneratePress and a WooCommerce update with updated database, and all appeared well till I discovered that the Blog home page is blank between main menu and footers. All the individual Blog posts are still accessible at their individual URLs.

    I strongly suspect WooCommerce here because we had menu conflict between WooCommerce and Blog (nicely resolved by Tom) when we first set the site up, but don’t know what to look for next and can’t deactivate WooCommerce to test my theory because that destroys the whole site.

    So any ideas, please?

    #530536
    Leo
    Staff
    Customer Support

    Hi there,

    Can you test it with only GP and WooCommerce activated?

    Had a similar issue is and it was causing by other plugins: https://generatepress.com/forums/topic/blank-blog-homepage/#post-530190

    Let me know.

    #530669
    Peter Duggan

    Hi Leo

    I already have done (both before I posted here and again just now to double-check), but still blank.

    #530674
    Peter Duggan

    The Menu bar search function is also affected. It had previously stopped working at all (clicking on it did nothing), which is partly why I did all the updates. Now you can type in it, but searching takes you to a blank Blog page even when searching from other pages.

    #531238
    Leo
    Staff
    Customer Support

    Hmm I see a couple errors from WooCommerce here: http://www.screencast.com/t/bSdgZgbT

    Can you ask their support to check first?

    Our demo site is running the most recent version of GP and WooCommerce and there aren’t any errors showing.

    Can you open a separate topic for separate question?

    Thanks!

    #531250
    Peter Duggan

    Sorry, whose WooCommerce installation is that?

    Sure, I can open another topic for the Search thing, but brought it up here because I thought it likely related (even part of the same problem/incompatibility if there is one).

    #531263
    Peter Duggan

    Just noticed that (with the site running a GP Premium child theme) I have a 1.6 child theme running on a 2.0.2 parent version… so anything suspicious there?

    At least WooCommerce says 2.0.2 parent, whereas Plugins reports 1.6.

    #531289
    Peter Duggan

    Well, I’ve just looked at the WooCommerce support forum at wordpress.org so I don’t get told I haven’t searched before posting my problem, and found this:

    https://wordpress.org/support/topic/woocommerce-has-broken-my-blog-posts/

    ‘Also because it is happening on your blog posts and not on your shop is another reason that points to a theme conflict rather than a woo problem.’

    So perhaps you can still help here?

    #531310
    Tom
    Lead Developer
    Lead Developer

    If you’re using Masonry, it uses javascript to fade the blog posts in.

    You have this javascript error: https://www.screencast.com/t/L1rgw7AQ

    Javascript errors will prevent other javascript from firing, which explains why your blog posts aren’t displaying.

    #531350
    Peter Duggan

    Hi Tom

    Sorry, my JavaScript is very limited!

    I did just try disabling Masonry, but it didn’t help. But I have just checked to see what I’ve got in my themes directory, and generatepress_child contains just three things: functions.php, screenshot.png and style.css.

    functions.php is nearly two years old and contains stuff related to both WooCommerce and Masonry I didn’t write but you might have helped me with here before, so quoting in case that helps:

    <?php
    /**
     * Generate child theme functions and definitions
     *
     * @package Generate
     */
    
    /* https://generatepress.com/forums/topic/remove-metabox-from-posts/ */
    
    add_action( 'after_setup_theme','generate_remove_metaboxes' );
    function generate_remove_metaboxes()
    {
    	remove_action('add_meta_boxes', 'generate_add_layout_meta_box');
    	remove_action('add_meta_boxes', 'generate_add_footer_widget_meta_box');
    	remove_action( 'add_meta_boxes', 'generate_add_de_meta_box' );
    }
    
    /* https://generatepress.com/forums/topic/hide-sidebar-in-woocommerce-search-results-page/ */
    
    add_filter( 'generate_sidebar_layout','generate_custom_woocommerce_sidebar_layout' );
    function generate_custom_woocommerce_sidebar_layout( $layout )
    {
     	// If we are on a woocommerce page, set the sidebar
     	if ( is_woocommerce() )
     	 	return 'no-sidebar';
    
     	// Or else, set the regular layout
     	return $layout;
    
     }
    
    add_filter('generate_blog_masonry','generate_blog_woocommerce_masonry');
    function generate_blog_woocommerce_masonry()
    {
    	// Disable in WooCommerce
    	if ( is_woocommerce() )
    		return 'false';
    
    	// Check if blog
    	if ( is_home() )
    		return 'true';
    	
            // Otherwise, disable it
    	return 'false';
    }
    #531402
    Tom
    Lead Developer
    Lead Developer

    The issue is your server isn’t allowing the browser to load a cookie script, which is required by WooCommerce.

    You can see the issue by adding this to your address bar:

    http://YOURURL.com/wp-content/plugins/woocommerce/assets/js/js-cookie/js.cookie.min.js?ver=2.1.4

    If you contact your hosting and show them this issue, they should be able to fix it for you.

    #531429
    Peter Duggan

    Thanks, Tom, I’ve contacted my hosting and will let you know.

    #531525
    Peter Duggan

    OK, they’re quoting me a Mod_security message which appears slightly confused by stray (?) question marks and colons, but the bit that’s not at all garbled is ‘[msg “Cross-site Scripting (XSS) Attack”] [data “.cookie”] [severity “CRITICAL”] [tag “WEB_ATTACK/XSS”]’.

    I’m also advised, ‘Please have a check with your developer and if you wish to whitelist this rule for the domain, please let us know.’

    So… is it as dramatic as it sounds or is that just Apache being careful/missing the point? In other words, is it safe?

    #531902
    Tom
    Lead Developer
    Lead Developer

    The URL I pointed out is definitely safe. It’s just a javascript file within the WooCommerce plugin, which is hosted on your server. It’s not like it’s coming from a different domain.

    #532648
    Peter Duggan

    Thanks, Tom… all sorted now!

    Couldn’t see how it could be anything but one of my WooCommerce files, but sometimes get stumped by stuff I don’t recognise and didn’t write, and don’t know JavaScript like HTML, CSS and (some) PHP.

    Search is fixed too now by the same means, though I’d prefer to keep a straight search results listing with Masonry blog if possible, so will search here to see if there’s an existing solution for that and ask separately if necessary.

    Cheers
    Peter

Viewing 15 posts - 1 through 15 (of 24 total)
  • You must be logged in to reply to this topic.