Shopify themes, liquid, logos, and UX
Hi,
I've tried so many tutorials and various codes and got nowhere so asking for help on here,
Currently, working on homepage.
I have a featured products section and detest the quick add bulk option buttons.
I want to create something that looks like this using my own brand colours that I can use wherever I have products displayed. Happy to use the current dawn theme basket Svg icon
If anyone can help me with this using basic terminology it would be amazing!
Hi @lucylocket205 ,
To replace the quick add button with a custom design in the Dawn theme:
Edit HTML: In Edit Code, go to sections/product-grid.liquid or sections/featured-products.liquid . Replace the quick add button code with your custom button:
<button class="custom-add-to-cart">
<svg> <!-- Your cart icon here --> </svg>
Add to Cart
</button>
Style Button: In assets/theme.css, add styles for your button:
.custom-add-to-cart {
background-color: #your-brand-color;
color: white;
padding: 10px 20px;
}
.custom-add-to-cart:hover {
background-color: #darker-shade;
}
Optional - JavaScript: Use Shopify’s AJAX API to add products to the cart without redirecting.
Save and Test: Save your changes and preview your homepage.
Got it! If you found my suggestions helpful, please consider liking or marking it as a solution.
Your feedback is appreciated! If you have any more questions or need further assistance, just let me know.
Thanks & Regards
Akshay Bhatt
Thanks for your reply!
Just attempting your instructions but struggling to locate the quick add button code within the html log.
Is this it? If so what portion of it am I deleting? My html knowledge is so basic, I apologise for what could be really dumb questions!
Hi @lucylocket205,
Thank you for your question!
To achieve the customization of the "Quick Add" buttons on your Shopify Dawn theme, follow the steps below. The goal is to replace the current bulky button style with a more streamlined, custom-styled "Quick Add" button using your brand colors and the Dawn theme's basket SVG icon.
To begin, you need to customize the product card component.
Look for this block of code in product-card.liquid: {% render 'product-card', product: product %}
And add a custom class to the button for easier styling:
Replace: <button class="quick-add-button">Quick Add</button>
With:
<button class="custom-quick-add">
<svg class="icon icon-cart" width="20" height="20" viewBox="0 0 20 20">
<use xlink:href="#icon-cart"></use>
</svg>
Add to Cart
</button>
Now, let's add some custom styles using CSS:
Add this CSS to style the "Quick Add" button:
.custom-quick-add {
display: flex;
align-items: center;
justify-content: center;
background-color: #ff4500; /* Replace with your brand color */
color: #ffffff;
border-radius: 5px;
padding: 8px 12px;
font-weight: bold;
transition: background-color 0.3s ease;
border: none;
cursor: pointer;
}
.custom-quick-add:hover {
background-color: #e63900; /* Darker shade of your brand color */
}
.custom-quick-add .icon-cart {
margin-right: 5px;
}
To make sure you are using the Dawn theme basket SVG, you can verify its existence in icon-cart or modify the SVG if needed.
Example SVG code in icon-cart.liquid:
<svg width="20" height="20" viewBox="0 0 20 20" fill="none">
<path d="M5 5h10l-1 7H6L5 5zm0 0h10l1-3H4L5 5zm2 11a1 1 0 110 2 1 1 0 010-2zm6 0a1 1 0 110 2 1 1 0 010-2z"/>
</svg>
It's a little complicated but I hope you found this helpful!
Best,
Liz.
Thanks @LizHoang!
This looks great however, I've already encountered my first problem. I do not have this 'product-card.liquid file' in the sections folder. Could it have another name?
In the snippets folder I have located a file named card-product-liquid but this does not contain the following {% render 'product-card', product: product %} within the html as far as I can tell!
I look forward to hearing from you!
Dear @lucylocket205,
Sorry for the late response! Can you please share your store URL along with its protection password (if it had one) with me so I can help you further?
Liz.
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024