[Support request] Mini cart problems on single product page

Home Forums Support [Support request] Mini cart problems on single product page

Home Forums Support Mini cart problems on single product page

Viewing 4 posts - 16 through 19 (of 19 total)
  • Author
    Posts
  • #1497807
    Elvin
    Staff
    Customer Support

    You seem to have a plugin that changes the DOM structure.

    If you inspect your site, you’ll find that the whole page content is wrapped inside a <div id="ocs-site"...>

    The default DOM structure for this is: Demo Site

    <body>
    <nav> </nav> <--this is where you normally place the z-index so the cart items goes on top of the sticky add to cart.
    .
    <-- page contents Example: div#page -->
    .
    <div id="wc_sticky_cart_panel"></div> <-- this is the sticky add to cary panel. 
    </body>

    As you can see, it’s working well because the DOM structure isn’t altered.

    But your site instead has this structure:

    <body>
    <div id="ocs-site">
       <nav> </nav> 
       <-- page contents Example: div#page -->
    </div>
    <div id="wc_sticky_cart_panel"></div> <-- this is the sticky add to cary panel. 
    </body>

    Removing the plugin that causes this <div id="ocs-site"> wrap on page should address the issue.

    #1497880
    Elvin
    Staff
    Customer Support

    To add to this:

    Perhaps you can try this PHP snippet in hopes of also placing the sticky cart panel inside the page content wrapped by <div id="ocs-site">:

    remove_action( 'generate_after_footer', 'generatepress_wc_add_to_cart_helper' );
    add_action( 'generate_after_header', 'generatepress_wc_add_to_cart_helper' );

    What this snippet does is, it removes the sticky cart panel on the default place it was hooked on (after .site-footer) and then add it back after your header element.

    #1499508
    nik9

    Hi Elvin,

    Thanks. This is working. I can’t deactivate this plugin because I need this for a second off canvas sidebar. But the snipped work perfectly!! 🙂

    Thanks

    #1500578
    Elvin
    Staff
    Customer Support

    I can’t deactivate this plugin because I need this for a second off canvas sidebar.

    Yeah that made sense. That’s why I suggested we hook the sticky cart panel to generate_after_header on one of my previous replies so you could still continue using the plugin.

    Glad it’s working for you now.

    No problem. 🙂

Viewing 4 posts - 16 through 19 (of 19 total)
  • You must be logged in to reply to this topic.