
Variants As Separate Products
- No Bulky Libraries Used
- 3-Days Return Policy
- Easy to use
- No Bulky Libraries Used
- 3-Days Return Policy
- Easy to use
- No Bulky Libraries Used
- 3-Days Return Policy
- Easy to use
- No Bulky Libraries Used
- 3-Days Return Policy
- Easy to use
Product Description
variants-as-separate-products.liquid
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
{% assign cds = section.id | replace: '_', '' | downcase %}
{% style %}
.variant-products-{{ cds }} {
padding: {{ section.settings.section_padding_top }}px 0 {{ section.settings.section_padding_bottom }}px;
}
.variant-products-container-{{ cds }} {
max-width: 1400px;
margin: 0 auto;
padding: 0 20px;
}
.variant-products-header-{{ cds }} {
text-align: {{ section.settings.heading_alignment }};
margin-bottom: 40px;
}
.variant-products-title-{{ cds }} {
margin: 0 0 12px;
color: {{ section.settings.heading_color }};
font-size: {{ section.settings.heading_size }}px;
}
.variant-products-description-{{ cds }} {
margin: 0;
color: {{ section.settings.text_color }};
font-size: {{ section.settings.description_size }}px;
}
.variant-products-grid-{{ cds }} {
display: grid;
grid-template-columns: repeat({{ section.settings.columns_desktop }}, 1fr);
gap: {{ section.settings.grid_gap }}px;
}
.variant-card-{{ cds }} {
background: {{ section.settings.card_background }};
border: {{ section.settings.card_border_width }}px solid {{ section.settings.card_border_color }};
border-radius: {{ section.settings.card_border_radius }}px;
padding: {{ section.settings.card_padding }}px;
text-align: center;
transition: transform 0.3s ease, box-shadow 0.3s ease;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.variant-card-{{ cds }}:hover {
transform: translateY(-4px);
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}
.variant-image-wrapper-{{ cds }} {
position: relative;
width: 100%;
margin-bottom: 16px;
overflow: hidden;
border-radius: {{ section.settings.image_border_radius }}px;
}
.variant-image-{{ cds }} {
width: 100%;
height: auto;
display: block;
aspect-ratio: {{ section.settings.image_ratio }};
object-fit: cover;
}
.variant-image-placeholder-{{ cds }} {
width: 100%;
aspect-ratio: {{ section.settings.image_ratio }};
background-color: #f4f4f4;
display: flex;
align-items: center;
justify-content: center;
}
.variant-image-placeholder-{{ cds }} svg {
width: 60%;
height: 60%;
opacity: 0.3;
}
.variant-badge-{{ cds }} {
position: absolute;
top: 12px;
left: 12px;
background: {{ section.settings.badge_background }};
color: {{ section.settings.badge_text_color }};
padding: 6px 12px;
border-radius: 20px;
font-size: 12px;
font-weight: 600;
text-transform: uppercase;
}
.variant-info-{{ cds }} {
margin-bottom: 16px;
}
.variant-title-{{ cds }} {
margin: 0 0 8px;
font-size: {{ section.settings.variant_title_size }}px;
color: {{ section.settings.variant_title_color }};
font-weight: 600;
}
.variant-option-{{ cds }} {
margin: 0 0 12px;
font-size: {{ section.settings.variant_option_size }}px;
color: {{ section.settings.variant_option_color }};
}
.variant-price-{{ cds }} {
margin: 0 0 16px;
font-size: {{ section.settings.price_size }}px;
color: {{ section.settings.price_color }};
font-weight: 600;
}
.variant-price-compare-{{ cds }} {
text-decoration: line-through;
opacity: 0.6;
margin-left: 8px;
font-size: {{ section.settings.price_size | times: 0.9 }}px;
}
.variant-button-{{ cds }} {
display: inline-block;
width: 100%;
padding: 12px 24px;
background: {{ section.settings.button_background }};
color: {{ section.settings.button_text_color }};
border: {{ section.settings.button_border_width }}px solid {{ section.settings.button_border_color }};
border-radius: {{ section.settings.button_border_radius }}px;
text-decoration: none;
font-size: 14px;
font-weight: 600;
text-transform: uppercase;
transition: all 0.3s ease;
cursor: pointer;
}
.variant-button-{{ cds }}:hover {
background: {{ section.settings.button_hover_background }};
color: {{ section.settings.button_hover_text_color }};
border-color: {{ section.settings.button_hover_border_color }};
}
.variant-button-{{ cds }}:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.empty-state-{{ cds }} {
text-align: center;
padding: 60px 20px;
color: #666;
}
.empty-state-{{ cds }} svg {
max-width: 300px;
margin: 0 auto 20px;
opacity: 0.3;
}
@media screen and (max-width: 989px) {
.variant-products-grid-{{ cds }} {
grid-template-columns: repeat({{ section.settings.columns_tablet }}, 1fr);
}
}
@media screen and (max-width: 749px) {
.variant-products-grid-{{ cds }} {
grid-template-columns: repeat({{ section.settings.columns_mobile }}, 1fr);
}
.variant-products-title-{{ cds }} {
font-size: {{ section.settings.heading_size | times: 0.7 }}px;
}
.variant-card-{{ cds }} {
padding: {{ section.settings.card_padding | times: 0.75 }}px;
}
}
{% endstyle %}
{% comment %}
LOGIC: Determine the collection source.
1. Use section setting if provided.
2. Fallback to global collection object (if on collection page).
{% endcomment %}
{% assign target_collection = section.settings.collection %}
{% if target_collection == blank and collection != blank %}
{% assign target_collection = collection %}
{% endif %}
<div class="variant-products-{{ cds }}" {{ section.shopify_attributes }}>
<div class="variant-products-container-{{ cds }}">
{% if section.settings.heading != blank or section.settings.description != blank %}
<div class="variant-products-header-{{ cds }}">
{% if section.settings.heading != blank %}
<h2 class="variant-products-title-{{ cds }}">{{ section.settings.heading }}</h2>
{% endif %}
{% if section.settings.description != blank %}
<div class="variant-products-description-{{ cds }}">{{ section.settings.description }}</div>
{% endif %}
</div>
{% endif %}
{% if target_collection != blank %}
{% assign products_to_show = target_collection.products %}
{% if section.settings.product_limit > 0 %}
{% assign product_limit = section.settings.product_limit %}
{% else %}
{% assign product_limit = products_to_show.size %}
{% endif %}
{% assign variant_count = 0 %}
{% assign has_variants = false %}
{% if products_to_show.size > 0 %}
<div class="variant-products-grid-{{ cds }}">
{% for product in products_to_show limit: product_limit %}
{% for variant in product.variants %}
{% if section.settings.show_unavailable or variant.available %}
{% assign variant_count = variant_count | plus: 1 %}
{% assign has_variants = true %}
<div class="variant-card-{{ cds }}">
<div class="variant-card-top-{{ cds }}">
<div class="variant-image-wrapper-{{ cds }}">
{% if variant.image %}
<img
src="{{ variant.image | image_url: width: 600 }}"
alt="{{ variant.title | escape }}"
loading="lazy"
width="600"
height="600"
class="variant-image-{{ cds }}"
>
{% elsif product.featured_image %}
<img
src="{{ product.featured_image | image_url: width: 600 }}"
alt="{{ product.title | escape }}"
loading="lazy"
width="600"
height="600"
class="variant-image-{{ cds }}"
>
{% else %}
<div class="variant-image-placeholder-{{ cds }}">
{{ 'product-1' | placeholder_svg_tag }}
</div>
{% endif %}
{% if section.settings.show_badges %}
{% if variant.available == false %}
<div class="variant-badge-{{ cds }}">Sold Out</div>
{% elsif variant.compare_at_price > variant.price %}
<div class="variant-badge-{{ cds }}">Sale</div>
{% endif %}
{% endif %}
</div>
<div class="variant-info-{{ cds }}">
{% if section.settings.show_product_title %}
<h3 class="variant-title-{{ cds }}">{{ product.title }}</h3>
{% endif %}
<p class="variant-option-{{ cds }}">{{ variant.title }}</p>
<div class="variant-price-{{ cds }}">
{{ variant.price | money }}
{% if variant.compare_at_price > variant.price %}
<span class="variant-price-compare-{{ cds }}">{{ variant.compare_at_price | money }}</span>
{% endif %}
</div>
</div>
</div>
<div class="variant-card-bottom-{{ cds }}">
{% if variant.available %}
<a
href="{{ variant.url }}"
class="variant-button-{{ cds }}"
>
{{ section.settings.button_text }}
</a>
{% else %}
<button
class="variant-button-{{ cds }}"
disabled
>
Unavailable
</button>
{% endif %}
</div>
</div>
{% endif %}
{% endfor %}
{% endfor %}
</div>
{% if has_variants == false %}
<div class="empty-state-{{ cds }}">
{{ 'collection-1' | placeholder_svg_tag }}
<p>No available variants found in this collection.</p>
</div>
{% endif %}
{% else %}
<div class="empty-state-{{ cds }}">
{{ 'collection-1' | placeholder_svg_tag }}
<p>This collection is empty. Add products to see them here.</p>
</div>
{% endif %}
{% else %}
<div class="empty-state-{{ cds }}">
{{ 'collection-1' | placeholder_svg_tag }}
<p>Please select a collection in the section settings, or visit a collection page to see variants.</p>
</div>
{% endif %}
</div>
</div>
{% schema %}
{
"name": "Collection variants grid",
"settings": [
{
"type": "header",
"content": "Data Source"
},
{
"type": "collection",
"id": "collection",
"label": "Collection",
"info": "Select a collection to display. Leave empty to use the current page's collection."
},
{
"type": "header",
"content": "Products"
},
{
"type": "range",
"id": "product_limit",
"min": 0,
"max": 50,
"step": 1,
"label": "Product limit",
"default": 12,
"info": "Set to 0 to show all products. Note: Each product's variants will be shown separately, so the total card count may be much higher than this number."
},
{
"type": "checkbox",
"id": "show_unavailable",
"label": "Show unavailable variants",
"default": false
},
{
"type": "header",
"content": "Content"
},
{
"type": "text",
"id": "heading",
"label": "Heading",
"default": "All Variants"
},
{
"type": "textarea",
"id": "description",
"label": "Description",
"default": "Browse all available variants from our collection"
},
{
"type": "select",
"id": "heading_alignment",
"label": "Heading alignment",
"options": [
{
"value": "left",
"label": "Left"
},
{
"value": "center",
"label": "Center"
},
{
"value": "right",
"label": "Right"
}
],
"default": "center"
},
{
"type": "checkbox",
"id": "show_product_title",
"label": "Show product title",
"default": true
},
{
"type": "checkbox",
"id": "show_badges",
"label": "Show badges",
"default": true
},
{
"type": "text",
"id": "button_text",
"label": "Button text",
"default": "View Product"
},
{
"type": "header",
"content": "Layout"
},
{
"type": "range",
"id": "columns_desktop",
"min": 2,
"max": 5,
"step": 1,
"label": "Columns on desktop",
"default": 4
},
{
"type": "range",
"id": "columns_tablet",
"min": 2,
"max": 4,
"step": 1,
"label": "Columns on tablet",
"default": 3
},
{
"type": "select",
"id": "columns_mobile",
"label": "Columns on mobile",
"options": [
{
"value": "1",
"label": "1"
},
{
"value": "2",
"label": "2"
}
],
"default": "2"
},
{
"type": "range",
"id": "grid_gap",
"min": 10,
"max": 50,
"step": 5,
"unit": "px",
"label": "Grid gap",
"default": 20
},
{
"type": "select",
"id": "image_ratio",
"label": "Image ratio",
"options": [
{
"value": "1/1",
"label": "Square"
},
{
"value": "3/4",
"label": "Portrait"
},
{
"value": "4/3",
"label": "Landscape"
}
],
"default": "1/1"
},
{
"type": "header",
"content": "Colors"
},
{
"type": "color",
"id": "heading_color",
"label": "Heading",
"default": "#a42325"
},
{
"type": "color",
"id": "text_color",
"label": "Description",
"default": "#000000"
},
{
"type": "color",
"id": "card_background",
"label": "Card background",
"default": "#ffffff"
},
{
"type": "color",
"id": "card_border_color",
"label": "Card border",
"default": "#e6e6e6"
},
{
"type": "color",
"id": "variant_title_color",
"label": "Product title",
"default": "#000000"
},
{
"type": "color",
"id": "variant_option_color",
"label": "Variant option",
"default": "#666666"
},
{
"type": "color",
"id": "price_color",
"label": "Price",
"default": "#a42325"
},
{
"type": "color",
"id": "badge_background",
"label": "Badge background",
"default": "#a42325"
},
{
"type": "color",
"id": "badge_text_color",
"label": "Badge text",
"default": "#ffffff"
},
{
"type": "header",
"content": "Button style"
},
{
"type": "color",
"id": "button_background",
"label": "Background",
"default": "#a42325"
},
{
"type": "color",
"id": "button_text_color",
"label": "Text",
"default": "#ffffff"
},
{
"type": "color",
"id": "button_border_color",
"label": "Border",
"default": "#a42325"
},
{
"type": "color",
"id": "button_hover_background",
"label": "Hover background",
"default": "#780406"
},
{
"type": "color",
"id": "button_hover_text_color",
"label": "Hover text",
"default": "#ffffff"
},
{
"type": "color",
"id": "button_hover_border_color",
"label": "Hover border",
"default": "#780406"
},
{
"type": "range",
"id": "button_border_width",
"min": 0,
"max": 4,
"step": 1,
"unit": "px",
"label": "Border width",
"default": 0
},
{
"type": "range",
"id": "button_border_radius",
"min": 0,
"max": 50,
"step": 2,
"unit": "px",
"label": "Border radius",
"default": 0
},
{
"type": "header",
"content": "Typography"
},
{
"type": "range",
"id": "heading_size",
"min": 20,
"max": 60,
"step": 2,
"unit": "px",
"label": "Heading size",
"default": 32
},
{
"type": "range",
"id": "description_size",
"min": 12,
"max": 24,
"step": 1,
"unit": "px",
"label": "Description size",
"default": 16
},
{
"type": "range",
"id": "variant_title_size",
"min": 12,
"max": 24,
"step": 1,
"unit": "px",
"label": "Product title size",
"default": 16
},
{
"type": "range",
"id": "variant_option_size",
"min": 12,
"max": 20,
"step": 1,
"unit": "px",
"label": "Variant option size",
"default": 14
},
{
"type": "range",
"id": "price_size",
"min": 14,
"max": 28,
"step": 1,
"unit": "px",
"label": "Price size",
"default": 18
},
{
"type": "header",
"content": "Spacing"
},
{
"type": "range",
"id": "section_padding_top",
"min": 0,
"max": 100,
"step": 5,
"unit": "px",
"label": "Top padding",
"default": 50
},
{
"type": "range",
"id": "section_padding_bottom",
"min": 0,
"max": 100,
"step": 5,
"unit": "px",
"label": "Bottom padding",
"default": 50
},
{
"type": "range",
"id": "card_padding",
"min": 10,
"max": 40,
"step": 2,
"unit": "px",
"label": "Card padding",
"default": 20
},
{
"type": "range",
"id": "card_border_width",
"min": 0,
"max": 4,
"step": 1,
"unit": "px",
"label": "Card border width",
"default": 1
},
{
"type": "range",
"id": "card_border_radius",
"min": 0,
"max": 20,
"step": 2,
"unit": "px",
"label": "Card border radius",
"default": 0
},
{
"type": "range",
"id": "image_border_radius",
"min": 0,
"max": 20,
"step": 2,
"unit": "px",
"label": "Image border radius",
"default": 0
}
],
"presets": [
{
"name": "Show Variant As Separate Products"
}
]
}
{% endschema %}
Reviews (0)
Add a review
Variants As Separate Products
Rating*
0/5
* Rating is required
Your review
* Review is required
Name
* Name is required
Email
* Email is required
Add photos or video to your review
Related products
-


Gadget Theme – Shopify
₹19,999.00Original price was: ₹19,999.00.₹14,999.00Current price is: ₹14,999.00. -


StickyCart – Sticky Add to cart
₹2,499.00Original price was: ₹2,499.00.₹1,499.00Current price is: ₹1,499.00.Rated 5.00 out of 5 -


Anti Theft Shopify – Disable Right Click, Text Selection and Shortcuts
₹0.00 -

Different Images for Desktop & Mobile – Shopify | Horizon Theme

Reviews
There are no reviews yet