If then minimaal bestelbedrag
Graag leg ik het volgende probleem neer, op http://delekkerstebbq.nl heb ik een probleem.
Dit is een met WP, Avada en Woocommerce opgebouwde site, nu heb ik een stuk PHP code in elkaar gepuzzelt (HTML en CSS is meer mijn skill) alleen nu kom ik er niet meer uit.
Code (php)
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
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
<?php
// Woocommerce minimum Waarde
add_action( 'woocommerce_checkout_process', 'wc_minimum_order_amount' );
add_action( 'woocommerce_before_cart' , 'wc_minimum_order_amount' );
function wc_minimum_order_amount() {
// Set this variable to specify a minimum order value
$minimum = 150;
if ( WC()->cart->total < $minimum ) {
if( is_cart() ) {
wc_print_notice(
sprintf( 'Het minimale bedrag van %s om uw BBQ thuis te laten bezorgen is nog niet behaald, je huidige totaal is %s.' ,
wc_price( $minimum ),
wc_price( WC()->cart->total )
), 'error'
);
} else {
wc_add_notice(
sprintf( 'Het minimale bedrag van %s om uw BBQ thuis te laten bezorgen is nog niet behaald, je huidige totaal is %s.' ,
wc_price( $minimum ),
wc_price( WC()->cart->total )
), 'error'
);
}
}
}
?>
// Woocommerce minimum Waarde
add_action( 'woocommerce_checkout_process', 'wc_minimum_order_amount' );
add_action( 'woocommerce_before_cart' , 'wc_minimum_order_amount' );
function wc_minimum_order_amount() {
// Set this variable to specify a minimum order value
$minimum = 150;
if ( WC()->cart->total < $minimum ) {
if( is_cart() ) {
wc_print_notice(
sprintf( 'Het minimale bedrag van %s om uw BBQ thuis te laten bezorgen is nog niet behaald, je huidige totaal is %s.' ,
wc_price( $minimum ),
wc_price( WC()->cart->total )
), 'error'
);
} else {
wc_add_notice(
sprintf( 'Het minimale bedrag van %s om uw BBQ thuis te laten bezorgen is nog niet behaald, je huidige totaal is %s.' ,
wc_price( $minimum ),
wc_price( WC()->cart->total )
), 'error'
);
}
}
}
?>
Met deze code hanteer ik een minimale bestelhoeveelheid; echter wil ik dit alleen van toepassing laten zijn bij verzenden.
Wanneer de verzending ID: local_pickup is, is eer geen minimum.
Ik hoop dat iemand me hierbij kan helpen, waarscheinlijk is het voor iemand die continu in PHP bezig is erg eenvoudig?
mvg
Pepijn
- Aar -:
Ik heb de code tags aangepast naar [code][/code]-tags. Hier kan je meer lezen over de mogelijke opmaakcodes.
Alvast bedankt!
Alvast bedankt!
Gewijzigd op 21/04/2015 10:21:27 door - Ariën -
Er zijn nog geen reacties op dit bericht.