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 14eda981b7 - Show all commits

View File

@@ -13,7 +13,8 @@ class Wiaas_Checkout {
$item_id = $item['data']->get_id();
if (wc_pb_is_bundle_container_cart_item($item) &&
(Wiaas_Package_Status::get_package_status($item_id) !== Wiaas_Package_Status::AVAILABLE)){
throw new Exception('Package ' . $item['data']->get_title() . ' cannot be purchased at the moment');
wc_add_notice( 'Package ' . $item['data']->get_title() . ' cannot be purchased at the moment', 'error' );
return false;
}
}
}
@@ -32,6 +33,9 @@ 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());