Site logo

[Resolved] Woocommerce single product page layout – Sticky

Home Forums Support [Resolved] Woocommerce single product page layout – Sticky

Home Forums Support Woocommerce single product page layout – Sticky

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2182004
    pro123

    Hi Team,

    I have added below CSS code to the site and php code to the hook element (before_woocommerce_single_product_summary)
    This will make the Woocommerce short description and add to cart module sticky.

    Just wondering if it would be possible to stop being sticky when I reach the long description. Currently the sticky module goes over the long description when scrolling.

    I can adjust this width: 50%; /* match width of gallery stack */ but that would make related.products and upsells.products too small.

    In the private section the webshop details

    PHP:

    CSS:

    @media
    (min-width: 768px) {
    .woocommerce-product-gallery {
    display: none;
    }
    .woo-gallery-stack {
    width: 60%; /* adjust % to match container layout */
    float: left;
    padding: 10px;
    }
    .woocommerce div.product div.summary {
    position: -webkit-sticky;
    position: sticky;
    top: 120px;
    /* Adjust vertical position of sticky summary */
    }
    .single-product div.product .woocommerce-tabs,
    .single-product div.product .related.products,
    .single-product div.product .upsells.products {
    width: 100%; /* match width of gallery stack */
    display: inlineblock;
    }
    }

    Thanks in advance

    Regards,
    Luuk

    #2182023
    David
    Staff
    Customer Support

    Hi there,

    its trickier to do as the Tabs occupy the same parent container as the summary, which is a problem. And would require some development. Why not mirror what the Niche Site does ? See here:

    https://gpsites.co/niche/product/ninja-silhouette-2/

    If you follow ALL the steps here it will provide the same effect.

    https://generatepress.com/forums/search/niche+woo-gallery-stack/#post-2182013

    #2182113
    pro123

    Hi David,

    Thanks you very much. That what exactly what I was looking for.
    Last question, how can I make the WooCommerce single product page full width with some margin left and right.

    Thanks in advance

    #2182121
    David
    Staff
    Customer Support

    Simplest option to make it 100% and keep the padding use this CSS:

    .single-product .container {
        width: 100%;
        max-width: 100%;
    }
    #2182129
    pro123

    Thanks you very much!

    Resolved

    #2182297
    David
    Staff
    Customer Support

    Glad to be of help!

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