Backoffice - max cost margin #31

Merged
bilal.catic merged 22 commits from backoffice-max-cost-margin into master 2018-10-15 00:24:34 +02:00
Showing only changes of commit d7c34c3b0b - Show all commits

View File

@@ -3,7 +3,7 @@
class Wiaas_Checkout {
public static function init(){
add_action( 'woocommerce_before_checkout_process', array(__CLASS__, 'validate_wiaas_packages'));
add_action( 'woocommerce_check_cart_items', array(__CLASS__, 'validate_wiaas_packages'));
}
public static function validate_wiaas_packages(){
@@ -33,13 +33,8 @@ class Wiaas_Checkout {
wc_set_time_limit( 0 );
do_action( 'woocommerce_before_checkout_process' );
if(wc_notice_count( 'error' ) > 0) {
return false;
}
$customer = wp_get_current_user();
$order_id = WC()->checkout()->create_order(array());
$order = wc_get_order( $order_id );
$customer = wp_get_current_user();
// Check if cart empty before proceeding
if (WC()->cart->is_empty()) {