Menu dawn thing

Menu dawn thing

Camronb29
Visitor
1 0 0

IMG_0023.jpeg

Hi how would I add an email submission to my dropdown menu and also country region on my website like the photo above I’m currently using Shopify dawn theme thanks in advance 

Reply 1 (1)

Rashman-tech
Tourist
10 2 0

Hi 

To add an email submission form and a country/region selector to your dropdown menu in the Dawn theme, you can follow these steps. I’ll break it down into sections for you!


1. Adding Email Submission to Your Dropdown Menu:

To add an email submission form in your dropdown menu, you'll need to modify the theme’s navigation or footer, depending on where you want the form to appear. I’ll assume it’s in the header dropdown.

Steps:

  1. Go to your Shopify admin > Online Store > Themes

  2. Click on "Actions" > "Edit Code"

  3. Open the header.liquid file, typically found under Sections.

Add the email form to the dropdown:

Look for the section where your dropdown menu is located (it could be inside a <nav> tag or a container). Insert the following HTML code where you want the email form to appear:

<div class="dropdown-email-submission">
  <form action="your-email-handler-url" method="POST">
    <label for="email">Subscribe to our newsletter:</label>
    <input type="email" id="email" name="email" placeholder="Enter your email" required>
    <button type="submit">Submit</button>
  </form>
</div>

Make sure to replace "your-email-handler-url" with the actual URL of the script that processes the email submission. Shopify doesn’t have a built-in email handler, so you may need a third-party app or a custom script to handle the submissions.

Add some styling (optional):

You can also add custom styles for the form. For example, in your base.css file, you could add:

.dropdown-email-submission form {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
}

.dropdown-email-submission input[type="email"] {
  padding: 8px;
  margin-bottom: 10px;
  width: 80%;
}

.dropdown-email-submission button {
  padding: 10px 20px;
  background-color: #000;
  color: #fff;
  border: none;
}

2. Adding Country/Region Selector to Your Dropdown Menu:

Shopify already has a built-in Country/Region selector that you can add to your website. To make it appear in your dropdown menu:

Steps:

  1. Go to your Shopify admin > Online Store > Themes

  2. Click on "Actions" > "Edit Code"

  3. Open header.liquid or navigation.liquid (depending on your theme) file in the Sections folder.

Add the Country/Region selector:

Shopify provides a simple way to add a country/region selector. Just paste this Liquid code inside your dropdown section:

{% form 'country' %}
  <select name="country" id="Country" onchange="this.form.submit()">
    {% for country in shop.countries %}
      <option value="{{ country.code }}" {% if country.code == shop.currency %}selected{% endif %}>{{ country.name }}</option>
    {% endfor %}
  </select>
{% endform %}

This code will dynamically load the countries/regions available for your store, and when a user selects one, it will update the region for the store.


Example (Combining Both Features):

If you want to have the email submission form and country selector within the same dropdown, you can structure the HTML like this:

<div class="dropdown-menu">
  <!-- Email Submission Form -->
  <div class="dropdown-email-submission">
    <form action="your-email-handler-url" method="POST">
      <label for="email">Subscribe to our newsletter:</label>
      <input type="email" id="email" name="email" placeholder="Enter your email" required>
      <button type="submit">Submit</button>
    </form>
  </div>
  
  <!-- Country/Region Selector -->
  <div class="dropdown-country-selector">
    <form action="your-country-handler-url" method="POST">
      <select name="country" id="Country" onchange="this.form.submit()">
        {% for country in shop.countries %}
          <option value="{{ country.code }}" {% if country.code == shop.currency %}selected{% endif %}>{{ country.name }}</option>
        {% endfor %}
      </select>
    </form>
  </div>
</div>

Add some CSS for styling and layout adjustment in base.css or theme.css to ensure both elements are aligned properly.


Final Thoughts:

  • Ensure your email handler is working with the email form.

  • The country/region selector will work out-of-the-box with Shopify's built-in functionality.

  • Always test the dropdown in both mobile and desktop views to ensure everything displays correctly.

If you have a specific design in mind, feel free to share more details or a screenshot, and I can provide further adjustments!

Let me know if you need more help!

Rashman