[Resolved] Woo Shop Page – styling destroyed when it goes live

Home Forums Support [Resolved] Woo Shop Page – styling destroyed when it goes live

Home Forums Support Woo Shop Page – styling destroyed when it goes live

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1625092
    Matt

    I’ve created a new shop page from scratch using GenerateBlocks (on GP Child theme). It looks great until I finally reconfigure woocommerce to point to the new page. The formatting is changed slightly e.g full-width is no longer working. If I then use the block editor to make subtle changes (e.g. section padding) to correct the spacing, the page styling is destroyed to the point of being a write-off.

    I have the page configured as the woo shop page in my staging environment
    https://staging1.mattgoddardphotography.co.uk/prints/

    and you can see how it should look on my live site where it’s not configured as the woo shop page:
    https://mattgoddardphotography/prints-v2/

    What is going on?!

    #1625145
    David
    Staff
    Customer Support

    Hi there,

    how have you added the Block content to the Archive ? Is that using Block Elements ?
    If so this can be problematic, as currently GB cannot parse archive pages for block content – which leads to missing styles.

    I explain a better method for doing this kind of thing here:

    https://generatepress.com/forums/topic/customize-store-page-after-before-woocommerce-loop/#post-1623639

    #1625194
    Matt

    Hi David,

    No, it’s not made using GP elements – not all that familiar and wasn’t aware you could use it for Woocommerce archive.

    I added a new page with various blocks and multiple Woocommerce category blocks to add category archives one by one. I’m already using the same approach on my existing shop page (/prints) and it works well. But since creating a new page with GP Blocks it’s all gone horribly wrong.

    #1625229
    David
    Staff
    Customer Support

    Do you that page set as the Shop in n Woocommerce > Settings > Products – if so – clear the Shop Page field to stop woo from overwriting the static page.

    #1625270
    Matt

    I’ve cleared the shop page field – and that’s worked but I don’t understand why as I was taking the same approach with my previous shop page that was built using blocks, just not GPBlocks.

    This does create other issues –
    The recently viewed products at the very bottom looks a mess and the rating stars against each product are showing as ‘SSSSS’ instead of stars. I noticed this when building the page – but the issues go away when the shop page field is set. Are there other issues that I’ll bump into by leaving the shop page filed empty?

    #1625397
    Leo
    Staff
    Customer Support

    The recently viewed products at the very bottom looks a mess and the rating stars against each product are showing as ‘SSSSS’ instead of stars.

    I’ve seen this issue before but thought it was a plugin conflict or caching issue. Not 100% sure though.

    Are there other issues that I’ll bump into by leaving the shop page filed empty?

    I haven’t heard this before but it wouldn’t be a theme-related issue so might not be reported here.

    #1625905
    Matt

    Caching and CSS optimisation is disabled on my staging environment.

    The 1st thing woocommerce support would tell me would be to enter the shop page in the shop field, that’s what it’s there for after all?

    What’s different between my current shop page built using blocks on a GP theme, and one using GPblocks? I need to get this working.

    Thanks

    #1626098
    Matt

    Ok, I’ve figured out part of the issue.

    I’m using the Disable Woocommerce Bloat plugin (excellent performance plugin btw), and this disables woo css and scripts on non woo pages. By not defining the shop page in woo settings, my shop page is seen as a non-woo page and the styles and scripts are disabled.

    I’ve disabled this particular feature in the woo bloat plugin and will use a selective load plugin to disable woo assets from loading on non woo pages. So all is now good.

    It doesn’t explain why my new shop page that uses GP blocks doesn’t like being declared as the shop page – vs the previous blocks page that worked fine this way on the same website using the same child theme. I’ve tried setting the shop page again since applying the above fix and get the same result where page styling is altered (e.g. full width not working and a few other funnies).

    For now the ticket can be closed but I may come back to you if your recommended approach of leaving the shop field blank causes other knock-on issues further down the line.

    #1626156
    David
    Staff
    Customer Support

    GB Blocks uses Dyanamic CSS. It parses the page for any GB Blocks and prints ONLY the necessary CSS.
    At this time this only works with Static Pages / Posts, as GB cannot parse an Archive page. It something we’re looking at but this we have to be mindful that Gutenberg is implementing Full Site Editing so we don’t want to create something specifically in GP/GB that could be redundant.

    Other blocks generally add inline-css or static CSS style sheets don’t have this issue. But they suffer from adding lots of repetitive or unused CSS.

    The only knock on effect for using a Static Page as your Shop is the shop redirect link on an empty cart page or return to shop links won’t work. You can set the specific URL for the redirect using this PHP Snippet:

    function return_to_static_shop_page() {
        return 'http://yourdomain.com/your-page/';
    }
    add_filter( 'woocommerce_return_to_shop_redirect', 'return_to_static_shop_page' );
Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.