-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuttons-plus-minus-woocommerce-quantity
61 lines (54 loc) · 1.78 KB
/
buttons-plus-minus-woocommerce-quantity
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
****** STYLE DES BOUTONS *******
* Ligne 6 à 44 à insérer dans le style.css du child theme *
* Ligne 47 à 61 à insérer dans le functions.php du child thème *
* Changer ensuite les couleurs etc du style en fonction des besoins *
/* Bouton + & - Ajout produit */
.quantity {
display: flex !important;
flex-direction: row;
align-items: center;
}
@media (max-width:767px){
.quantity {
justify-content: flex-end !important;
}
}
button.minus, button.plus {
color: var(--e-global-color-text) !important;
border: 1px solid #dfdfdf !important;
transition: all 0.25s ease !important;
border-radius: 50px!important;
font-size: 18px !important;
background-color: #fff !important;
font-weight: 500 !important;
padding: 5px 13px !important;
}
button.minus:hover, button.plus:hover {
color: #fff !important;
border: 1px solid var( --e-global-color-secondary ) !important;
background-color: var( --e-global-color-secondary ) !important;
}
.woocommerce .quantity .qty {
width: 47px;
text-align: center;
}
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
appearance: none;
margin: 0;
}
input[type=number] {
-moz-appearance: textfield;
}
/******************************************************/
// 1. Afficher bouton plus et moins
/******************************************************/
add_action( 'woocommerce_after_quantity_input_field', 'wycan_display_quantity_plus' );
function wycan_display_quantity_plus() {
echo '<button type="button" class="plus">+</button>';
}
add_action( 'woocommerce_before_quantity_input_field', 'wycan_display_quantity_minus' );
function wycan_display_quantity_minus() {
echo '<button type="button" class="minus">-</button>';
}