This snippet allows you to show the order entries directly on your cart drawer, providing real-time feedback to customers as they shop.
Why is coding needed? At the moment, Shopify does not provide a way to add App Blocks to a Cart Drawer. Additionally, there are many third-party cart drawer apps available, and the implementation might be slightly different depending on your theme or cart app.
Note: Implementing this requires minimum coding skills, though.
Watch the complete installation walkthrough:
[Screen recording will be available here]
Download the ready-to-use snippet file:
Download giveaway-cart-drawer-entries.zipFirst, download and extract the zip file using the button above.
giveaway-cart-drawer-entries.liquid filegiveaway-cart-drawer-entries.liquid fileThat's it! The snippet is now ready to use in your theme.
sections/cart-drawer.liquid (Dawn and most modern themes)snippets/cart-drawer.liquid (older themes)sections/main-cart-footer.liquid (some themes){% render 'giveaway-cart-drawer-entries', giveaway_id: 'YOUR_GIVEAWAY_ID' %}
YOUR_GIVEAWAY_ID with your actual Giveaway ID from the GiveawayNinja dashboard.
In sections/cart-drawer.liquid, add the snippet like this:
<div class="cart-drawer__footer">
{% render 'giveaway-cart-drawer-entries', giveaway_id: 'abc123xyz' %} <!-- ADD THIS -->
<div class="cart-drawer__footer-content">
<!-- existing checkout button code -->
</div>
</div>
The snippet supports the following parameters to customize its behavior and appearance:
giveaway_id - Required. Your GiveawayNinja Giveaway IDentries_label - Text shown when earning entries. Use {entries} placeholder. Default: "You're earning {entries} giveaway entries!"no_entries_label - Text shown when no entries earned. Default: "Add items to earn giveaway entries"min_order_not_reached_label - Text shown when minimum order requirement not met. Use {value} placeholder. Default: "No entries, minimum order required: ${value}"loading_label - Text shown while calculating. Default: "Calculating entries..."icon_emoji - Icon/emoji to display. Default: "🎟ï¸"hide_when_expired - Hide badge if giveaway expired. Default: falseshow_multiplier - Show time booster multiplier badge. Default: trueExample: Basic customization
{% render 'giveaway-cart-drawer-entries',
giveaway_id: 'YOUR_ID',
entries_label: 'You have {entries} tickets!',
no_entries_label: 'Add items to get tickets'
%}
Example: Full customization with all options
{% render 'giveaway-cart-drawer-entries',
giveaway_id: 'YOUR_ID',
entries_label: '🎉 Earning {entries} entries with this order!',
no_entries_label: 'Add qualifying items to earn entries',
min_order_not_reached_label: 'Minimum purchase of ${value} required for entries',
loading_label: 'Loading...',
icon_emoji: '🎫',
hide_when_expired: true,
show_multiplier: true
%}
Example: Hide when giveaway ends
{% render 'giveaway-cart-drawer-entries',
giveaway_id: 'YOUR_ID',
hide_when_expired: true
%}
Example: Custom minimum order message
{% render 'giveaway-cart-drawer-entries',
giveaway_id: 'YOUR_ID',
min_order_not_reached_label: 'Spend ${value} or more to earn giveaway entries!'
%}
Change colors: Open the snippet file and modify the CSS in the <style> section:
.giveaway-cart-drawer-wrapper {
background: linear-gradient(135deg, #YOUR_COLOR 0%, #YOUR_COLOR 100%);
border-color: #YOUR_COLOR; /* Border color */
}
.giveaway-cart-drawer-text {
color: #YOUR_COLOR; /* Text color */
}
.giveaway-multiplier-value {
color: #YOUR_COLOR; /* Multiplier badge color */
}
Before publishing to your live theme:
Counter doesn't appear:
Counter stuck on "Calculating entries...":
Counter doesn't update when cart changes:
Wrong entry calculation:
Minimum order message not showing:
Once your giveaway ends, remove the entry counter:
{% render 'giveaway-cart-drawer-entries'... %} lineThe complete snippet file (~630 lines, ~16 KB) includes all the functionality described in this guide, including: