-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcode_customise_product.liquid
executable file
·77 lines (71 loc) · 1.68 KB
/
code_customise_product.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
/* APLICAR NO PRODUCT-INFO-LIQUID*/
{% for tag in product.tags %}
{% if tag == 'personalizar' %}
<div
class="personalizacao"
id="aparecer"
style="width:100%;">
{% render "campo-de-personalizacao" %}
</div>
{% endif %}
{% endfor %}
<style>
@media screen and (min-width:720px) {
.personalizacao {
border: solid 1px black;
border-radius: 40px;
padding: 10px;
width: min-content;
margin-bottom: 30px;
color: #000000;
display: block;
border: none;
}
}
@media screen and (max-width:720px) {
.personalizacao {
border: solid 1px black;
border-radius: 40px;
padding: 10px;
width: 90%;
margin-bottom: 30px;
color: #000000;
display: block;
border: none;
}
}
.personalizacao p {
margin-bottom: 0 !important;
color: #fff;
}
.personalizacao input {
border: solid 1px black;
border-radius: 40px;
padding: 10px 50px;
color: #9e9e9e;
}
.personalizar {
margin-bottom: 20px !important;
}
#aparecer {
display: none;
}
</style>
<script>
window.onload = function() {
if ($('.detect_selected').html() == "Personalizar") {
$('#aparecer').css({display: "block"});
}
};
$('.detect_variant').change(function() {
if (this.value == 'Personalizar') {
$('#aparecer').css({display: "block"});
document.getElementById('nomecamisa').required = true;
document.getElementById('numcamisa').required = true;
} else {
$('#aparecer').css({display: "none"});
document.getElementById('nomecamisa').required = false;
document.getElementById('numcamisa').required = false;
}
});
</script>