Jump to content

How do I layer Commerce7 icons on top of my header?

Recommended Posts

Site URL: https://wines-by-gmd.squarespace.com/

I am building a site that is integrating Commerce7. The 'cart' and 'account' functionalities require a code block to pull those icons into the site. They currently live on the homepage (although I'd ideally like them to live in the code injection so they appear across the site) so I could figure out how to move them into the proper position. While I have figured out how to move them, they currently sit below the header and I can't figure out how to make them sit on top of the header. z-index does not seem to be interested. Any thoughts would be greatly appreciated. 

 

Site: https://wines-by-gmd.squarespace.com/
p/w: wines22 

Link to comment
  • Replies 8
  • Views 592
  • Created
  • Last Reply

Top Posters In This Topic

The password isn't working.

Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.

Would you like your customers to be able to mark their favourite products in your Squarespace store?

Link to comment

Site URL: https://portreecellars.com

I am trying to display two icons in the header (Login and cart) that are linked directly to our point of sale system (Commerce7). I have added commerce7's recommended code injection to get the Login/cart icons to display, however they display beneath the main site navigation. I uploaded a picture of what is currently happening and what I want to happen (all icons displayed in a single row, right aligned). Any help would be much appreciated.

password: portree

ideal.png

Not ideal.png

Link to comment

Current CSS code injection is as follows:

<!-- Adds the Commerce7 styles -->
<link href="https://cdn.commerce7.com/v2/commerce7.css" rel="stylesheet">

<script type="text/javascript">
    document.addEventListener('DOMContentLoaded', function(event) {
      var node = document.createElement('div')
      node.id = 'c7-tools'

      var accountNode = document.createElement('div')
      accountNode.id = 'c7-account'
      node.appendChild(accountNode)

      var cartNode = document.createElement('div')
      cartNode.id = 'c7-cart'
      node.appendChild(cartNode)

      var header = document.getElementsByClassName('header-nav-item')[4]
     header.appendChild(node)
  })
  

</script>

<script type="text/javascript" 
        src="https://cdn.commerce7.com/v2/commerce7.js" 
        id="c7-javascript" 
        data-tenant="louise-bernhard-wine">
</script>

<style type="text/css">
  
  /* ----- Header ------ */
  header {
      display: flex;
    align-items: center;
  }

  header #c7-tools {
      display: flex;
    justify-content: space-between;
    align-items: center;
    
  } 
</style>

Link to comment
  • 6 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.