I would like to display the line in between the price and the color selector as shown, making sure it is correctly shown on both mobile and deesktop. How do I do this? Dawn does not give an option like this for product pages.
To add a divider line between the price and the color selector on your product pages in the Dawn theme, you’ll need to make some modifications to your theme code. Here’s a step-by-step guide on how to achieve this:
From your Shopify admin, go to “Online Store” and select “Themes.”
Locate your current Dawn theme and click on “Actions” > “Edit code.”
In the left-hand sidebar, under “Sections,” open the “product-template.liquid” file.
Scroll down to find the section that corresponds to the product options. It is typically labeled as {% section 'product-template-options' %}.
Within that section, locate the HTML code responsible for rendering the price and the color selector. It might look similar to the following:
<div class="product-form__item">
<label for="Color">{{ 'products.product.color' | t }}</label>
<select name="Color" id="Color">
<!-- Options for color selector -->
</select>
</div>
Add the following code just above the color selector code to create a divider line:
<hr class="product-divider">
Save the changes to the file.
To style the divider line, go to “Assets” and open the “theme.scss.liquid” file.
Add the following CSS code at the bottom of the file:
.product-divider {
margin: 20px 0;
border: none;
border-top: 1px solid #000; /* Adjust the color and styling as desired */
}
Save the changes to the file.
Preview your store to see the divider line added between the price and color selector on the product pages.
If you’re satisfied with the changes, click on “Actions” > “Publish” to make the modifications live on your store.
Please note that modifying your theme code requires basic knowledge of HTML, CSS, and liquid syntax. Make sure to backup your theme before making any changes and test the modifications thoroughly to ensure they work as expected on both mobile and desktop devices.